From 261493af0b7c00e8a17b8dbf45d932e9744f4856 Mon Sep 17 00:00:00 2001 From: ZiRo Date: Tue, 17 May 2016 08:24:46 +0200 Subject: [PATCH 1/3] add cuckoo miner to postform --- contrib/js/cuckoo_miner.js | 13 + contrib/static/miner-js.js | 27637 ++++++++++++++++++ contrib/static/mineworker.js | 6 + contrib/static/nntpchan.js | 3 + contrib/templates/default/postform.mustache | 8 + contrib/translations/en-US.ini | 3 + 6 files changed, 27670 insertions(+) create mode 100644 contrib/js/cuckoo_miner.js create mode 100644 contrib/static/miner-js.js create mode 100644 contrib/static/mineworker.js diff --git a/contrib/js/cuckoo_miner.js b/contrib/js/cuckoo_miner.js new file mode 100644 index 0000000..fee545d --- /dev/null +++ b/contrib/js/cuckoo_miner.js @@ -0,0 +1,13 @@ +onready(function(){ + document.getElementById("start_miner").onclick = function() { + var worker = new Worker("./static/mineworker.js"); + worker.onmessage = function(e) { + miner_cb(e.data); + worker.terminate(); + } + worker.postMessage(55.0); // Start the worker. + }; +}); +function miner_cb(s) { + document.getElementById("miner_result").value = s; +} diff --git a/contrib/static/miner-js.js b/contrib/static/miner-js.js new file mode 100644 index 0000000..adb7c3b --- /dev/null +++ b/contrib/static/miner-js.js @@ -0,0 +1,27637 @@ +"use strict"; +(function() { + +Error.stackTraceLimit = Infinity; + +var $global, $module; +if (typeof window !== "undefined") { /* web page */ + $global = window; +} else if (typeof self !== "undefined") { /* web worker */ + $global = self; +} else if (typeof global !== "undefined") { /* Node.js */ + $global = global; + $global.require = require; +} else { /* others (e.g. Nashorn) */ + $global = this; +} + +if ($global === undefined || $global.Array === undefined) { + throw new Error("no global object found"); +} +if (typeof module !== "undefined") { + $module = module; +} + +var $packages = {}, $idCounter = 0; +var $keys = function(m) { return m ? Object.keys(m) : []; }; +var $flushConsole = function() {}; +var $throwRuntimeError; /* set by package "runtime" */ +var $throwNilPointerError = function() { $throwRuntimeError("invalid memory address or nil pointer dereference"); }; +var $call = function(fn, rcvr, args) { return fn.apply(rcvr, args); }; +var $makeFunc = function(fn) { return function() { return fn(new ($sliceType($jsObjectPtr))($global.Array.prototype.slice.call(arguments, []))); } }; + +var $mapArray = function(array, f) { + var newArray = new array.constructor(array.length); + for (var i = 0; i < array.length; i++) { + newArray[i] = f(array[i]); + } + return newArray; +}; + +var $methodVal = function(recv, name) { + var vals = recv.$methodVals || {}; + recv.$methodVals = vals; /* noop for primitives */ + var f = vals[name]; + if (f !== undefined) { + return f; + } + var method = recv[name]; + f = function() { + $stackDepthOffset--; + try { + return method.apply(recv, arguments); + } finally { + $stackDepthOffset++; + } + }; + vals[name] = f; + return f; +}; + +var $methodExpr = function(typ, name) { + var method = typ.prototype[name]; + if (method.$expr === undefined) { + method.$expr = function() { + $stackDepthOffset--; + try { + if (typ.wrapped) { + arguments[0] = new typ(arguments[0]); + } + return Function.call.apply(method, arguments); + } finally { + $stackDepthOffset++; + } + }; + } + return method.$expr; +}; + +var $ifaceMethodExprs = {}; +var $ifaceMethodExpr = function(name) { + var expr = $ifaceMethodExprs["$" + name]; + if (expr === undefined) { + expr = $ifaceMethodExprs["$" + name] = function() { + $stackDepthOffset--; + try { + return Function.call.apply(arguments[0][name], arguments); + } finally { + $stackDepthOffset++; + } + }; + } + return expr; +}; + +var $subslice = function(slice, low, high, max) { + if (low < 0 || high < low || max < high || high > slice.$capacity || max > slice.$capacity) { + $throwRuntimeError("slice bounds out of range"); + } + var s = new slice.constructor(slice.$array); + s.$offset = slice.$offset + low; + s.$length = slice.$length - low; + s.$capacity = slice.$capacity - low; + if (high !== undefined) { + s.$length = high - low; + } + if (max !== undefined) { + s.$capacity = max - low; + } + return s; +}; + +var $sliceToArray = function(slice) { + if (slice.$length === 0) { + return []; + } + if (slice.$array.constructor !== Array) { + return slice.$array.subarray(slice.$offset, slice.$offset + slice.$length); + } + return slice.$array.slice(slice.$offset, slice.$offset + slice.$length); +}; + +var $decodeRune = function(str, pos) { + var c0 = str.charCodeAt(pos); + + if (c0 < 0x80) { + return [c0, 1]; + } + + if (c0 !== c0 || c0 < 0xC0) { + return [0xFFFD, 1]; + } + + var c1 = str.charCodeAt(pos + 1); + if (c1 !== c1 || c1 < 0x80 || 0xC0 <= c1) { + return [0xFFFD, 1]; + } + + if (c0 < 0xE0) { + var r = (c0 & 0x1F) << 6 | (c1 & 0x3F); + if (r <= 0x7F) { + return [0xFFFD, 1]; + } + return [r, 2]; + } + + var c2 = str.charCodeAt(pos + 2); + if (c2 !== c2 || c2 < 0x80 || 0xC0 <= c2) { + return [0xFFFD, 1]; + } + + if (c0 < 0xF0) { + var r = (c0 & 0x0F) << 12 | (c1 & 0x3F) << 6 | (c2 & 0x3F); + if (r <= 0x7FF) { + return [0xFFFD, 1]; + } + if (0xD800 <= r && r <= 0xDFFF) { + return [0xFFFD, 1]; + } + return [r, 3]; + } + + var c3 = str.charCodeAt(pos + 3); + if (c3 !== c3 || c3 < 0x80 || 0xC0 <= c3) { + return [0xFFFD, 1]; + } + + if (c0 < 0xF8) { + var r = (c0 & 0x07) << 18 | (c1 & 0x3F) << 12 | (c2 & 0x3F) << 6 | (c3 & 0x3F); + if (r <= 0xFFFF || 0x10FFFF < r) { + return [0xFFFD, 1]; + } + return [r, 4]; + } + + return [0xFFFD, 1]; +}; + +var $encodeRune = function(r) { + if (r < 0 || r > 0x10FFFF || (0xD800 <= r && r <= 0xDFFF)) { + r = 0xFFFD; + } + if (r <= 0x7F) { + return String.fromCharCode(r); + } + if (r <= 0x7FF) { + return String.fromCharCode(0xC0 | r >> 6, 0x80 | (r & 0x3F)); + } + if (r <= 0xFFFF) { + return String.fromCharCode(0xE0 | r >> 12, 0x80 | (r >> 6 & 0x3F), 0x80 | (r & 0x3F)); + } + return String.fromCharCode(0xF0 | r >> 18, 0x80 | (r >> 12 & 0x3F), 0x80 | (r >> 6 & 0x3F), 0x80 | (r & 0x3F)); +}; + +var $stringToBytes = function(str) { + var array = new Uint8Array(str.length); + for (var i = 0; i < str.length; i++) { + array[i] = str.charCodeAt(i); + } + return array; +}; + +var $bytesToString = function(slice) { + if (slice.$length === 0) { + return ""; + } + var str = ""; + for (var i = 0; i < slice.$length; i += 10000) { + str += String.fromCharCode.apply(undefined, slice.$array.subarray(slice.$offset + i, slice.$offset + Math.min(slice.$length, i + 10000))); + } + return str; +}; + +var $stringToRunes = function(str) { + var array = new Int32Array(str.length); + var rune, j = 0; + for (var i = 0; i < str.length; i += rune[1], j++) { + rune = $decodeRune(str, i); + array[j] = rune[0]; + } + return array.subarray(0, j); +}; + +var $runesToString = function(slice) { + if (slice.$length === 0) { + return ""; + } + var str = ""; + for (var i = 0; i < slice.$length; i++) { + str += $encodeRune(slice.$array[slice.$offset + i]); + } + return str; +}; + +var $copyString = function(dst, src) { + var n = Math.min(src.length, dst.$length); + for (var i = 0; i < n; i++) { + dst.$array[dst.$offset + i] = src.charCodeAt(i); + } + return n; +}; + +var $copySlice = function(dst, src) { + var n = Math.min(src.$length, dst.$length); + $copyArray(dst.$array, src.$array, dst.$offset, src.$offset, n, dst.constructor.elem); + return n; +}; + +var $copyArray = function(dst, src, dstOffset, srcOffset, n, elem) { + if (n === 0 || (dst === src && dstOffset === srcOffset)) { + return; + } + + if (src.subarray) { + dst.set(src.subarray(srcOffset, srcOffset + n), dstOffset); + return; + } + + switch (elem.kind) { + case $kindArray: + case $kindStruct: + if (dst === src && dstOffset > srcOffset) { + for (var i = n - 1; i >= 0; i--) { + elem.copy(dst[dstOffset + i], src[srcOffset + i]); + } + return; + } + for (var i = 0; i < n; i++) { + elem.copy(dst[dstOffset + i], src[srcOffset + i]); + } + return; + } + + if (dst === src && dstOffset > srcOffset) { + for (var i = n - 1; i >= 0; i--) { + dst[dstOffset + i] = src[srcOffset + i]; + } + return; + } + for (var i = 0; i < n; i++) { + dst[dstOffset + i] = src[srcOffset + i]; + } +}; + +var $clone = function(src, type) { + var clone = type.zero(); + type.copy(clone, src); + return clone; +}; + +var $pointerOfStructConversion = function(obj, type) { + if(obj.$proxies === undefined) { + obj.$proxies = {}; + obj.$proxies[obj.constructor.string] = obj; + } + var proxy = obj.$proxies[type.string]; + if (proxy === undefined) { + var properties = {}; + for (var i = 0; i < type.elem.fields.length; i++) { + (function(fieldProp) { + properties[fieldProp] = { + get: function() { return obj[fieldProp]; }, + set: function(value) { obj[fieldProp] = value; } + }; + })(type.elem.fields[i].prop); + } + proxy = Object.create(type.prototype, properties); + proxy.$val = proxy; + obj.$proxies[type.string] = proxy; + proxy.$proxies = obj.$proxies; + } + return proxy; +}; + +var $append = function(slice) { + return $internalAppend(slice, arguments, 1, arguments.length - 1); +}; + +var $appendSlice = function(slice, toAppend) { + if (toAppend.constructor === String) { + var bytes = $stringToBytes(toAppend); + return $internalAppend(slice, bytes, 0, bytes.length); + } + return $internalAppend(slice, toAppend.$array, toAppend.$offset, toAppend.$length); +}; + +var $internalAppend = function(slice, array, offset, length) { + if (length === 0) { + return slice; + } + + var newArray = slice.$array; + var newOffset = slice.$offset; + var newLength = slice.$length + length; + var newCapacity = slice.$capacity; + + if (newLength > newCapacity) { + newOffset = 0; + newCapacity = Math.max(newLength, slice.$capacity < 1024 ? slice.$capacity * 2 : Math.floor(slice.$capacity * 5 / 4)); + + if (slice.$array.constructor === Array) { + newArray = slice.$array.slice(slice.$offset, slice.$offset + slice.$length); + newArray.length = newCapacity; + var zero = slice.constructor.elem.zero; + for (var i = slice.$length; i < newCapacity; i++) { + newArray[i] = zero(); + } + } else { + newArray = new slice.$array.constructor(newCapacity); + newArray.set(slice.$array.subarray(slice.$offset, slice.$offset + slice.$length)); + } + } + + $copyArray(newArray, array, newOffset + slice.$length, offset, length, slice.constructor.elem); + + var newSlice = new slice.constructor(newArray); + newSlice.$offset = newOffset; + newSlice.$length = newLength; + newSlice.$capacity = newCapacity; + return newSlice; +}; + +var $equal = function(a, b, type) { + if (type === $jsObjectPtr) { + return a === b; + } + switch (type.kind) { + case $kindComplex64: + case $kindComplex128: + return a.$real === b.$real && a.$imag === b.$imag; + case $kindInt64: + case $kindUint64: + return a.$high === b.$high && a.$low === b.$low; + case $kindArray: + if (a.length !== b.length) { + return false; + } + for (var i = 0; i < a.length; i++) { + if (!$equal(a[i], b[i], type.elem)) { + return false; + } + } + return true; + case $kindStruct: + for (var i = 0; i < type.fields.length; i++) { + var f = type.fields[i]; + if (!$equal(a[f.prop], b[f.prop], f.typ)) { + return false; + } + } + return true; + case $kindInterface: + return $interfaceIsEqual(a, b); + default: + return a === b; + } +}; + +var $interfaceIsEqual = function(a, b) { + if (a === $ifaceNil || b === $ifaceNil) { + return a === b; + } + if (a.constructor !== b.constructor) { + return false; + } + if (a.constructor === $jsObjectPtr) { + return a.object === b.object; + } + if (!a.constructor.comparable) { + $throwRuntimeError("comparing uncomparable type " + a.constructor.string); + } + return $equal(a.$val, b.$val, a.constructor); +}; + +var $min = Math.min; +var $mod = function(x, y) { return x % y; }; +var $parseInt = parseInt; +var $parseFloat = function(f) { + if (f !== undefined && f !== null && f.constructor === Number) { + return f; + } + return parseFloat(f); +}; + +var $froundBuf = new Float32Array(1); +var $fround = Math.fround || function(f) { + $froundBuf[0] = f; + return $froundBuf[0]; +}; + +var $imul = Math.imul || function(a, b) { + var ah = (a >>> 16) & 0xffff; + var al = a & 0xffff; + var bh = (b >>> 16) & 0xffff; + var bl = b & 0xffff; + return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0) >> 0); +}; + +var $floatKey = function(f) { + if (f !== f) { + $idCounter++; + return "NaN$" + $idCounter; + } + return String(f); +}; + +var $flatten64 = function(x) { + return x.$high * 4294967296 + x.$low; +}; + +var $shiftLeft64 = function(x, y) { + if (y === 0) { + return x; + } + if (y < 32) { + return new x.constructor(x.$high << y | x.$low >>> (32 - y), (x.$low << y) >>> 0); + } + if (y < 64) { + return new x.constructor(x.$low << (y - 32), 0); + } + return new x.constructor(0, 0); +}; + +var $shiftRightInt64 = function(x, y) { + if (y === 0) { + return x; + } + if (y < 32) { + return new x.constructor(x.$high >> y, (x.$low >>> y | x.$high << (32 - y)) >>> 0); + } + if (y < 64) { + return new x.constructor(x.$high >> 31, (x.$high >> (y - 32)) >>> 0); + } + if (x.$high < 0) { + return new x.constructor(-1, 4294967295); + } + return new x.constructor(0, 0); +}; + +var $shiftRightUint64 = function(x, y) { + if (y === 0) { + return x; + } + if (y < 32) { + return new x.constructor(x.$high >>> y, (x.$low >>> y | x.$high << (32 - y)) >>> 0); + } + if (y < 64) { + return new x.constructor(0, x.$high >>> (y - 32)); + } + return new x.constructor(0, 0); +}; + +var $mul64 = function(x, y) { + var high = 0, low = 0; + if ((y.$low & 1) !== 0) { + high = x.$high; + low = x.$low; + } + for (var i = 1; i < 32; i++) { + if ((y.$low & 1<>> (32 - i); + low += (x.$low << i) >>> 0; + } + } + for (var i = 0; i < 32; i++) { + if ((y.$high & 1< yHigh) || (xHigh === yHigh && xLow > yLow))) { + yHigh = (yHigh << 1 | yLow >>> 31) >>> 0; + yLow = (yLow << 1) >>> 0; + n++; + } + for (var i = 0; i <= n; i++) { + high = high << 1 | low >>> 31; + low = (low << 1) >>> 0; + if ((xHigh > yHigh) || (xHigh === yHigh && xLow >= yLow)) { + xHigh = xHigh - yHigh; + xLow = xLow - yLow; + if (xLow < 0) { + xHigh--; + xLow += 4294967296; + } + low++; + if (low === 4294967296) { + high++; + low = 0; + } + } + yLow = (yLow >>> 1 | yHigh << (32 - 1)) >>> 0; + yHigh = yHigh >>> 1; + } + + if (returnRemainder) { + return new x.constructor(xHigh * rs, xLow * rs); + } + return new x.constructor(high * s, low * s); +}; + +var $divComplex = function(n, d) { + var ninf = n.$real === Infinity || n.$real === -Infinity || n.$imag === Infinity || n.$imag === -Infinity; + var dinf = d.$real === Infinity || d.$real === -Infinity || d.$imag === Infinity || d.$imag === -Infinity; + var nnan = !ninf && (n.$real !== n.$real || n.$imag !== n.$imag); + var dnan = !dinf && (d.$real !== d.$real || d.$imag !== d.$imag); + if(nnan || dnan) { + return new n.constructor(NaN, NaN); + } + if (ninf && !dinf) { + return new n.constructor(Infinity, Infinity); + } + if (!ninf && dinf) { + return new n.constructor(0, 0); + } + if (d.$real === 0 && d.$imag === 0) { + if (n.$real === 0 && n.$imag === 0) { + return new n.constructor(NaN, NaN); + } + return new n.constructor(Infinity, Infinity); + } + var a = Math.abs(d.$real); + var b = Math.abs(d.$imag); + if (a <= b) { + var ratio = d.$real / d.$imag; + var denom = d.$real * ratio + d.$imag; + return new n.constructor((n.$real * ratio + n.$imag) / denom, (n.$imag * ratio - n.$real) / denom); + } + var ratio = d.$imag / d.$real; + var denom = d.$imag * ratio + d.$real; + return new n.constructor((n.$imag * ratio + n.$real) / denom, (n.$imag - n.$real * ratio) / denom); +}; + +var $kindBool = 1; +var $kindInt = 2; +var $kindInt8 = 3; +var $kindInt16 = 4; +var $kindInt32 = 5; +var $kindInt64 = 6; +var $kindUint = 7; +var $kindUint8 = 8; +var $kindUint16 = 9; +var $kindUint32 = 10; +var $kindUint64 = 11; +var $kindUintptr = 12; +var $kindFloat32 = 13; +var $kindFloat64 = 14; +var $kindComplex64 = 15; +var $kindComplex128 = 16; +var $kindArray = 17; +var $kindChan = 18; +var $kindFunc = 19; +var $kindInterface = 20; +var $kindMap = 21; +var $kindPtr = 22; +var $kindSlice = 23; +var $kindString = 24; +var $kindStruct = 25; +var $kindUnsafePointer = 26; + +var $methodSynthesizers = []; +var $addMethodSynthesizer = function(f) { + if ($methodSynthesizers === null) { + f(); + return; + } + $methodSynthesizers.push(f); +}; +var $synthesizeMethods = function() { + $methodSynthesizers.forEach(function(f) { f(); }); + $methodSynthesizers = null; +}; + +var $ifaceKeyFor = function(x) { + if (x === $ifaceNil) { + return 'nil'; + } + var c = x.constructor; + return c.string + '$' + c.keyFor(x.$val); +}; + +var $identity = function(x) { return x; }; + +var $typeIDCounter = 0; + +var $idKey = function(x) { + if (x.$id === undefined) { + $idCounter++; + x.$id = $idCounter; + } + return String(x.$id); +}; + +var $newType = function(size, kind, string, name, pkg, constructor) { + var typ; + switch(kind) { + case $kindBool: + case $kindInt: + case $kindInt8: + case $kindInt16: + case $kindInt32: + case $kindUint: + case $kindUint8: + case $kindUint16: + case $kindUint32: + case $kindUintptr: + case $kindUnsafePointer: + typ = function(v) { this.$val = v; }; + typ.wrapped = true; + typ.keyFor = $identity; + break; + + case $kindString: + typ = function(v) { this.$val = v; }; + typ.wrapped = true; + typ.keyFor = function(x) { return "$" + x; }; + break; + + case $kindFloat32: + case $kindFloat64: + typ = function(v) { this.$val = v; }; + typ.wrapped = true; + typ.keyFor = function(x) { return $floatKey(x); }; + break; + + case $kindInt64: + typ = function(high, low) { + this.$high = (high + Math.floor(Math.ceil(low) / 4294967296)) >> 0; + this.$low = low >>> 0; + this.$val = this; + }; + typ.keyFor = function(x) { return x.$high + "$" + x.$low; }; + break; + + case $kindUint64: + typ = function(high, low) { + this.$high = (high + Math.floor(Math.ceil(low) / 4294967296)) >>> 0; + this.$low = low >>> 0; + this.$val = this; + }; + typ.keyFor = function(x) { return x.$high + "$" + x.$low; }; + break; + + case $kindComplex64: + typ = function(real, imag) { + this.$real = $fround(real); + this.$imag = $fround(imag); + this.$val = this; + }; + typ.keyFor = function(x) { return x.$real + "$" + x.$imag; }; + break; + + case $kindComplex128: + typ = function(real, imag) { + this.$real = real; + this.$imag = imag; + this.$val = this; + }; + typ.keyFor = function(x) { return x.$real + "$" + x.$imag; }; + break; + + case $kindArray: + typ = function(v) { this.$val = v; }; + typ.wrapped = true; + typ.ptr = $newType(4, $kindPtr, "*" + string, "", "", function(array) { + this.$get = function() { return array; }; + this.$set = function(v) { typ.copy(this, v); }; + this.$val = array; + }); + typ.init = function(elem, len) { + typ.elem = elem; + typ.len = len; + typ.comparable = elem.comparable; + typ.keyFor = function(x) { + return Array.prototype.join.call($mapArray(x, function(e) { + return String(elem.keyFor(e)).replace(/\\/g, "\\\\").replace(/\$/g, "\\$"); + }), "$"); + }; + typ.copy = function(dst, src) { + $copyArray(dst, src, 0, 0, src.length, elem); + }; + typ.ptr.init(typ); + Object.defineProperty(typ.ptr.nil, "nilCheck", { get: $throwNilPointerError }); + }; + break; + + case $kindChan: + typ = function(v) { this.$val = v; }; + typ.wrapped = true; + typ.keyFor = $idKey; + typ.init = function(elem, sendOnly, recvOnly) { + typ.elem = elem; + typ.sendOnly = sendOnly; + typ.recvOnly = recvOnly; + }; + break; + + case $kindFunc: + typ = function(v) { this.$val = v; }; + typ.wrapped = true; + typ.init = function(params, results, variadic) { + typ.params = params; + typ.results = results; + typ.variadic = variadic; + typ.comparable = false; + }; + break; + + case $kindInterface: + typ = { implementedBy: {}, missingMethodFor: {} }; + typ.keyFor = $ifaceKeyFor; + typ.init = function(methods) { + typ.methods = methods; + methods.forEach(function(m) { + $ifaceNil[m.prop] = $throwNilPointerError; + }); + }; + break; + + case $kindMap: + typ = function(v) { this.$val = v; }; + typ.wrapped = true; + typ.init = function(key, elem) { + typ.key = key; + typ.elem = elem; + typ.comparable = false; + }; + break; + + case $kindPtr: + typ = constructor || function(getter, setter, target) { + this.$get = getter; + this.$set = setter; + this.$target = target; + this.$val = this; + }; + typ.keyFor = $idKey; + typ.init = function(elem) { + typ.elem = elem; + typ.wrapped = (elem.kind === $kindArray); + typ.nil = new typ($throwNilPointerError, $throwNilPointerError); + }; + break; + + case $kindSlice: + typ = function(array) { + if (array.constructor !== typ.nativeArray) { + array = new typ.nativeArray(array); + } + this.$array = array; + this.$offset = 0; + this.$length = array.length; + this.$capacity = array.length; + this.$val = this; + }; + typ.init = function(elem) { + typ.elem = elem; + typ.comparable = false; + typ.nativeArray = $nativeArray(elem.kind); + typ.nil = new typ([]); + }; + break; + + case $kindStruct: + typ = function(v) { this.$val = v; }; + typ.wrapped = true; + typ.ptr = $newType(4, $kindPtr, "*" + string, "", "", constructor); + typ.ptr.elem = typ; + typ.ptr.prototype.$get = function() { return this; }; + typ.ptr.prototype.$set = function(v) { typ.copy(this, v); }; + typ.init = function(fields) { + typ.fields = fields; + fields.forEach(function(f) { + if (!f.typ.comparable) { + typ.comparable = false; + } + }); + typ.keyFor = function(x) { + var val = x.$val; + return $mapArray(fields, function(f) { + return String(f.typ.keyFor(val[f.prop])).replace(/\\/g, "\\\\").replace(/\$/g, "\\$"); + }).join("$"); + }; + typ.copy = function(dst, src) { + for (var i = 0; i < fields.length; i++) { + var f = fields[i]; + switch (f.typ.kind) { + case $kindArray: + case $kindStruct: + f.typ.copy(dst[f.prop], src[f.prop]); + continue; + default: + dst[f.prop] = src[f.prop]; + continue; + } + } + }; + /* nil value */ + var properties = {}; + fields.forEach(function(f) { + properties[f.prop] = { get: $throwNilPointerError, set: $throwNilPointerError }; + }); + typ.ptr.nil = Object.create(constructor.prototype, properties); + typ.ptr.nil.$val = typ.ptr.nil; + /* methods for embedded fields */ + $addMethodSynthesizer(function() { + var synthesizeMethod = function(target, m, f) { + if (target.prototype[m.prop] !== undefined) { return; } + target.prototype[m.prop] = function() { + var v = this.$val[f.prop]; + if (f.typ === $jsObjectPtr) { + v = new $jsObjectPtr(v); + } + if (v.$val === undefined) { + v = new f.typ(v); + } + return v[m.prop].apply(v, arguments); + }; + }; + fields.forEach(function(f) { + if (f.name === "") { + $methodSet(f.typ).forEach(function(m) { + synthesizeMethod(typ, m, f); + synthesizeMethod(typ.ptr, m, f); + }); + $methodSet($ptrType(f.typ)).forEach(function(m) { + synthesizeMethod(typ.ptr, m, f); + }); + } + }); + }); + }; + break; + + default: + $panic(new $String("invalid kind: " + kind)); + } + + switch (kind) { + case $kindBool: + case $kindMap: + typ.zero = function() { return false; }; + break; + + case $kindInt: + case $kindInt8: + case $kindInt16: + case $kindInt32: + case $kindUint: + case $kindUint8 : + case $kindUint16: + case $kindUint32: + case $kindUintptr: + case $kindUnsafePointer: + case $kindFloat32: + case $kindFloat64: + typ.zero = function() { return 0; }; + break; + + case $kindString: + typ.zero = function() { return ""; }; + break; + + case $kindInt64: + case $kindUint64: + case $kindComplex64: + case $kindComplex128: + var zero = new typ(0, 0); + typ.zero = function() { return zero; }; + break; + + case $kindPtr: + case $kindSlice: + typ.zero = function() { return typ.nil; }; + break; + + case $kindChan: + typ.zero = function() { return $chanNil; }; + break; + + case $kindFunc: + typ.zero = function() { return $throwNilPointerError; }; + break; + + case $kindInterface: + typ.zero = function() { return $ifaceNil; }; + break; + + case $kindArray: + typ.zero = function() { + var arrayClass = $nativeArray(typ.elem.kind); + if (arrayClass !== Array) { + return new arrayClass(typ.len); + } + var array = new Array(typ.len); + for (var i = 0; i < typ.len; i++) { + array[i] = typ.elem.zero(); + } + return array; + }; + break; + + case $kindStruct: + typ.zero = function() { return new typ.ptr(); }; + break; + + default: + $panic(new $String("invalid kind: " + kind)); + } + + typ.id = $typeIDCounter; + $typeIDCounter++; + typ.size = size; + typ.kind = kind; + typ.string = string; + typ.typeName = name; + typ.pkg = pkg; + typ.methods = []; + typ.methodSetCache = null; + typ.comparable = true; + return typ; +}; + +var $methodSet = function(typ) { + if (typ.methodSetCache !== null) { + return typ.methodSetCache; + } + var base = {}; + + var isPtr = (typ.kind === $kindPtr); + if (isPtr && typ.elem.kind === $kindInterface) { + typ.methodSetCache = []; + return []; + } + + var current = [{typ: isPtr ? typ.elem : typ, indirect: isPtr}]; + + var seen = {}; + + while (current.length > 0) { + var next = []; + var mset = []; + + current.forEach(function(e) { + if (seen[e.typ.string]) { + return; + } + seen[e.typ.string] = true; + + if(e.typ.typeName !== "") { + mset = mset.concat(e.typ.methods); + if (e.indirect) { + mset = mset.concat($ptrType(e.typ).methods); + } + } + + switch (e.typ.kind) { + case $kindStruct: + e.typ.fields.forEach(function(f) { + if (f.name === "") { + var fTyp = f.typ; + var fIsPtr = (fTyp.kind === $kindPtr); + next.push({typ: fIsPtr ? fTyp.elem : fTyp, indirect: e.indirect || fIsPtr}); + } + }); + break; + + case $kindInterface: + mset = mset.concat(e.typ.methods); + break; + } + }); + + mset.forEach(function(m) { + if (base[m.name] === undefined) { + base[m.name] = m; + } + }); + + current = next; + } + + typ.methodSetCache = []; + Object.keys(base).sort().forEach(function(name) { + typ.methodSetCache.push(base[name]); + }); + return typ.methodSetCache; +}; + +var $Bool = $newType( 1, $kindBool, "bool", "bool", "", null); +var $Int = $newType( 4, $kindInt, "int", "int", "", null); +var $Int8 = $newType( 1, $kindInt8, "int8", "int8", "", null); +var $Int16 = $newType( 2, $kindInt16, "int16", "int16", "", null); +var $Int32 = $newType( 4, $kindInt32, "int32", "int32", "", null); +var $Int64 = $newType( 8, $kindInt64, "int64", "int64", "", null); +var $Uint = $newType( 4, $kindUint, "uint", "uint", "", null); +var $Uint8 = $newType( 1, $kindUint8, "uint8", "uint8", "", null); +var $Uint16 = $newType( 2, $kindUint16, "uint16", "uint16", "", null); +var $Uint32 = $newType( 4, $kindUint32, "uint32", "uint32", "", null); +var $Uint64 = $newType( 8, $kindUint64, "uint64", "uint64", "", null); +var $Uintptr = $newType( 4, $kindUintptr, "uintptr", "uintptr", "", null); +var $Float32 = $newType( 4, $kindFloat32, "float32", "float32", "", null); +var $Float64 = $newType( 8, $kindFloat64, "float64", "float64", "", null); +var $Complex64 = $newType( 8, $kindComplex64, "complex64", "complex64", "", null); +var $Complex128 = $newType(16, $kindComplex128, "complex128", "complex128", "", null); +var $String = $newType( 8, $kindString, "string", "string", "", null); +var $UnsafePointer = $newType( 4, $kindUnsafePointer, "unsafe.Pointer", "Pointer", "", null); + +var $nativeArray = function(elemKind) { + switch (elemKind) { + case $kindInt: + return Int32Array; + case $kindInt8: + return Int8Array; + case $kindInt16: + return Int16Array; + case $kindInt32: + return Int32Array; + case $kindUint: + return Uint32Array; + case $kindUint8: + return Uint8Array; + case $kindUint16: + return Uint16Array; + case $kindUint32: + return Uint32Array; + case $kindUintptr: + return Uint32Array; + case $kindFloat32: + return Float32Array; + case $kindFloat64: + return Float64Array; + default: + return Array; + } +}; +var $toNativeArray = function(elemKind, array) { + var nativeArray = $nativeArray(elemKind); + if (nativeArray === Array) { + return array; + } + return new nativeArray(array); +}; +var $arrayTypes = {}; +var $arrayType = function(elem, len) { + var typeKey = elem.id + "$" + len; + var typ = $arrayTypes[typeKey]; + if (typ === undefined) { + typ = $newType(12, $kindArray, "[" + len + "]" + elem.string, "", "", null); + $arrayTypes[typeKey] = typ; + typ.init(elem, len); + } + return typ; +}; + +var $chanType = function(elem, sendOnly, recvOnly) { + var string = (recvOnly ? "<-" : "") + "chan" + (sendOnly ? "<- " : " ") + elem.string; + var field = sendOnly ? "SendChan" : (recvOnly ? "RecvChan" : "Chan"); + var typ = elem[field]; + if (typ === undefined) { + typ = $newType(4, $kindChan, string, "", "", null); + elem[field] = typ; + typ.init(elem, sendOnly, recvOnly); + } + return typ; +}; +var $Chan = function(elem, capacity) { + if (capacity < 0 || capacity > 2147483647) { + $throwRuntimeError("makechan: size out of range"); + } + this.$elem = elem; + this.$capacity = capacity; + this.$buffer = []; + this.$sendQueue = []; + this.$recvQueue = []; + this.$closed = false; +}; +var $chanNil = new $Chan(null, 0); +$chanNil.$sendQueue = $chanNil.$recvQueue = { length: 0, push: function() {}, shift: function() { return undefined; }, indexOf: function() { return -1; } }; + +var $funcTypes = {}; +var $funcType = function(params, results, variadic) { + var typeKey = $mapArray(params, function(p) { return p.id; }).join(",") + "$" + $mapArray(results, function(r) { return r.id; }).join(",") + "$" + variadic; + var typ = $funcTypes[typeKey]; + if (typ === undefined) { + var paramTypes = $mapArray(params, function(p) { return p.string; }); + if (variadic) { + paramTypes[paramTypes.length - 1] = "..." + paramTypes[paramTypes.length - 1].substr(2); + } + var string = "func(" + paramTypes.join(", ") + ")"; + if (results.length === 1) { + string += " " + results[0].string; + } else if (results.length > 1) { + string += " (" + $mapArray(results, function(r) { return r.string; }).join(", ") + ")"; + } + typ = $newType(4, $kindFunc, string, "", "", null); + $funcTypes[typeKey] = typ; + typ.init(params, results, variadic); + } + return typ; +}; + +var $interfaceTypes = {}; +var $interfaceType = function(methods) { + var typeKey = $mapArray(methods, function(m) { return m.pkg + "," + m.name + "," + m.typ.id; }).join("$"); + var typ = $interfaceTypes[typeKey]; + if (typ === undefined) { + var string = "interface {}"; + if (methods.length !== 0) { + string = "interface { " + $mapArray(methods, function(m) { + return (m.pkg !== "" ? m.pkg + "." : "") + m.name + m.typ.string.substr(4); + }).join("; ") + " }"; + } + typ = $newType(8, $kindInterface, string, "", "", null); + $interfaceTypes[typeKey] = typ; + typ.init(methods); + } + return typ; +}; +var $emptyInterface = $interfaceType([]); +var $ifaceNil = {}; +var $error = $newType(8, $kindInterface, "error", "error", "", null); +$error.init([{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]); + +var $mapTypes = {}; +var $mapType = function(key, elem) { + var typeKey = key.id + "$" + elem.id; + var typ = $mapTypes[typeKey]; + if (typ === undefined) { + typ = $newType(4, $kindMap, "map[" + key.string + "]" + elem.string, "", "", null); + $mapTypes[typeKey] = typ; + typ.init(key, elem); + } + return typ; +}; +var $makeMap = function(keyForFunc, entries) { + var m = {}; + for (var i = 0; i < entries.length; i++) { + var e = entries[i]; + m[keyForFunc(e.k)] = e; + } + return m; +}; + +var $ptrType = function(elem) { + var typ = elem.ptr; + if (typ === undefined) { + typ = $newType(4, $kindPtr, "*" + elem.string, "", "", null); + elem.ptr = typ; + typ.init(elem); + } + return typ; +}; + +var $newDataPointer = function(data, constructor) { + if (constructor.elem.kind === $kindStruct) { + return data; + } + return new constructor(function() { return data; }, function(v) { data = v; }); +}; + +var $indexPtr = function(array, index, constructor) { + array.$ptr = array.$ptr || {}; + return array.$ptr[index] || (array.$ptr[index] = new constructor(function() { return array[index]; }, function(v) { array[index] = v; })); +}; + +var $sliceType = function(elem) { + var typ = elem.slice; + if (typ === undefined) { + typ = $newType(12, $kindSlice, "[]" + elem.string, "", "", null); + elem.slice = typ; + typ.init(elem); + } + return typ; +}; +var $makeSlice = function(typ, length, capacity) { + capacity = capacity || length; + if (length < 0 || length > 2147483647) { + $throwRuntimeError("makeslice: len out of range"); + } + if (capacity < 0 || capacity < length || capacity > 2147483647) { + $throwRuntimeError("makeslice: cap out of range"); + } + var array = new typ.nativeArray(capacity); + if (typ.nativeArray === Array) { + for (var i = 0; i < capacity; i++) { + array[i] = typ.elem.zero(); + } + } + var slice = new typ(array); + slice.$length = length; + return slice; +}; + +var $structTypes = {}; +var $structType = function(fields) { + var typeKey = $mapArray(fields, function(f) { return f.name + "," + f.typ.id + "," + f.tag; }).join("$"); + var typ = $structTypes[typeKey]; + if (typ === undefined) { + var string = "struct { " + $mapArray(fields, function(f) { + return f.name + " " + f.typ.string + (f.tag !== "" ? (" \"" + f.tag.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\"") : ""); + }).join("; ") + " }"; + if (fields.length === 0) { + string = "struct {}"; + } + typ = $newType(0, $kindStruct, string, "", "", function() { + this.$val = this; + for (var i = 0; i < fields.length; i++) { + var f = fields[i]; + var arg = arguments[i]; + this[f.prop] = arg !== undefined ? arg : f.typ.zero(); + } + }); + $structTypes[typeKey] = typ; + typ.init(fields); + } + return typ; +}; + +var $assertType = function(value, type, returnTuple) { + var isInterface = (type.kind === $kindInterface), ok, missingMethod = ""; + if (value === $ifaceNil) { + ok = false; + } else if (!isInterface) { + ok = value.constructor === type; + } else { + var valueTypeString = value.constructor.string; + ok = type.implementedBy[valueTypeString]; + if (ok === undefined) { + ok = true; + var valueMethodSet = $methodSet(value.constructor); + var interfaceMethods = type.methods; + for (var i = 0; i < interfaceMethods.length; i++) { + var tm = interfaceMethods[i]; + var found = false; + for (var j = 0; j < valueMethodSet.length; j++) { + var vm = valueMethodSet[j]; + if (vm.name === tm.name && vm.pkg === tm.pkg && vm.typ === tm.typ) { + found = true; + break; + } + } + if (!found) { + ok = false; + type.missingMethodFor[valueTypeString] = tm.name; + break; + } + } + type.implementedBy[valueTypeString] = ok; + } + if (!ok) { + missingMethod = type.missingMethodFor[valueTypeString]; + } + } + + if (!ok) { + if (returnTuple) { + return [type.zero(), false]; + } + $panic(new $packages["runtime"].TypeAssertionError.ptr("", (value === $ifaceNil ? "" : value.constructor.string), type.string, missingMethod)); + } + + if (!isInterface) { + value = value.$val; + } + if (type === $jsObjectPtr) { + value = value.object; + } + return returnTuple ? [value, true] : value; +}; + +var $stackDepthOffset = 0; +var $getStackDepth = function() { + var err = new Error(); + if (err.stack === undefined) { + return undefined; + } + return $stackDepthOffset + err.stack.split("\n").length; +}; + +var $panicStackDepth = null, $panicValue; +var $callDeferred = function(deferred, jsErr, fromPanic) { + if (!fromPanic && deferred !== null && deferred.index >= $curGoroutine.deferStack.length) { + throw jsErr; + } + if (jsErr !== null) { + var newErr = null; + try { + $curGoroutine.deferStack.push(deferred); + $panic(new $jsErrorPtr(jsErr)); + } catch (err) { + newErr = err; + } + $curGoroutine.deferStack.pop(); + $callDeferred(deferred, newErr); + return; + } + if ($curGoroutine.asleep) { + return; + } + + $stackDepthOffset--; + var outerPanicStackDepth = $panicStackDepth; + var outerPanicValue = $panicValue; + + var localPanicValue = $curGoroutine.panicStack.pop(); + if (localPanicValue !== undefined) { + $panicStackDepth = $getStackDepth(); + $panicValue = localPanicValue; + } + + try { + while (true) { + if (deferred === null) { + deferred = $curGoroutine.deferStack[$curGoroutine.deferStack.length - 1]; + if (deferred === undefined) { + /* The panic reached the top of the stack. Clear it and throw it as a JavaScript error. */ + $panicStackDepth = null; + if (localPanicValue.Object instanceof Error) { + throw localPanicValue.Object; + } + var msg; + if (localPanicValue.constructor === $String) { + msg = localPanicValue.$val; + } else if (localPanicValue.Error !== undefined) { + msg = localPanicValue.Error(); + } else if (localPanicValue.String !== undefined) { + msg = localPanicValue.String(); + } else { + msg = localPanicValue; + } + throw new Error(msg); + } + } + var call = deferred.pop(); + if (call === undefined) { + $curGoroutine.deferStack.pop(); + if (localPanicValue !== undefined) { + deferred = null; + continue; + } + return; + } + var r = call[0].apply(call[2], call[1]); + if (r && r.$blk !== undefined) { + deferred.push([r.$blk, [], r]); + if (fromPanic) { + throw null; + } + return; + } + + if (localPanicValue !== undefined && $panicStackDepth === null) { + throw null; /* error was recovered */ + } + } + } finally { + if (localPanicValue !== undefined) { + if ($panicStackDepth !== null) { + $curGoroutine.panicStack.push(localPanicValue); + } + $panicStackDepth = outerPanicStackDepth; + $panicValue = outerPanicValue; + } + $stackDepthOffset++; + } +}; + +var $panic = function(value) { + $curGoroutine.panicStack.push(value); + $callDeferred(null, null, true); +}; +var $recover = function() { + if ($panicStackDepth === null || ($panicStackDepth !== undefined && $panicStackDepth !== $getStackDepth() - 2)) { + return $ifaceNil; + } + $panicStackDepth = null; + return $panicValue; +}; +var $throw = function(err) { throw err; }; + +var $dummyGoroutine = { asleep: false, exit: false, deferStack: [], panicStack: [], canBlock: false }; +var $curGoroutine = $dummyGoroutine, $totalGoroutines = 0, $awakeGoroutines = 0, $checkForDeadlock = true; +var $mainFinished = false; +var $go = function(fun, args, direct) { + $totalGoroutines++; + $awakeGoroutines++; + var $goroutine = function() { + try { + $curGoroutine = $goroutine; + var r = fun.apply(undefined, args); + if (r && r.$blk !== undefined) { + fun = function() { return r.$blk(); }; + args = []; + return; + } + $goroutine.exit = true; + } catch (err) { + if (!$goroutine.exit) { + throw err; + } + } finally { + $curGoroutine = $dummyGoroutine; + if ($goroutine.exit) { /* also set by runtime.Goexit() */ + $totalGoroutines--; + $goroutine.asleep = true; + } + if ($goroutine.asleep) { + $awakeGoroutines--; + if (!$mainFinished && $awakeGoroutines === 0 && $checkForDeadlock) { + console.error("fatal error: all goroutines are asleep - deadlock!"); + if ($global.process !== undefined) { + $global.process.exit(2); + } + } + } + } + }; + $goroutine.asleep = false; + $goroutine.exit = false; + $goroutine.deferStack = []; + $goroutine.panicStack = []; + $goroutine.canBlock = true; + $schedule($goroutine, direct); +}; + +var $scheduled = [], $schedulerActive = false; +var $runScheduled = function() { + try { + var r; + while ((r = $scheduled.shift()) !== undefined) { + r(); + } + $schedulerActive = false; + } finally { + if ($schedulerActive) { + setTimeout($runScheduled, 0); + } + } +}; +var $schedule = function(goroutine, direct) { + if (goroutine.asleep) { + goroutine.asleep = false; + $awakeGoroutines++; + } + + if (direct) { + goroutine(); + return; + } + + $scheduled.push(goroutine); + if (!$schedulerActive) { + $schedulerActive = true; + setTimeout($runScheduled, 0); + } +}; + +var $setTimeout = function(f, t) { + $awakeGoroutines++; + return setTimeout(function() { + $awakeGoroutines--; + f(); + }, t); +}; + +var $block = function() { + if (!$curGoroutine.canBlock) { + $throwRuntimeError("cannot block in JavaScript callback, fix by wrapping code in goroutine"); + } + $curGoroutine.asleep = true; +}; + +var $send = function(chan, value) { + if (chan.$closed) { + $throwRuntimeError("send on closed channel"); + } + var queuedRecv = chan.$recvQueue.shift(); + if (queuedRecv !== undefined) { + queuedRecv([value, true]); + return; + } + if (chan.$buffer.length < chan.$capacity) { + chan.$buffer.push(value); + return; + } + + var thisGoroutine = $curGoroutine; + chan.$sendQueue.push(function() { + $schedule(thisGoroutine); + return value; + }); + $block(); + return { + $blk: function() { + if (chan.$closed) { + $throwRuntimeError("send on closed channel"); + } + } + }; +}; +var $recv = function(chan) { + var queuedSend = chan.$sendQueue.shift(); + if (queuedSend !== undefined) { + chan.$buffer.push(queuedSend()); + } + var bufferedValue = chan.$buffer.shift(); + if (bufferedValue !== undefined) { + return [bufferedValue, true]; + } + if (chan.$closed) { + return [chan.$elem.zero(), false]; + } + + var thisGoroutine = $curGoroutine; + var f = { $blk: function() { return this.value; } }; + var queueEntry = function(v) { + f.value = v; + $schedule(thisGoroutine); + }; + chan.$recvQueue.push(queueEntry); + $block(); + return f; +}; +var $close = function(chan) { + if (chan.$closed) { + $throwRuntimeError("close of closed channel"); + } + chan.$closed = true; + while (true) { + var queuedSend = chan.$sendQueue.shift(); + if (queuedSend === undefined) { + break; + } + queuedSend(); /* will panic because of closed channel */ + } + while (true) { + var queuedRecv = chan.$recvQueue.shift(); + if (queuedRecv === undefined) { + break; + } + queuedRecv([chan.$elem.zero(), false]); + } +}; +var $select = function(comms) { + var ready = []; + var selection = -1; + for (var i = 0; i < comms.length; i++) { + var comm = comms[i]; + var chan = comm[0]; + switch (comm.length) { + case 0: /* default */ + selection = i; + break; + case 1: /* recv */ + if (chan.$sendQueue.length !== 0 || chan.$buffer.length !== 0 || chan.$closed) { + ready.push(i); + } + break; + case 2: /* send */ + if (chan.$closed) { + $throwRuntimeError("send on closed channel"); + } + if (chan.$recvQueue.length !== 0 || chan.$buffer.length < chan.$capacity) { + ready.push(i); + } + break; + } + } + + if (ready.length !== 0) { + selection = ready[Math.floor(Math.random() * ready.length)]; + } + if (selection !== -1) { + var comm = comms[selection]; + switch (comm.length) { + case 0: /* default */ + return [selection]; + case 1: /* recv */ + return [selection, $recv(comm[0])]; + case 2: /* send */ + $send(comm[0], comm[1]); + return [selection]; + } + } + + var entries = []; + var thisGoroutine = $curGoroutine; + var f = { $blk: function() { return this.selection; } }; + var removeFromQueues = function() { + for (var i = 0; i < entries.length; i++) { + var entry = entries[i]; + var queue = entry[0]; + var index = queue.indexOf(entry[1]); + if (index !== -1) { + queue.splice(index, 1); + } + } + }; + for (var i = 0; i < comms.length; i++) { + (function(i) { + var comm = comms[i]; + switch (comm.length) { + case 1: /* recv */ + var queueEntry = function(value) { + f.selection = [i, value]; + removeFromQueues(); + $schedule(thisGoroutine); + }; + entries.push([comm[0].$recvQueue, queueEntry]); + comm[0].$recvQueue.push(queueEntry); + break; + case 2: /* send */ + var queueEntry = function() { + if (comm[0].$closed) { + $throwRuntimeError("send on closed channel"); + } + f.selection = [i]; + removeFromQueues(); + $schedule(thisGoroutine); + return comm[1]; + }; + entries.push([comm[0].$sendQueue, queueEntry]); + comm[0].$sendQueue.push(queueEntry); + break; + } + })(i); + } + $block(); + return f; +}; + +var $jsObjectPtr, $jsErrorPtr; + +var $needsExternalization = function(t) { + switch (t.kind) { + case $kindBool: + case $kindInt: + case $kindInt8: + case $kindInt16: + case $kindInt32: + case $kindUint: + case $kindUint8: + case $kindUint16: + case $kindUint32: + case $kindUintptr: + case $kindFloat32: + case $kindFloat64: + return false; + default: + return t !== $jsObjectPtr; + } +}; + +var $externalize = function(v, t) { + if (t === $jsObjectPtr) { + return v; + } + switch (t.kind) { + case $kindBool: + case $kindInt: + case $kindInt8: + case $kindInt16: + case $kindInt32: + case $kindUint: + case $kindUint8: + case $kindUint16: + case $kindUint32: + case $kindUintptr: + case $kindFloat32: + case $kindFloat64: + return v; + case $kindInt64: + case $kindUint64: + return $flatten64(v); + case $kindArray: + if ($needsExternalization(t.elem)) { + return $mapArray(v, function(e) { return $externalize(e, t.elem); }); + } + return v; + case $kindFunc: + return $externalizeFunction(v, t, false); + case $kindInterface: + if (v === $ifaceNil) { + return null; + } + if (v.constructor === $jsObjectPtr) { + return v.$val.object; + } + return $externalize(v.$val, v.constructor); + case $kindMap: + var m = {}; + var keys = $keys(v); + for (var i = 0; i < keys.length; i++) { + var entry = v[keys[i]]; + m[$externalize(entry.k, t.key)] = $externalize(entry.v, t.elem); + } + return m; + case $kindPtr: + if (v === t.nil) { + return null; + } + return $externalize(v.$get(), t.elem); + case $kindSlice: + if ($needsExternalization(t.elem)) { + return $mapArray($sliceToArray(v), function(e) { return $externalize(e, t.elem); }); + } + return $sliceToArray(v); + case $kindString: + if (v.search(/^[\x00-\x7F]*$/) !== -1) { + return v; + } + var s = "", r; + for (var i = 0; i < v.length; i += r[1]) { + r = $decodeRune(v, i); + var c = r[0]; + if (c > 0xFFFF) { + var h = Math.floor((c - 0x10000) / 0x400) + 0xD800; + var l = (c - 0x10000) % 0x400 + 0xDC00; + s += String.fromCharCode(h, l); + continue; + } + s += String.fromCharCode(c); + } + return s; + case $kindStruct: + var timePkg = $packages["time"]; + if (timePkg !== undefined && v.constructor === timePkg.Time.ptr) { + var milli = $div64(v.UnixNano(), new $Int64(0, 1000000)); + return new Date($flatten64(milli)); + } + + var noJsObject = {}; + var searchJsObject = function(v, t) { + if (t === $jsObjectPtr) { + return v; + } + switch (t.kind) { + case $kindPtr: + if (v === t.nil) { + return noJsObject; + } + return searchJsObject(v.$get(), t.elem); + case $kindStruct: + var f = t.fields[0]; + return searchJsObject(v[f.prop], f.typ); + case $kindInterface: + return searchJsObject(v.$val, v.constructor); + default: + return noJsObject; + } + }; + var o = searchJsObject(v, t); + if (o !== noJsObject) { + return o; + } + + o = {}; + for (var i = 0; i < t.fields.length; i++) { + var f = t.fields[i]; + if (f.pkg !== "") { /* not exported */ + continue; + } + o[f.name] = $externalize(v[f.prop], f.typ); + } + return o; + } + $throwRuntimeError("cannot externalize " + t.string); +}; + +var $externalizeFunction = function(v, t, passThis) { + if (v === $throwNilPointerError) { + return null; + } + if (v.$externalizeWrapper === undefined) { + $checkForDeadlock = false; + v.$externalizeWrapper = function() { + var args = []; + for (var i = 0; i < t.params.length; i++) { + if (t.variadic && i === t.params.length - 1) { + var vt = t.params[i].elem, varargs = []; + for (var j = i; j < arguments.length; j++) { + varargs.push($internalize(arguments[j], vt)); + } + args.push(new (t.params[i])(varargs)); + break; + } + args.push($internalize(arguments[i], t.params[i])); + } + var canBlock = $curGoroutine.canBlock; + $curGoroutine.canBlock = false; + try { + var result = v.apply(passThis ? this : undefined, args); + } finally { + $curGoroutine.canBlock = canBlock; + } + switch (t.results.length) { + case 0: + return; + case 1: + return $externalize(result, t.results[0]); + default: + for (var i = 0; i < t.results.length; i++) { + result[i] = $externalize(result[i], t.results[i]); + } + return result; + } + }; + } + return v.$externalizeWrapper; +}; + +var $internalize = function(v, t, recv) { + if (t === $jsObjectPtr) { + return v; + } + if (t === $jsObjectPtr.elem) { + $throwRuntimeError("cannot internalize js.Object, use *js.Object instead"); + } + if (v && v.__internal_object__ !== undefined) { + return $assertType(v.__internal_object__, t, false); + } + var timePkg = $packages["time"]; + if (timePkg !== undefined && t === timePkg.Time) { + if (!(v !== null && v !== undefined && v.constructor === Date)) { + $throwRuntimeError("cannot internalize time.Time from " + typeof v + ", must be Date"); + } + return timePkg.Unix(new $Int64(0, 0), new $Int64(0, v.getTime() * 1000000)); + } + switch (t.kind) { + case $kindBool: + return !!v; + case $kindInt: + return parseInt(v); + case $kindInt8: + return parseInt(v) << 24 >> 24; + case $kindInt16: + return parseInt(v) << 16 >> 16; + case $kindInt32: + return parseInt(v) >> 0; + case $kindUint: + return parseInt(v); + case $kindUint8: + return parseInt(v) << 24 >>> 24; + case $kindUint16: + return parseInt(v) << 16 >>> 16; + case $kindUint32: + case $kindUintptr: + return parseInt(v) >>> 0; + case $kindInt64: + case $kindUint64: + return new t(0, v); + case $kindFloat32: + case $kindFloat64: + return parseFloat(v); + case $kindArray: + if (v.length !== t.len) { + $throwRuntimeError("got array with wrong size from JavaScript native"); + } + return $mapArray(v, function(e) { return $internalize(e, t.elem); }); + case $kindFunc: + return function() { + var args = []; + for (var i = 0; i < t.params.length; i++) { + if (t.variadic && i === t.params.length - 1) { + var vt = t.params[i].elem, varargs = arguments[i]; + for (var j = 0; j < varargs.$length; j++) { + args.push($externalize(varargs.$array[varargs.$offset + j], vt)); + } + break; + } + args.push($externalize(arguments[i], t.params[i])); + } + var result = v.apply(recv, args); + switch (t.results.length) { + case 0: + return; + case 1: + return $internalize(result, t.results[0]); + default: + for (var i = 0; i < t.results.length; i++) { + result[i] = $internalize(result[i], t.results[i]); + } + return result; + } + }; + case $kindInterface: + if (t.methods.length !== 0) { + $throwRuntimeError("cannot internalize " + t.string); + } + if (v === null) { + return $ifaceNil; + } + if (v === undefined) { + return new $jsObjectPtr(undefined); + } + switch (v.constructor) { + case Int8Array: + return new ($sliceType($Int8))(v); + case Int16Array: + return new ($sliceType($Int16))(v); + case Int32Array: + return new ($sliceType($Int))(v); + case Uint8Array: + return new ($sliceType($Uint8))(v); + case Uint16Array: + return new ($sliceType($Uint16))(v); + case Uint32Array: + return new ($sliceType($Uint))(v); + case Float32Array: + return new ($sliceType($Float32))(v); + case Float64Array: + return new ($sliceType($Float64))(v); + case Array: + return $internalize(v, $sliceType($emptyInterface)); + case Boolean: + return new $Bool(!!v); + case Date: + if (timePkg === undefined) { + /* time package is not present, internalize as &js.Object{Date} so it can be externalized into original Date. */ + return new $jsObjectPtr(v); + } + return new timePkg.Time($internalize(v, timePkg.Time)); + case Function: + var funcType = $funcType([$sliceType($emptyInterface)], [$jsObjectPtr], true); + return new funcType($internalize(v, funcType)); + case Number: + return new $Float64(parseFloat(v)); + case String: + return new $String($internalize(v, $String)); + default: + if ($global.Node && v instanceof $global.Node) { + return new $jsObjectPtr(v); + } + var mapType = $mapType($String, $emptyInterface); + return new mapType($internalize(v, mapType)); + } + case $kindMap: + var m = {}; + var keys = $keys(v); + for (var i = 0; i < keys.length; i++) { + var k = $internalize(keys[i], t.key); + m[t.key.keyFor(k)] = { k: k, v: $internalize(v[keys[i]], t.elem) }; + } + return m; + case $kindPtr: + if (t.elem.kind === $kindStruct) { + return $internalize(v, t.elem); + } + case $kindSlice: + return new t($mapArray(v, function(e) { return $internalize(e, t.elem); })); + case $kindString: + v = String(v); + if (v.search(/^[\x00-\x7F]*$/) !== -1) { + return v; + } + var s = ""; + var i = 0; + while (i < v.length) { + var h = v.charCodeAt(i); + if (0xD800 <= h && h <= 0xDBFF) { + var l = v.charCodeAt(i + 1); + var c = (h - 0xD800) * 0x400 + l - 0xDC00 + 0x10000; + s += $encodeRune(c); + i += 2; + continue; + } + s += $encodeRune(h); + i++; + } + return s; + case $kindStruct: + var noJsObject = {}; + var searchJsObject = function(t) { + if (t === $jsObjectPtr) { + return v; + } + if (t === $jsObjectPtr.elem) { + $throwRuntimeError("cannot internalize js.Object, use *js.Object instead"); + } + switch (t.kind) { + case $kindPtr: + return searchJsObject(t.elem); + case $kindStruct: + var f = t.fields[0]; + var o = searchJsObject(f.typ); + if (o !== noJsObject) { + var n = new t.ptr(); + n[f.prop] = o; + return n; + } + return noJsObject; + default: + return noJsObject; + } + }; + var o = searchJsObject(t); + if (o !== noJsObject) { + return o; + } + } + $throwRuntimeError("cannot internalize " + t.string); +}; + +$packages["github.com/gopherjs/gopherjs/js"] = (function() { + var $pkg = {}, $init, Object, Error, sliceType, ptrType, ptrType$1, init; + Object = $pkg.Object = $newType(0, $kindStruct, "js.Object", "Object", "github.com/gopherjs/gopherjs/js", function(object_) { + this.$val = this; + if (arguments.length === 0) { + this.object = null; + return; + } + this.object = object_; + }); + Error = $pkg.Error = $newType(0, $kindStruct, "js.Error", "Error", "github.com/gopherjs/gopherjs/js", function(Object_) { + this.$val = this; + if (arguments.length === 0) { + this.Object = null; + return; + } + this.Object = Object_; + }); + sliceType = $sliceType($emptyInterface); + ptrType = $ptrType(Object); + ptrType$1 = $ptrType(Error); + Object.ptr.prototype.Get = function(key) { + var $ptr, key, o; + o = this; + return o.object[$externalize(key, $String)]; + }; + Object.prototype.Get = function(key) { return this.$val.Get(key); }; + Object.ptr.prototype.Set = function(key, value) { + var $ptr, key, o, value; + o = this; + o.object[$externalize(key, $String)] = $externalize(value, $emptyInterface); + }; + Object.prototype.Set = function(key, value) { return this.$val.Set(key, value); }; + Object.ptr.prototype.Delete = function(key) { + var $ptr, key, o; + o = this; + delete o.object[$externalize(key, $String)]; + }; + Object.prototype.Delete = function(key) { return this.$val.Delete(key); }; + Object.ptr.prototype.Length = function() { + var $ptr, o; + o = this; + return $parseInt(o.object.length); + }; + Object.prototype.Length = function() { return this.$val.Length(); }; + Object.ptr.prototype.Index = function(i) { + var $ptr, i, o; + o = this; + return o.object[i]; + }; + Object.prototype.Index = function(i) { return this.$val.Index(i); }; + Object.ptr.prototype.SetIndex = function(i, value) { + var $ptr, i, o, value; + o = this; + o.object[i] = $externalize(value, $emptyInterface); + }; + Object.prototype.SetIndex = function(i, value) { return this.$val.SetIndex(i, value); }; + Object.ptr.prototype.Call = function(name, args) { + var $ptr, args, name, o, obj; + o = this; + return (obj = o.object, obj[$externalize(name, $String)].apply(obj, $externalize(args, sliceType))); + }; + Object.prototype.Call = function(name, args) { return this.$val.Call(name, args); }; + Object.ptr.prototype.Invoke = function(args) { + var $ptr, args, o; + o = this; + return o.object.apply(undefined, $externalize(args, sliceType)); + }; + Object.prototype.Invoke = function(args) { return this.$val.Invoke(args); }; + Object.ptr.prototype.New = function(args) { + var $ptr, args, o; + o = this; + return new ($global.Function.prototype.bind.apply(o.object, [undefined].concat($externalize(args, sliceType)))); + }; + Object.prototype.New = function(args) { return this.$val.New(args); }; + Object.ptr.prototype.Bool = function() { + var $ptr, o; + o = this; + return !!(o.object); + }; + Object.prototype.Bool = function() { return this.$val.Bool(); }; + Object.ptr.prototype.String = function() { + var $ptr, o; + o = this; + return $internalize(o.object, $String); + }; + Object.prototype.String = function() { return this.$val.String(); }; + Object.ptr.prototype.Int = function() { + var $ptr, o; + o = this; + return $parseInt(o.object) >> 0; + }; + Object.prototype.Int = function() { return this.$val.Int(); }; + Object.ptr.prototype.Int64 = function() { + var $ptr, o; + o = this; + return $internalize(o.object, $Int64); + }; + Object.prototype.Int64 = function() { return this.$val.Int64(); }; + Object.ptr.prototype.Uint64 = function() { + var $ptr, o; + o = this; + return $internalize(o.object, $Uint64); + }; + Object.prototype.Uint64 = function() { return this.$val.Uint64(); }; + Object.ptr.prototype.Float = function() { + var $ptr, o; + o = this; + return $parseFloat(o.object); + }; + Object.prototype.Float = function() { return this.$val.Float(); }; + Object.ptr.prototype.Interface = function() { + var $ptr, o; + o = this; + return $internalize(o.object, $emptyInterface); + }; + Object.prototype.Interface = function() { return this.$val.Interface(); }; + Object.ptr.prototype.Unsafe = function() { + var $ptr, o; + o = this; + return o.object; + }; + Object.prototype.Unsafe = function() { return this.$val.Unsafe(); }; + Error.ptr.prototype.Error = function() { + var $ptr, err; + err = this; + return "JavaScript error: " + $internalize(err.Object.message, $String); + }; + Error.prototype.Error = function() { return this.$val.Error(); }; + Error.ptr.prototype.Stack = function() { + var $ptr, err; + err = this; + return $internalize(err.Object.stack, $String); + }; + Error.prototype.Stack = function() { return this.$val.Stack(); }; + init = function() { + var $ptr, e; + e = new Error.ptr(null); + }; + ptrType.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [ptrType], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String, $emptyInterface], [], false)}, {prop: "Delete", name: "Delete", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Length", name: "Length", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [ptrType], false)}, {prop: "SetIndex", name: "SetIndex", pkg: "", typ: $funcType([$Int, $emptyInterface], [], false)}, {prop: "Call", name: "Call", pkg: "", typ: $funcType([$String, sliceType], [ptrType], true)}, {prop: "Invoke", name: "Invoke", pkg: "", typ: $funcType([sliceType], [ptrType], true)}, {prop: "New", name: "New", pkg: "", typ: $funcType([sliceType], [ptrType], true)}, {prop: "Bool", name: "Bool", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Int64", name: "Int64", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "Float", name: "Float", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Interface", name: "Interface", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Unsafe", name: "Unsafe", pkg: "", typ: $funcType([], [$Uintptr], false)}]; + ptrType$1.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Stack", name: "Stack", pkg: "", typ: $funcType([], [$String], false)}]; + Object.init([{prop: "object", name: "object", pkg: "github.com/gopherjs/gopherjs/js", typ: ptrType, tag: ""}]); + Error.init([{prop: "Object", name: "", pkg: "", typ: ptrType, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + init(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["runtime/internal/sys"] = (function() { + var $pkg = {}, $init; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["runtime"] = (function() { + var $pkg = {}, $init, js, sys, Error, TypeAssertionError, errorString, ptrType$4, init, GOROOT, Goexit, GOMAXPROCS, SetFinalizer; + js = $packages["github.com/gopherjs/gopherjs/js"]; + sys = $packages["runtime/internal/sys"]; + Error = $pkg.Error = $newType(8, $kindInterface, "runtime.Error", "Error", "runtime", null); + TypeAssertionError = $pkg.TypeAssertionError = $newType(0, $kindStruct, "runtime.TypeAssertionError", "TypeAssertionError", "runtime", function(interfaceString_, concreteString_, assertedString_, missingMethod_) { + this.$val = this; + if (arguments.length === 0) { + this.interfaceString = ""; + this.concreteString = ""; + this.assertedString = ""; + this.missingMethod = ""; + return; + } + this.interfaceString = interfaceString_; + this.concreteString = concreteString_; + this.assertedString = assertedString_; + this.missingMethod = missingMethod_; + }); + errorString = $pkg.errorString = $newType(8, $kindString, "runtime.errorString", "errorString", "runtime", null); + ptrType$4 = $ptrType(TypeAssertionError); + init = function() { + var $ptr, e, jsPkg; + jsPkg = $packages[$externalize("github.com/gopherjs/gopherjs/js", $String)]; + $jsObjectPtr = jsPkg.Object.ptr; + $jsErrorPtr = jsPkg.Error.ptr; + $throwRuntimeError = (function(msg) { + var $ptr, msg; + $panic(new errorString(msg)); + }); + e = $ifaceNil; + e = new TypeAssertionError.ptr("", "", "", ""); + }; + GOROOT = function() { + var $ptr, goroot, process; + process = $global.process; + if (process === undefined) { + return "/"; + } + goroot = process.env.GOROOT; + if (!(goroot === undefined)) { + return $internalize(goroot, $String); + } + return "/home/mathias/src/go"; + }; + $pkg.GOROOT = GOROOT; + Goexit = function() { + var $ptr; + $curGoroutine.exit = $externalize(true, $Bool); + $throw(null); + }; + $pkg.Goexit = Goexit; + GOMAXPROCS = function(n) { + var $ptr, n; + return 1; + }; + $pkg.GOMAXPROCS = GOMAXPROCS; + SetFinalizer = function(x, f) { + var $ptr, f, x; + }; + $pkg.SetFinalizer = SetFinalizer; + TypeAssertionError.ptr.prototype.RuntimeError = function() { + var $ptr; + }; + TypeAssertionError.prototype.RuntimeError = function() { return this.$val.RuntimeError(); }; + TypeAssertionError.ptr.prototype.Error = function() { + var $ptr, e, inter; + e = this; + inter = e.interfaceString; + if (inter === "") { + inter = "interface"; + } + if (e.concreteString === "") { + return "interface conversion: " + inter + " is nil, not " + e.assertedString; + } + if (e.missingMethod === "") { + return "interface conversion: " + inter + " is " + e.concreteString + ", not " + e.assertedString; + } + return "interface conversion: " + e.concreteString + " is not " + e.assertedString + ": missing method " + e.missingMethod; + }; + TypeAssertionError.prototype.Error = function() { return this.$val.Error(); }; + errorString.prototype.RuntimeError = function() { + var $ptr, e; + e = this.$val; + }; + $ptrType(errorString).prototype.RuntimeError = function() { return new errorString(this.$get()).RuntimeError(); }; + errorString.prototype.Error = function() { + var $ptr, e; + e = this.$val; + return "runtime error: " + e; + }; + $ptrType(errorString).prototype.Error = function() { return new errorString(this.$get()).Error(); }; + ptrType$4.methods = [{prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + errorString.methods = [{prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + Error.init([{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}]); + TypeAssertionError.init([{prop: "interfaceString", name: "interfaceString", pkg: "runtime", typ: $String, tag: ""}, {prop: "concreteString", name: "concreteString", pkg: "runtime", typ: $String, tag: ""}, {prop: "assertedString", name: "assertedString", pkg: "runtime", typ: $String, tag: ""}, {prop: "missingMethod", name: "missingMethod", pkg: "runtime", typ: $String, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sys.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + init(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["errors"] = (function() { + var $pkg = {}, $init, errorString, ptrType, New; + errorString = $pkg.errorString = $newType(0, $kindStruct, "errors.errorString", "errorString", "errors", function(s_) { + this.$val = this; + if (arguments.length === 0) { + this.s = ""; + return; + } + this.s = s_; + }); + ptrType = $ptrType(errorString); + New = function(text) { + var $ptr, text; + return new errorString.ptr(text); + }; + $pkg.New = New; + errorString.ptr.prototype.Error = function() { + var $ptr, e; + e = this; + return e.s; + }; + errorString.prototype.Error = function() { return this.$val.Error(); }; + ptrType.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + errorString.init([{prop: "s", name: "s", pkg: "errors", typ: $String, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["internal/race"] = (function() { + var $pkg = {}, $init, Acquire, Release, ReleaseMerge, Disable, Enable, ReadRange, WriteRange; + Acquire = function(addr) { + var $ptr, addr; + }; + $pkg.Acquire = Acquire; + Release = function(addr) { + var $ptr, addr; + }; + $pkg.Release = Release; + ReleaseMerge = function(addr) { + var $ptr, addr; + }; + $pkg.ReleaseMerge = ReleaseMerge; + Disable = function() { + var $ptr; + }; + $pkg.Disable = Disable; + Enable = function() { + var $ptr; + }; + $pkg.Enable = Enable; + ReadRange = function(addr, len) { + var $ptr, addr, len; + }; + $pkg.ReadRange = ReadRange; + WriteRange = function(addr, len) { + var $ptr, addr, len; + }; + $pkg.WriteRange = WriteRange; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["sync/atomic"] = (function() { + var $pkg = {}, $init, js, CompareAndSwapInt32, AddInt32, LoadUint32, StoreUint32; + js = $packages["github.com/gopherjs/gopherjs/js"]; + CompareAndSwapInt32 = function(addr, old, new$1) { + var $ptr, addr, new$1, old; + if (addr.$get() === old) { + addr.$set(new$1); + return true; + } + return false; + }; + $pkg.CompareAndSwapInt32 = CompareAndSwapInt32; + AddInt32 = function(addr, delta) { + var $ptr, addr, delta, new$1; + new$1 = addr.$get() + delta >> 0; + addr.$set(new$1); + return new$1; + }; + $pkg.AddInt32 = AddInt32; + LoadUint32 = function(addr) { + var $ptr, addr; + return addr.$get(); + }; + $pkg.LoadUint32 = LoadUint32; + StoreUint32 = function(addr, val) { + var $ptr, addr, val; + addr.$set(val); + }; + $pkg.StoreUint32 = StoreUint32; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["sync"] = (function() { + var $pkg = {}, $init, race, runtime, atomic, Pool, Mutex, Locker, Once, poolLocal, syncSema, RWMutex, rlocker, ptrType, sliceType, ptrType$1, chanType, sliceType$1, ptrType$4, ptrType$6, sliceType$3, ptrType$7, ptrType$8, funcType, ptrType$12, funcType$1, ptrType$13, arrayType$1, semWaiters, allPools, runtime_Syncsemcheck, runtime_registerPoolCleanup, runtime_Semacquire, runtime_Semrelease, runtime_canSpin, poolCleanup, init, indexLocal, init$1, runtime_doSpin; + race = $packages["internal/race"]; + runtime = $packages["runtime"]; + atomic = $packages["sync/atomic"]; + Pool = $pkg.Pool = $newType(0, $kindStruct, "sync.Pool", "Pool", "sync", function(local_, localSize_, store_, New_) { + this.$val = this; + if (arguments.length === 0) { + this.local = 0; + this.localSize = 0; + this.store = sliceType$3.nil; + this.New = $throwNilPointerError; + return; + } + this.local = local_; + this.localSize = localSize_; + this.store = store_; + this.New = New_; + }); + Mutex = $pkg.Mutex = $newType(0, $kindStruct, "sync.Mutex", "Mutex", "sync", function(state_, sema_) { + this.$val = this; + if (arguments.length === 0) { + this.state = 0; + this.sema = 0; + return; + } + this.state = state_; + this.sema = sema_; + }); + Locker = $pkg.Locker = $newType(8, $kindInterface, "sync.Locker", "Locker", "sync", null); + Once = $pkg.Once = $newType(0, $kindStruct, "sync.Once", "Once", "sync", function(m_, done_) { + this.$val = this; + if (arguments.length === 0) { + this.m = new Mutex.ptr(0, 0); + this.done = 0; + return; + } + this.m = m_; + this.done = done_; + }); + poolLocal = $pkg.poolLocal = $newType(0, $kindStruct, "sync.poolLocal", "poolLocal", "sync", function(private$0_, shared_, Mutex_, pad_) { + this.$val = this; + if (arguments.length === 0) { + this.private$0 = $ifaceNil; + this.shared = sliceType$3.nil; + this.Mutex = new Mutex.ptr(0, 0); + this.pad = arrayType$1.zero(); + return; + } + this.private$0 = private$0_; + this.shared = shared_; + this.Mutex = Mutex_; + this.pad = pad_; + }); + syncSema = $pkg.syncSema = $newType(0, $kindStruct, "sync.syncSema", "syncSema", "sync", function(lock_, head_, tail_) { + this.$val = this; + if (arguments.length === 0) { + this.lock = 0; + this.head = 0; + this.tail = 0; + return; + } + this.lock = lock_; + this.head = head_; + this.tail = tail_; + }); + RWMutex = $pkg.RWMutex = $newType(0, $kindStruct, "sync.RWMutex", "RWMutex", "sync", function(w_, writerSem_, readerSem_, readerCount_, readerWait_) { + this.$val = this; + if (arguments.length === 0) { + this.w = new Mutex.ptr(0, 0); + this.writerSem = 0; + this.readerSem = 0; + this.readerCount = 0; + this.readerWait = 0; + return; + } + this.w = w_; + this.writerSem = writerSem_; + this.readerSem = readerSem_; + this.readerCount = readerCount_; + this.readerWait = readerWait_; + }); + rlocker = $pkg.rlocker = $newType(0, $kindStruct, "sync.rlocker", "rlocker", "sync", function(w_, writerSem_, readerSem_, readerCount_, readerWait_) { + this.$val = this; + if (arguments.length === 0) { + this.w = new Mutex.ptr(0, 0); + this.writerSem = 0; + this.readerSem = 0; + this.readerCount = 0; + this.readerWait = 0; + return; + } + this.w = w_; + this.writerSem = writerSem_; + this.readerSem = readerSem_; + this.readerCount = readerCount_; + this.readerWait = readerWait_; + }); + ptrType = $ptrType(Pool); + sliceType = $sliceType(ptrType); + ptrType$1 = $ptrType($Uint32); + chanType = $chanType($Bool, false, false); + sliceType$1 = $sliceType(chanType); + ptrType$4 = $ptrType($Int32); + ptrType$6 = $ptrType(poolLocal); + sliceType$3 = $sliceType($emptyInterface); + ptrType$7 = $ptrType(rlocker); + ptrType$8 = $ptrType(RWMutex); + funcType = $funcType([], [$emptyInterface], false); + ptrType$12 = $ptrType(Mutex); + funcType$1 = $funcType([], [], false); + ptrType$13 = $ptrType(Once); + arrayType$1 = $arrayType($Uint8, 128); + runtime_Syncsemcheck = function(size) { + var $ptr, size; + }; + Pool.ptr.prototype.Get = function() { + var $ptr, _r, p, x, x$1, x$2, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; p = $f.p; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + /* */ if (p.store.$length === 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (p.store.$length === 0) { */ case 1: + /* */ if (!(p.New === $throwNilPointerError)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (!(p.New === $throwNilPointerError)) { */ case 3: + _r = p.New(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 6; case 6: + return _r; + /* } */ case 4: + return $ifaceNil; + /* } */ case 2: + x$2 = (x = p.store, x$1 = p.store.$length - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); + p.store = $subslice(p.store, 0, (p.store.$length - 1 >> 0)); + return x$2; + /* */ } return; } if ($f === undefined) { $f = { $blk: Pool.ptr.prototype.Get }; } $f.$ptr = $ptr; $f._r = _r; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; + }; + Pool.prototype.Get = function() { return this.$val.Get(); }; + Pool.ptr.prototype.Put = function(x) { + var $ptr, p, x; + p = this; + if ($interfaceIsEqual(x, $ifaceNil)) { + return; + } + p.store = $append(p.store, x); + }; + Pool.prototype.Put = function(x) { return this.$val.Put(x); }; + runtime_registerPoolCleanup = function(cleanup) { + var $ptr, cleanup; + }; + runtime_Semacquire = function(s) { + var $ptr, _entry, _key, _r, ch, s, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _r = $f._r; ch = $f.ch; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ if (s.$get() === 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (s.$get() === 0) { */ case 1: + ch = new $Chan($Bool, 0); + _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: $append((_entry = semWaiters[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : sliceType$1.nil), ch) }; + _r = $recv(ch); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r[0]; + /* } */ case 2: + s.$set(s.$get() - (1) >>> 0); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: runtime_Semacquire }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._r = _r; $f.ch = ch; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; + }; + runtime_Semrelease = function(s) { + var $ptr, _entry, _key, ch, s, w, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; ch = $f.ch; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + s.$set(s.$get() + (1) >>> 0); + w = (_entry = semWaiters[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : sliceType$1.nil); + if (w.$length === 0) { + return; + } + ch = (0 >= w.$length ? $throwRuntimeError("index out of range") : w.$array[w.$offset + 0]); + w = $subslice(w, 1); + _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: w }; + if (w.$length === 0) { + delete semWaiters[ptrType$1.keyFor(s)]; + } + $r = $send(ch, true); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: runtime_Semrelease }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f.ch = ch; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; + }; + runtime_canSpin = function(i) { + var $ptr, i; + return false; + }; + Mutex.ptr.prototype.Lock = function() { + var $ptr, awoke, iter, m, new$1, old, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; awoke = $f.awoke; iter = $f.iter; m = $f.m; new$1 = $f.new$1; old = $f.old; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + m = this; + if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), 0, 1)) { + if (false) { + race.Acquire(m); + } + return; + } + awoke = false; + iter = 0; + /* while (true) { */ case 1: + old = m.state; + new$1 = old | 1; + /* */ if (!(((old & 1) === 0))) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (!(((old & 1) === 0))) { */ case 3: + if (runtime_canSpin(iter)) { + if (!awoke && ((old & 2) === 0) && !(((old >> 2 >> 0) === 0)) && atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, old | 2)) { + awoke = true; + } + runtime_doSpin(); + iter = iter + (1) >> 0; + /* continue; */ $s = 1; continue; + } + new$1 = old + 4 >> 0; + /* } */ case 4: + if (awoke) { + if ((new$1 & 2) === 0) { + $panic(new $String("sync: inconsistent mutex state")); + } + new$1 = (new$1 & ~(2)) >> 0; + } + /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 5: + if ((old & 1) === 0) { + /* break; */ $s = 2; continue; + } + $r = runtime_Semacquire((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m)))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + awoke = true; + iter = 0; + /* } */ case 6: + /* } */ $s = 1; continue; case 2: + if (false) { + race.Acquire(m); + } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.Lock }; } $f.$ptr = $ptr; $f.awoke = awoke; $f.iter = iter; $f.m = m; $f.new$1 = new$1; $f.old = old; $f.$s = $s; $f.$r = $r; return $f; + }; + Mutex.prototype.Lock = function() { return this.$val.Lock(); }; + Mutex.ptr.prototype.Unlock = function() { + var $ptr, m, new$1, old, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; m = $f.m; new$1 = $f.new$1; old = $f.old; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + m = this; + if (false) { + race.Release(m); + } + new$1 = atomic.AddInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), -1); + if ((((new$1 + 1 >> 0)) & 1) === 0) { + $panic(new $String("sync: unlock of unlocked mutex")); + } + old = new$1; + /* while (true) { */ case 1: + if (((old >> 2 >> 0) === 0) || !(((old & 3) === 0))) { + return; + } + new$1 = ((old - 4 >> 0)) | 2; + /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 3: + $r = runtime_Semrelease((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m)))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return; + /* } */ case 4: + old = m.state; + /* } */ $s = 1; continue; case 2: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.Unlock }; } $f.$ptr = $ptr; $f.m = m; $f.new$1 = new$1; $f.old = old; $f.$s = $s; $f.$r = $r; return $f; + }; + Mutex.prototype.Unlock = function() { return this.$val.Unlock(); }; + Once.ptr.prototype.Do = function(f) { + var $ptr, f, o, $s, $deferred, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; o = $f.o; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + o = this; + if (atomic.LoadUint32((o.$ptr_done || (o.$ptr_done = new ptrType$1(function() { return this.$target.done; }, function($v) { this.$target.done = $v; }, o)))) === 1) { + return; + } + $r = o.m.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $deferred.push([$methodVal(o.m, "Unlock"), []]); + /* */ if (o.done === 0) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (o.done === 0) { */ case 2: + $deferred.push([atomic.StoreUint32, [(o.$ptr_done || (o.$ptr_done = new ptrType$1(function() { return this.$target.done; }, function($v) { this.$target.done = $v; }, o))), 1]]); + $r = f(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 3: + /* */ $s = -1; case -1: } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Once.ptr.prototype.Do }; } $f.$ptr = $ptr; $f.f = f; $f.o = o; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } + }; + Once.prototype.Do = function(f) { return this.$val.Do(f); }; + poolCleanup = function() { + var $ptr, _i, _i$1, _ref, _ref$1, i, i$1, j, l, p, x; + _ref = allPools; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + p = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + ((i < 0 || i >= allPools.$length) ? $throwRuntimeError("index out of range") : allPools.$array[allPools.$offset + i] = ptrType.nil); + i$1 = 0; + while (true) { + if (!(i$1 < (p.localSize >> 0))) { break; } + l = indexLocal(p.local, i$1); + l.private$0 = $ifaceNil; + _ref$1 = l.shared; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + j = _i$1; + (x = l.shared, ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j] = $ifaceNil)); + _i$1++; + } + l.shared = sliceType$3.nil; + i$1 = i$1 + (1) >> 0; + } + p.local = 0; + p.localSize = 0; + _i++; + } + allPools = new sliceType([]); + }; + init = function() { + var $ptr; + runtime_registerPoolCleanup(poolCleanup); + }; + indexLocal = function(l, i) { + var $ptr, i, l, x; + return (x = l, (x.nilCheck, ((i < 0 || i >= x.length) ? $throwRuntimeError("index out of range") : x[i]))); + }; + init$1 = function() { + var $ptr, s; + s = new syncSema.ptr(0, 0, 0); + runtime_Syncsemcheck(12); + }; + runtime_doSpin = function() { + $throwRuntimeError("native function not implemented: sync.runtime_doSpin"); + }; + RWMutex.ptr.prototype.RLock = function() { + var $ptr, rw, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + rw = this; + if (false) { + race.Disable(); + } + /* */ if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$4(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$4(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { */ case 1: + $r = runtime_Semacquire((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + if (false) { + race.Enable(); + race.Acquire((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))); + } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RLock }; } $f.$ptr = $ptr; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; + }; + RWMutex.prototype.RLock = function() { return this.$val.RLock(); }; + RWMutex.ptr.prototype.RUnlock = function() { + var $ptr, r, rw, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + rw = this; + if (false) { + race.ReleaseMerge((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))); + race.Disable(); + } + r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$4(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1); + /* */ if (r < 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (r < 0) { */ case 1: + if (((r + 1 >> 0) === 0) || ((r + 1 >> 0) === -1073741824)) { + race.Enable(); + $panic(new $String("sync: RUnlock of unlocked RWMutex")); + } + /* */ if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$4(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$4(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { */ case 3: + $r = runtime_Semrelease((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 4: + /* } */ case 2: + if (false) { + race.Enable(); + } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RUnlock }; } $f.$ptr = $ptr; $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; + }; + RWMutex.prototype.RUnlock = function() { return this.$val.RUnlock(); }; + RWMutex.ptr.prototype.Lock = function() { + var $ptr, r, rw, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + rw = this; + if (false) { + race.Disable(); + } + $r = rw.w.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$4(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1073741824) + 1073741824 >> 0; + /* */ if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$4(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$4(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { */ case 2: + $r = runtime_Semacquire((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 3: + if (false) { + race.Enable(); + race.Acquire((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))); + race.Acquire((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))); + } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Lock }; } $f.$ptr = $ptr; $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; + }; + RWMutex.prototype.Lock = function() { return this.$val.Lock(); }; + RWMutex.ptr.prototype.Unlock = function() { + var $ptr, i, r, rw, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; i = $f.i; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + rw = this; + if (false) { + race.Release((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))); + race.Release((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))); + race.Disable(); + } + r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$4(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1073741824); + if (r >= 1073741824) { + race.Enable(); + $panic(new $String("sync: Unlock of unlocked RWMutex")); + } + i = 0; + /* while (true) { */ case 1: + /* if (!(i < (r >> 0))) { break; } */ if(!(i < (r >> 0))) { $s = 2; continue; } + $r = runtime_Semrelease((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + i = i + (1) >> 0; + /* } */ $s = 1; continue; case 2: + $r = rw.w.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + if (false) { + race.Enable(); + } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Unlock }; } $f.$ptr = $ptr; $f.i = i; $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; + }; + RWMutex.prototype.Unlock = function() { return this.$val.Unlock(); }; + RWMutex.ptr.prototype.RLocker = function() { + var $ptr, rw; + rw = this; + return $pointerOfStructConversion(rw, ptrType$7); + }; + RWMutex.prototype.RLocker = function() { return this.$val.RLocker(); }; + rlocker.ptr.prototype.Lock = function() { + var $ptr, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + $r = $pointerOfStructConversion(r, ptrType$8).RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Lock }; } $f.$ptr = $ptr; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + rlocker.prototype.Lock = function() { return this.$val.Lock(); }; + rlocker.ptr.prototype.Unlock = function() { + var $ptr, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + $r = $pointerOfStructConversion(r, ptrType$8).RUnlock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Unlock }; } $f.$ptr = $ptr; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + rlocker.prototype.Unlock = function() { return this.$val.Unlock(); }; + ptrType.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Put", name: "Put", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "getSlow", name: "getSlow", pkg: "sync", typ: $funcType([], [$emptyInterface], false)}, {prop: "pin", name: "pin", pkg: "sync", typ: $funcType([], [ptrType$6], false)}, {prop: "pinSlow", name: "pinSlow", pkg: "sync", typ: $funcType([], [ptrType$6], false)}]; + ptrType$12.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; + ptrType$13.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([funcType$1], [], false)}]; + ptrType$8.methods = [{prop: "RLock", name: "RLock", pkg: "", typ: $funcType([], [], false)}, {prop: "RUnlock", name: "RUnlock", pkg: "", typ: $funcType([], [], false)}, {prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}, {prop: "RLocker", name: "RLocker", pkg: "", typ: $funcType([], [Locker], false)}]; + ptrType$7.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; + Pool.init([{prop: "local", name: "local", pkg: "sync", typ: $UnsafePointer, tag: ""}, {prop: "localSize", name: "localSize", pkg: "sync", typ: $Uintptr, tag: ""}, {prop: "store", name: "store", pkg: "sync", typ: sliceType$3, tag: ""}, {prop: "New", name: "New", pkg: "", typ: funcType, tag: ""}]); + Mutex.init([{prop: "state", name: "state", pkg: "sync", typ: $Int32, tag: ""}, {prop: "sema", name: "sema", pkg: "sync", typ: $Uint32, tag: ""}]); + Locker.init([{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]); + Once.init([{prop: "m", name: "m", pkg: "sync", typ: Mutex, tag: ""}, {prop: "done", name: "done", pkg: "sync", typ: $Uint32, tag: ""}]); + poolLocal.init([{prop: "private$0", name: "private", pkg: "sync", typ: $emptyInterface, tag: ""}, {prop: "shared", name: "shared", pkg: "sync", typ: sliceType$3, tag: ""}, {prop: "Mutex", name: "", pkg: "", typ: Mutex, tag: ""}, {prop: "pad", name: "pad", pkg: "sync", typ: arrayType$1, tag: ""}]); + syncSema.init([{prop: "lock", name: "lock", pkg: "sync", typ: $Uintptr, tag: ""}, {prop: "head", name: "head", pkg: "sync", typ: $UnsafePointer, tag: ""}, {prop: "tail", name: "tail", pkg: "sync", typ: $UnsafePointer, tag: ""}]); + RWMutex.init([{prop: "w", name: "w", pkg: "sync", typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", pkg: "sync", typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", pkg: "sync", typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", pkg: "sync", typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", pkg: "sync", typ: $Int32, tag: ""}]); + rlocker.init([{prop: "w", name: "w", pkg: "sync", typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", pkg: "sync", typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", pkg: "sync", typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", pkg: "sync", typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", pkg: "sync", typ: $Int32, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = race.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = atomic.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + allPools = sliceType.nil; + semWaiters = {}; + init(); + init$1(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["io"] = (function() { + var $pkg = {}, $init, errors, sync, Reader, Writer, ByteScanner, RuneReader, stringWriter, sliceType, errWhence, errOffset, WriteString, ReadAtLeast, ReadFull; + errors = $packages["errors"]; + sync = $packages["sync"]; + Reader = $pkg.Reader = $newType(8, $kindInterface, "io.Reader", "Reader", "io", null); + Writer = $pkg.Writer = $newType(8, $kindInterface, "io.Writer", "Writer", "io", null); + ByteScanner = $pkg.ByteScanner = $newType(8, $kindInterface, "io.ByteScanner", "ByteScanner", "io", null); + RuneReader = $pkg.RuneReader = $newType(8, $kindInterface, "io.RuneReader", "RuneReader", "io", null); + stringWriter = $pkg.stringWriter = $newType(8, $kindInterface, "io.stringWriter", "stringWriter", "io", null); + sliceType = $sliceType($Uint8); + WriteString = function(w, s) { + var $ptr, _r, _r$1, _tuple, _tuple$1, _tuple$2, err, n, ok, s, sw, w, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; n = $f.n; ok = $f.ok; s = $f.s; sw = $f.sw; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + _tuple = $assertType(w, stringWriter, true); + sw = _tuple[0]; + ok = _tuple[1]; + /* */ if (ok) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (ok) { */ case 1: + _r = sw.WriteString(s); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple$1 = _r; + n = _tuple$1[0]; + err = _tuple$1[1]; + /* */ $s = 4; case 4: + return [n, err]; + /* } */ case 2: + _r$1 = w.Write(new sliceType($stringToBytes(s))); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$2 = _r$1; + n = _tuple$2[0]; + err = _tuple$2[1]; + /* */ $s = 6; case 6: + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: WriteString }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.n = n; $f.ok = ok; $f.s = s; $f.sw = sw; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.WriteString = WriteString; + ReadAtLeast = function(r, buf, min) { + var $ptr, _r, _tmp, _tmp$1, _tuple, buf, err, min, n, nn, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; buf = $f.buf; err = $f.err; min = $f.min; n = $f.n; nn = $f.nn; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + if (buf.$length < min) { + _tmp = 0; + _tmp$1 = $pkg.ErrShortBuffer; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + /* while (true) { */ case 1: + /* if (!(n < min && $interfaceIsEqual(err, $ifaceNil))) { break; } */ if(!(n < min && $interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } + nn = 0; + _r = r.Read($subslice(buf, n)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + nn = _tuple[0]; + err = _tuple[1]; + n = n + (nn) >> 0; + /* } */ $s = 1; continue; case 2: + if (n >= min) { + err = $ifaceNil; + } else if (n > 0 && $interfaceIsEqual(err, $pkg.EOF)) { + err = $pkg.ErrUnexpectedEOF; + } + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: ReadAtLeast }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.min = min; $f.n = n; $f.nn = nn; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.ReadAtLeast = ReadAtLeast; + ReadFull = function(r, buf) { + var $ptr, _r, _tuple, buf, err, n, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; err = $f.err; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + _r = ReadAtLeast(r, buf, buf.$length); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + n = _tuple[0]; + err = _tuple[1]; + /* */ $s = 2; case 2: + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: ReadFull }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.ReadFull = ReadFull; + Reader.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); + Writer.init([{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); + ByteScanner.init([{prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}]); + RuneReader.init([{prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}]); + stringWriter.init([{prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.ErrShortWrite = errors.New("short write"); + $pkg.ErrShortBuffer = errors.New("short buffer"); + $pkg.EOF = errors.New("EOF"); + $pkg.ErrUnexpectedEOF = errors.New("unexpected EOF"); + $pkg.ErrNoProgress = errors.New("multiple Read calls return no data or error"); + errWhence = errors.New("Seek: invalid whence"); + errOffset = errors.New("Seek: invalid offset"); + $pkg.ErrClosedPipe = errors.New("io: read/write on closed pipe"); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["unicode"] = (function() { + var $pkg = {}, $init, RangeTable, Range16, Range32, CaseRange, d, foldPair, arrayType, sliceType, sliceType$1, sliceType$3, sliceType$4, _L, _Nd, _CaseRanges, properties, caseOrbit, to, IsDigit, IsLetter, is16, is32, isExcludingLatin, To, ToUpper, ToLower, SimpleFold; + RangeTable = $pkg.RangeTable = $newType(0, $kindStruct, "unicode.RangeTable", "RangeTable", "unicode", function(R16_, R32_, LatinOffset_) { + this.$val = this; + if (arguments.length === 0) { + this.R16 = sliceType.nil; + this.R32 = sliceType$1.nil; + this.LatinOffset = 0; + return; + } + this.R16 = R16_; + this.R32 = R32_; + this.LatinOffset = LatinOffset_; + }); + Range16 = $pkg.Range16 = $newType(0, $kindStruct, "unicode.Range16", "Range16", "unicode", function(Lo_, Hi_, Stride_) { + this.$val = this; + if (arguments.length === 0) { + this.Lo = 0; + this.Hi = 0; + this.Stride = 0; + return; + } + this.Lo = Lo_; + this.Hi = Hi_; + this.Stride = Stride_; + }); + Range32 = $pkg.Range32 = $newType(0, $kindStruct, "unicode.Range32", "Range32", "unicode", function(Lo_, Hi_, Stride_) { + this.$val = this; + if (arguments.length === 0) { + this.Lo = 0; + this.Hi = 0; + this.Stride = 0; + return; + } + this.Lo = Lo_; + this.Hi = Hi_; + this.Stride = Stride_; + }); + CaseRange = $pkg.CaseRange = $newType(0, $kindStruct, "unicode.CaseRange", "CaseRange", "unicode", function(Lo_, Hi_, Delta_) { + this.$val = this; + if (arguments.length === 0) { + this.Lo = 0; + this.Hi = 0; + this.Delta = arrayType.zero(); + return; + } + this.Lo = Lo_; + this.Hi = Hi_; + this.Delta = Delta_; + }); + d = $pkg.d = $newType(12, $kindArray, "unicode.d", "d", "unicode", null); + foldPair = $pkg.foldPair = $newType(0, $kindStruct, "unicode.foldPair", "foldPair", "unicode", function(From_, To_) { + this.$val = this; + if (arguments.length === 0) { + this.From = 0; + this.To = 0; + return; + } + this.From = From_; + this.To = To_; + }); + arrayType = $arrayType($Int32, 3); + sliceType = $sliceType(Range16); + sliceType$1 = $sliceType(Range32); + sliceType$3 = $sliceType(CaseRange); + sliceType$4 = $sliceType(foldPair); + to = function(_case, r, caseRange) { + var $ptr, _case, _q, caseRange, cr, delta, hi, lo, m, r, x; + if (_case < 0 || 3 <= _case) { + return 65533; + } + lo = 0; + hi = caseRange.$length; + while (true) { + if (!(lo < hi)) { break; } + m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; + cr = ((m < 0 || m >= caseRange.$length) ? $throwRuntimeError("index out of range") : caseRange.$array[caseRange.$offset + m]); + if ((cr.Lo >> 0) <= r && r <= (cr.Hi >> 0)) { + delta = (x = cr.Delta, ((_case < 0 || _case >= x.length) ? $throwRuntimeError("index out of range") : x[_case])); + if (delta > 1114111) { + return (cr.Lo >> 0) + ((((((r - (cr.Lo >> 0) >> 0)) & ~1) >> 0) | ((_case & 1) >> 0))) >> 0; + } + return r + delta >> 0; + } + if (r < (cr.Lo >> 0)) { + hi = m; + } else { + lo = m + 1 >> 0; + } + } + return r; + }; + IsDigit = function(r) { + var $ptr, r; + if (r <= 255) { + return 48 <= r && r <= 57; + } + return isExcludingLatin($pkg.Digit, r); + }; + $pkg.IsDigit = IsDigit; + IsLetter = function(r) { + var $ptr, r, x; + if ((r >>> 0) <= 255) { + return !(((((x = (r << 24 >>> 24), ((x < 0 || x >= properties.length) ? $throwRuntimeError("index out of range") : properties[x])) & 96) >>> 0) === 0)); + } + return isExcludingLatin($pkg.Letter, r); + }; + $pkg.IsLetter = IsLetter; + is16 = function(ranges, r) { + var $ptr, _i, _q, _r, _r$1, _ref, hi, i, lo, m, r, range_, range_$1, ranges; + if (ranges.$length <= 18 || r <= 255) { + _ref = ranges; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + range_ = ((i < 0 || i >= ranges.$length) ? $throwRuntimeError("index out of range") : ranges.$array[ranges.$offset + i]); + if (r < range_.Lo) { + return false; + } + if (r <= range_.Hi) { + return (_r = ((r - range_.Lo << 16 >>> 16)) % range_.Stride, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0; + } + _i++; + } + return false; + } + lo = 0; + hi = ranges.$length; + while (true) { + if (!(lo < hi)) { break; } + m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; + range_$1 = ((m < 0 || m >= ranges.$length) ? $throwRuntimeError("index out of range") : ranges.$array[ranges.$offset + m]); + if (range_$1.Lo <= r && r <= range_$1.Hi) { + return (_r$1 = ((r - range_$1.Lo << 16 >>> 16)) % range_$1.Stride, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0; + } + if (r < range_$1.Lo) { + hi = m; + } else { + lo = m + 1 >> 0; + } + } + return false; + }; + is32 = function(ranges, r) { + var $ptr, _i, _q, _r, _r$1, _ref, hi, i, lo, m, r, range_, range_$1, ranges; + if (ranges.$length <= 18) { + _ref = ranges; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + range_ = ((i < 0 || i >= ranges.$length) ? $throwRuntimeError("index out of range") : ranges.$array[ranges.$offset + i]); + if (r < range_.Lo) { + return false; + } + if (r <= range_.Hi) { + return (_r = ((r - range_.Lo >>> 0)) % range_.Stride, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0; + } + _i++; + } + return false; + } + lo = 0; + hi = ranges.$length; + while (true) { + if (!(lo < hi)) { break; } + m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; + range_$1 = $clone(((m < 0 || m >= ranges.$length) ? $throwRuntimeError("index out of range") : ranges.$array[ranges.$offset + m]), Range32); + if (range_$1.Lo <= r && r <= range_$1.Hi) { + return (_r$1 = ((r - range_$1.Lo >>> 0)) % range_$1.Stride, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0; + } + if (r < range_$1.Lo) { + hi = m; + } else { + lo = m + 1 >> 0; + } + } + return false; + }; + isExcludingLatin = function(rangeTab, r) { + var $ptr, off, r, r16, r32, rangeTab, x; + r16 = rangeTab.R16; + off = rangeTab.LatinOffset; + if (r16.$length > off && r <= ((x = r16.$length - 1 >> 0, ((x < 0 || x >= r16.$length) ? $throwRuntimeError("index out of range") : r16.$array[r16.$offset + x])).Hi >> 0)) { + return is16($subslice(r16, off), (r << 16 >>> 16)); + } + r32 = rangeTab.R32; + if (r32.$length > 0 && r >= ((0 >= r32.$length ? $throwRuntimeError("index out of range") : r32.$array[r32.$offset + 0]).Lo >> 0)) { + return is32(r32, (r >>> 0)); + } + return false; + }; + To = function(_case, r) { + var $ptr, _case, r; + return to(_case, r, $pkg.CaseRanges); + }; + $pkg.To = To; + ToUpper = function(r) { + var $ptr, r; + if (r <= 127) { + if (97 <= r && r <= 122) { + r = r - (32) >> 0; + } + return r; + } + return To(0, r); + }; + $pkg.ToUpper = ToUpper; + ToLower = function(r) { + var $ptr, r; + if (r <= 127) { + if (65 <= r && r <= 90) { + r = r + (32) >> 0; + } + return r; + } + return To(1, r); + }; + $pkg.ToLower = ToLower; + SimpleFold = function(r) { + var $ptr, _q, hi, l, lo, m, r; + lo = 0; + hi = caseOrbit.$length; + while (true) { + if (!(lo < hi)) { break; } + m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; + if ((((m < 0 || m >= caseOrbit.$length) ? $throwRuntimeError("index out of range") : caseOrbit.$array[caseOrbit.$offset + m]).From >> 0) < r) { + lo = m + 1 >> 0; + } else { + hi = m; + } + } + if (lo < caseOrbit.$length && ((((lo < 0 || lo >= caseOrbit.$length) ? $throwRuntimeError("index out of range") : caseOrbit.$array[caseOrbit.$offset + lo]).From >> 0) === r)) { + return (((lo < 0 || lo >= caseOrbit.$length) ? $throwRuntimeError("index out of range") : caseOrbit.$array[caseOrbit.$offset + lo]).To >> 0); + } + l = ToLower(r); + if (!((l === r))) { + return l; + } + return ToUpper(r); + }; + $pkg.SimpleFold = SimpleFold; + RangeTable.init([{prop: "R16", name: "R16", pkg: "", typ: sliceType, tag: ""}, {prop: "R32", name: "R32", pkg: "", typ: sliceType$1, tag: ""}, {prop: "LatinOffset", name: "LatinOffset", pkg: "", typ: $Int, tag: ""}]); + Range16.init([{prop: "Lo", name: "Lo", pkg: "", typ: $Uint16, tag: ""}, {prop: "Hi", name: "Hi", pkg: "", typ: $Uint16, tag: ""}, {prop: "Stride", name: "Stride", pkg: "", typ: $Uint16, tag: ""}]); + Range32.init([{prop: "Lo", name: "Lo", pkg: "", typ: $Uint32, tag: ""}, {prop: "Hi", name: "Hi", pkg: "", typ: $Uint32, tag: ""}, {prop: "Stride", name: "Stride", pkg: "", typ: $Uint32, tag: ""}]); + CaseRange.init([{prop: "Lo", name: "Lo", pkg: "", typ: $Uint32, tag: ""}, {prop: "Hi", name: "Hi", pkg: "", typ: $Uint32, tag: ""}, {prop: "Delta", name: "Delta", pkg: "", typ: d, tag: ""}]); + d.init($Int32, 3); + foldPair.init([{prop: "From", name: "From", pkg: "", typ: $Uint16, tag: ""}, {prop: "To", name: "To", pkg: "", typ: $Uint16, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _L = new RangeTable.ptr(new sliceType([new Range16.ptr(65, 90, 1), new Range16.ptr(97, 122, 1), new Range16.ptr(170, 181, 11), new Range16.ptr(186, 192, 6), new Range16.ptr(193, 214, 1), new Range16.ptr(216, 246, 1), new Range16.ptr(248, 705, 1), new Range16.ptr(710, 721, 1), new Range16.ptr(736, 740, 1), new Range16.ptr(748, 750, 2), new Range16.ptr(880, 884, 1), new Range16.ptr(886, 887, 1), new Range16.ptr(890, 893, 1), new Range16.ptr(895, 902, 7), new Range16.ptr(904, 906, 1), new Range16.ptr(908, 910, 2), new Range16.ptr(911, 929, 1), new Range16.ptr(931, 1013, 1), new Range16.ptr(1015, 1153, 1), new Range16.ptr(1162, 1327, 1), new Range16.ptr(1329, 1366, 1), new Range16.ptr(1369, 1377, 8), new Range16.ptr(1378, 1415, 1), new Range16.ptr(1488, 1514, 1), new Range16.ptr(1520, 1522, 1), new Range16.ptr(1568, 1610, 1), new Range16.ptr(1646, 1647, 1), new Range16.ptr(1649, 1747, 1), new Range16.ptr(1749, 1765, 16), new Range16.ptr(1766, 1774, 8), new Range16.ptr(1775, 1786, 11), new Range16.ptr(1787, 1788, 1), new Range16.ptr(1791, 1808, 17), new Range16.ptr(1810, 1839, 1), new Range16.ptr(1869, 1957, 1), new Range16.ptr(1969, 1994, 25), new Range16.ptr(1995, 2026, 1), new Range16.ptr(2036, 2037, 1), new Range16.ptr(2042, 2048, 6), new Range16.ptr(2049, 2069, 1), new Range16.ptr(2074, 2084, 10), new Range16.ptr(2088, 2112, 24), new Range16.ptr(2113, 2136, 1), new Range16.ptr(2208, 2228, 1), new Range16.ptr(2308, 2361, 1), new Range16.ptr(2365, 2384, 19), new Range16.ptr(2392, 2401, 1), new Range16.ptr(2417, 2432, 1), new Range16.ptr(2437, 2444, 1), new Range16.ptr(2447, 2448, 1), new Range16.ptr(2451, 2472, 1), new Range16.ptr(2474, 2480, 1), new Range16.ptr(2482, 2486, 4), new Range16.ptr(2487, 2489, 1), new Range16.ptr(2493, 2510, 17), new Range16.ptr(2524, 2525, 1), new Range16.ptr(2527, 2529, 1), new Range16.ptr(2544, 2545, 1), new Range16.ptr(2565, 2570, 1), new Range16.ptr(2575, 2576, 1), new Range16.ptr(2579, 2600, 1), new Range16.ptr(2602, 2608, 1), new Range16.ptr(2610, 2611, 1), new Range16.ptr(2613, 2614, 1), new Range16.ptr(2616, 2617, 1), new Range16.ptr(2649, 2652, 1), new Range16.ptr(2654, 2674, 20), new Range16.ptr(2675, 2676, 1), new Range16.ptr(2693, 2701, 1), new Range16.ptr(2703, 2705, 1), new Range16.ptr(2707, 2728, 1), new Range16.ptr(2730, 2736, 1), new Range16.ptr(2738, 2739, 1), new Range16.ptr(2741, 2745, 1), new Range16.ptr(2749, 2768, 19), new Range16.ptr(2784, 2785, 1), new Range16.ptr(2809, 2821, 12), new Range16.ptr(2822, 2828, 1), new Range16.ptr(2831, 2832, 1), new Range16.ptr(2835, 2856, 1), new Range16.ptr(2858, 2864, 1), new Range16.ptr(2866, 2867, 1), new Range16.ptr(2869, 2873, 1), new Range16.ptr(2877, 2908, 31), new Range16.ptr(2909, 2911, 2), new Range16.ptr(2912, 2913, 1), new Range16.ptr(2929, 2947, 18), new Range16.ptr(2949, 2954, 1), new Range16.ptr(2958, 2960, 1), new Range16.ptr(2962, 2965, 1), new Range16.ptr(2969, 2970, 1), new Range16.ptr(2972, 2974, 2), new Range16.ptr(2975, 2979, 4), new Range16.ptr(2980, 2984, 4), new Range16.ptr(2985, 2986, 1), new Range16.ptr(2990, 3001, 1), new Range16.ptr(3024, 3077, 53), new Range16.ptr(3078, 3084, 1), new Range16.ptr(3086, 3088, 1), new Range16.ptr(3090, 3112, 1), new Range16.ptr(3114, 3129, 1), new Range16.ptr(3133, 3160, 27), new Range16.ptr(3161, 3162, 1), new Range16.ptr(3168, 3169, 1), new Range16.ptr(3205, 3212, 1), new Range16.ptr(3214, 3216, 1), new Range16.ptr(3218, 3240, 1), new Range16.ptr(3242, 3251, 1), new Range16.ptr(3253, 3257, 1), new Range16.ptr(3261, 3294, 33), new Range16.ptr(3296, 3297, 1), new Range16.ptr(3313, 3314, 1), new Range16.ptr(3333, 3340, 1), new Range16.ptr(3342, 3344, 1), new Range16.ptr(3346, 3386, 1), new Range16.ptr(3389, 3423, 17), new Range16.ptr(3424, 3425, 1), new Range16.ptr(3450, 3455, 1), new Range16.ptr(3461, 3478, 1), new Range16.ptr(3482, 3505, 1), new Range16.ptr(3507, 3515, 1), new Range16.ptr(3517, 3520, 3), new Range16.ptr(3521, 3526, 1), new Range16.ptr(3585, 3632, 1), new Range16.ptr(3634, 3635, 1), new Range16.ptr(3648, 3654, 1), new Range16.ptr(3713, 3714, 1), new Range16.ptr(3716, 3719, 3), new Range16.ptr(3720, 3722, 2), new Range16.ptr(3725, 3732, 7), new Range16.ptr(3733, 3735, 1), new Range16.ptr(3737, 3743, 1), new Range16.ptr(3745, 3747, 1), new Range16.ptr(3749, 3751, 2), new Range16.ptr(3754, 3755, 1), new Range16.ptr(3757, 3760, 1), new Range16.ptr(3762, 3763, 1), new Range16.ptr(3773, 3776, 3), new Range16.ptr(3777, 3780, 1), new Range16.ptr(3782, 3804, 22), new Range16.ptr(3805, 3807, 1), new Range16.ptr(3840, 3904, 64), new Range16.ptr(3905, 3911, 1), new Range16.ptr(3913, 3948, 1), new Range16.ptr(3976, 3980, 1), new Range16.ptr(4096, 4138, 1), new Range16.ptr(4159, 4176, 17), new Range16.ptr(4177, 4181, 1), new Range16.ptr(4186, 4189, 1), new Range16.ptr(4193, 4197, 4), new Range16.ptr(4198, 4206, 8), new Range16.ptr(4207, 4208, 1), new Range16.ptr(4213, 4225, 1), new Range16.ptr(4238, 4256, 18), new Range16.ptr(4257, 4293, 1), new Range16.ptr(4295, 4301, 6), new Range16.ptr(4304, 4346, 1), new Range16.ptr(4348, 4680, 1), new Range16.ptr(4682, 4685, 1), new Range16.ptr(4688, 4694, 1), new Range16.ptr(4696, 4698, 2), new Range16.ptr(4699, 4701, 1), new Range16.ptr(4704, 4744, 1), new Range16.ptr(4746, 4749, 1), new Range16.ptr(4752, 4784, 1), new Range16.ptr(4786, 4789, 1), new Range16.ptr(4792, 4798, 1), new Range16.ptr(4800, 4802, 2), new Range16.ptr(4803, 4805, 1), new Range16.ptr(4808, 4822, 1), new Range16.ptr(4824, 4880, 1), new Range16.ptr(4882, 4885, 1), new Range16.ptr(4888, 4954, 1), new Range16.ptr(4992, 5007, 1), new Range16.ptr(5024, 5109, 1), new Range16.ptr(5112, 5117, 1), new Range16.ptr(5121, 5740, 1), new Range16.ptr(5743, 5759, 1), new Range16.ptr(5761, 5786, 1), new Range16.ptr(5792, 5866, 1), new Range16.ptr(5873, 5880, 1), new Range16.ptr(5888, 5900, 1), new Range16.ptr(5902, 5905, 1), new Range16.ptr(5920, 5937, 1), new Range16.ptr(5952, 5969, 1), new Range16.ptr(5984, 5996, 1), new Range16.ptr(5998, 6000, 1), new Range16.ptr(6016, 6067, 1), new Range16.ptr(6103, 6108, 5), new Range16.ptr(6176, 6263, 1), new Range16.ptr(6272, 6312, 1), new Range16.ptr(6314, 6320, 6), new Range16.ptr(6321, 6389, 1), new Range16.ptr(6400, 6430, 1), new Range16.ptr(6480, 6509, 1), new Range16.ptr(6512, 6516, 1), new Range16.ptr(6528, 6571, 1), new Range16.ptr(6576, 6601, 1), new Range16.ptr(6656, 6678, 1), new Range16.ptr(6688, 6740, 1), new Range16.ptr(6823, 6917, 94), new Range16.ptr(6918, 6963, 1), new Range16.ptr(6981, 6987, 1), new Range16.ptr(7043, 7072, 1), new Range16.ptr(7086, 7087, 1), new Range16.ptr(7098, 7141, 1), new Range16.ptr(7168, 7203, 1), new Range16.ptr(7245, 7247, 1), new Range16.ptr(7258, 7293, 1), new Range16.ptr(7401, 7404, 1), new Range16.ptr(7406, 7409, 1), new Range16.ptr(7413, 7414, 1), new Range16.ptr(7424, 7615, 1), new Range16.ptr(7680, 7957, 1), new Range16.ptr(7960, 7965, 1), new Range16.ptr(7968, 8005, 1), new Range16.ptr(8008, 8013, 1), new Range16.ptr(8016, 8023, 1), new Range16.ptr(8025, 8031, 2), new Range16.ptr(8032, 8061, 1), new Range16.ptr(8064, 8116, 1), new Range16.ptr(8118, 8124, 1), new Range16.ptr(8126, 8130, 4), new Range16.ptr(8131, 8132, 1), new Range16.ptr(8134, 8140, 1), new Range16.ptr(8144, 8147, 1), new Range16.ptr(8150, 8155, 1), new Range16.ptr(8160, 8172, 1), new Range16.ptr(8178, 8180, 1), new Range16.ptr(8182, 8188, 1), new Range16.ptr(8305, 8319, 14), new Range16.ptr(8336, 8348, 1), new Range16.ptr(8450, 8455, 5), new Range16.ptr(8458, 8467, 1), new Range16.ptr(8469, 8473, 4), new Range16.ptr(8474, 8477, 1), new Range16.ptr(8484, 8490, 2), new Range16.ptr(8491, 8493, 1), new Range16.ptr(8495, 8505, 1), new Range16.ptr(8508, 8511, 1), new Range16.ptr(8517, 8521, 1), new Range16.ptr(8526, 8579, 53), new Range16.ptr(8580, 11264, 2684), new Range16.ptr(11265, 11310, 1), new Range16.ptr(11312, 11358, 1), new Range16.ptr(11360, 11492, 1), new Range16.ptr(11499, 11502, 1), new Range16.ptr(11506, 11507, 1), new Range16.ptr(11520, 11557, 1), new Range16.ptr(11559, 11565, 6), new Range16.ptr(11568, 11623, 1), new Range16.ptr(11631, 11648, 17), new Range16.ptr(11649, 11670, 1), new Range16.ptr(11680, 11686, 1), new Range16.ptr(11688, 11694, 1), new Range16.ptr(11696, 11702, 1), new Range16.ptr(11704, 11710, 1), new Range16.ptr(11712, 11718, 1), new Range16.ptr(11720, 11726, 1), new Range16.ptr(11728, 11734, 1), new Range16.ptr(11736, 11742, 1), new Range16.ptr(11823, 12293, 470), new Range16.ptr(12294, 12337, 43), new Range16.ptr(12338, 12341, 1), new Range16.ptr(12347, 12348, 1), new Range16.ptr(12353, 12438, 1), new Range16.ptr(12445, 12447, 1), new Range16.ptr(12449, 12538, 1), new Range16.ptr(12540, 12543, 1), new Range16.ptr(12549, 12589, 1), new Range16.ptr(12593, 12686, 1), new Range16.ptr(12704, 12730, 1), new Range16.ptr(12784, 12799, 1), new Range16.ptr(13312, 19893, 1), new Range16.ptr(19968, 40917, 1), new Range16.ptr(40960, 42124, 1), new Range16.ptr(42192, 42237, 1), new Range16.ptr(42240, 42508, 1), new Range16.ptr(42512, 42527, 1), new Range16.ptr(42538, 42539, 1), new Range16.ptr(42560, 42606, 1), new Range16.ptr(42623, 42653, 1), new Range16.ptr(42656, 42725, 1), new Range16.ptr(42775, 42783, 1), new Range16.ptr(42786, 42888, 1), new Range16.ptr(42891, 42925, 1), new Range16.ptr(42928, 42935, 1), new Range16.ptr(42999, 43009, 1), new Range16.ptr(43011, 43013, 1), new Range16.ptr(43015, 43018, 1), new Range16.ptr(43020, 43042, 1), new Range16.ptr(43072, 43123, 1), new Range16.ptr(43138, 43187, 1), new Range16.ptr(43250, 43255, 1), new Range16.ptr(43259, 43261, 2), new Range16.ptr(43274, 43301, 1), new Range16.ptr(43312, 43334, 1), new Range16.ptr(43360, 43388, 1), new Range16.ptr(43396, 43442, 1), new Range16.ptr(43471, 43488, 17), new Range16.ptr(43489, 43492, 1), new Range16.ptr(43494, 43503, 1), new Range16.ptr(43514, 43518, 1), new Range16.ptr(43520, 43560, 1), new Range16.ptr(43584, 43586, 1), new Range16.ptr(43588, 43595, 1), new Range16.ptr(43616, 43638, 1), new Range16.ptr(43642, 43646, 4), new Range16.ptr(43647, 43695, 1), new Range16.ptr(43697, 43701, 4), new Range16.ptr(43702, 43705, 3), new Range16.ptr(43706, 43709, 1), new Range16.ptr(43712, 43714, 2), new Range16.ptr(43739, 43741, 1), new Range16.ptr(43744, 43754, 1), new Range16.ptr(43762, 43764, 1), new Range16.ptr(43777, 43782, 1), new Range16.ptr(43785, 43790, 1), new Range16.ptr(43793, 43798, 1), new Range16.ptr(43808, 43814, 1), new Range16.ptr(43816, 43822, 1), new Range16.ptr(43824, 43866, 1), new Range16.ptr(43868, 43877, 1), new Range16.ptr(43888, 44002, 1), new Range16.ptr(44032, 55203, 1), new Range16.ptr(55216, 55238, 1), new Range16.ptr(55243, 55291, 1), new Range16.ptr(63744, 64109, 1), new Range16.ptr(64112, 64217, 1), new Range16.ptr(64256, 64262, 1), new Range16.ptr(64275, 64279, 1), new Range16.ptr(64285, 64287, 2), new Range16.ptr(64288, 64296, 1), new Range16.ptr(64298, 64310, 1), new Range16.ptr(64312, 64316, 1), new Range16.ptr(64318, 64320, 2), new Range16.ptr(64321, 64323, 2), new Range16.ptr(64324, 64326, 2), new Range16.ptr(64327, 64433, 1), new Range16.ptr(64467, 64829, 1), new Range16.ptr(64848, 64911, 1), new Range16.ptr(64914, 64967, 1), new Range16.ptr(65008, 65019, 1), new Range16.ptr(65136, 65140, 1), new Range16.ptr(65142, 65276, 1), new Range16.ptr(65313, 65338, 1), new Range16.ptr(65345, 65370, 1), new Range16.ptr(65382, 65470, 1), new Range16.ptr(65474, 65479, 1), new Range16.ptr(65482, 65487, 1), new Range16.ptr(65490, 65495, 1), new Range16.ptr(65498, 65500, 1)]), new sliceType$1([new Range32.ptr(65536, 65547, 1), new Range32.ptr(65549, 65574, 1), new Range32.ptr(65576, 65594, 1), new Range32.ptr(65596, 65597, 1), new Range32.ptr(65599, 65613, 1), new Range32.ptr(65616, 65629, 1), new Range32.ptr(65664, 65786, 1), new Range32.ptr(66176, 66204, 1), new Range32.ptr(66208, 66256, 1), new Range32.ptr(66304, 66335, 1), new Range32.ptr(66352, 66368, 1), new Range32.ptr(66370, 66377, 1), new Range32.ptr(66384, 66421, 1), new Range32.ptr(66432, 66461, 1), new Range32.ptr(66464, 66499, 1), new Range32.ptr(66504, 66511, 1), new Range32.ptr(66560, 66717, 1), new Range32.ptr(66816, 66855, 1), new Range32.ptr(66864, 66915, 1), new Range32.ptr(67072, 67382, 1), new Range32.ptr(67392, 67413, 1), new Range32.ptr(67424, 67431, 1), new Range32.ptr(67584, 67589, 1), new Range32.ptr(67592, 67594, 2), new Range32.ptr(67595, 67637, 1), new Range32.ptr(67639, 67640, 1), new Range32.ptr(67644, 67647, 3), new Range32.ptr(67648, 67669, 1), new Range32.ptr(67680, 67702, 1), new Range32.ptr(67712, 67742, 1), new Range32.ptr(67808, 67826, 1), new Range32.ptr(67828, 67829, 1), new Range32.ptr(67840, 67861, 1), new Range32.ptr(67872, 67897, 1), new Range32.ptr(67968, 68023, 1), new Range32.ptr(68030, 68031, 1), new Range32.ptr(68096, 68112, 16), new Range32.ptr(68113, 68115, 1), new Range32.ptr(68117, 68119, 1), new Range32.ptr(68121, 68147, 1), new Range32.ptr(68192, 68220, 1), new Range32.ptr(68224, 68252, 1), new Range32.ptr(68288, 68295, 1), new Range32.ptr(68297, 68324, 1), new Range32.ptr(68352, 68405, 1), new Range32.ptr(68416, 68437, 1), new Range32.ptr(68448, 68466, 1), new Range32.ptr(68480, 68497, 1), new Range32.ptr(68608, 68680, 1), new Range32.ptr(68736, 68786, 1), new Range32.ptr(68800, 68850, 1), new Range32.ptr(69635, 69687, 1), new Range32.ptr(69763, 69807, 1), new Range32.ptr(69840, 69864, 1), new Range32.ptr(69891, 69926, 1), new Range32.ptr(69968, 70002, 1), new Range32.ptr(70006, 70019, 13), new Range32.ptr(70020, 70066, 1), new Range32.ptr(70081, 70084, 1), new Range32.ptr(70106, 70108, 2), new Range32.ptr(70144, 70161, 1), new Range32.ptr(70163, 70187, 1), new Range32.ptr(70272, 70278, 1), new Range32.ptr(70280, 70282, 2), new Range32.ptr(70283, 70285, 1), new Range32.ptr(70287, 70301, 1), new Range32.ptr(70303, 70312, 1), new Range32.ptr(70320, 70366, 1), new Range32.ptr(70405, 70412, 1), new Range32.ptr(70415, 70416, 1), new Range32.ptr(70419, 70440, 1), new Range32.ptr(70442, 70448, 1), new Range32.ptr(70450, 70451, 1), new Range32.ptr(70453, 70457, 1), new Range32.ptr(70461, 70480, 19), new Range32.ptr(70493, 70497, 1), new Range32.ptr(70784, 70831, 1), new Range32.ptr(70852, 70853, 1), new Range32.ptr(70855, 71040, 185), new Range32.ptr(71041, 71086, 1), new Range32.ptr(71128, 71131, 1), new Range32.ptr(71168, 71215, 1), new Range32.ptr(71236, 71296, 60), new Range32.ptr(71297, 71338, 1), new Range32.ptr(71424, 71449, 1), new Range32.ptr(71840, 71903, 1), new Range32.ptr(71935, 72384, 449), new Range32.ptr(72385, 72440, 1), new Range32.ptr(73728, 74649, 1), new Range32.ptr(74880, 75075, 1), new Range32.ptr(77824, 78894, 1), new Range32.ptr(82944, 83526, 1), new Range32.ptr(92160, 92728, 1), new Range32.ptr(92736, 92766, 1), new Range32.ptr(92880, 92909, 1), new Range32.ptr(92928, 92975, 1), new Range32.ptr(92992, 92995, 1), new Range32.ptr(93027, 93047, 1), new Range32.ptr(93053, 93071, 1), new Range32.ptr(93952, 94020, 1), new Range32.ptr(94032, 94099, 67), new Range32.ptr(94100, 94111, 1), new Range32.ptr(110592, 110593, 1), new Range32.ptr(113664, 113770, 1), new Range32.ptr(113776, 113788, 1), new Range32.ptr(113792, 113800, 1), new Range32.ptr(113808, 113817, 1), new Range32.ptr(119808, 119892, 1), new Range32.ptr(119894, 119964, 1), new Range32.ptr(119966, 119967, 1), new Range32.ptr(119970, 119973, 3), new Range32.ptr(119974, 119977, 3), new Range32.ptr(119978, 119980, 1), new Range32.ptr(119982, 119993, 1), new Range32.ptr(119995, 119997, 2), new Range32.ptr(119998, 120003, 1), new Range32.ptr(120005, 120069, 1), new Range32.ptr(120071, 120074, 1), new Range32.ptr(120077, 120084, 1), new Range32.ptr(120086, 120092, 1), new Range32.ptr(120094, 120121, 1), new Range32.ptr(120123, 120126, 1), new Range32.ptr(120128, 120132, 1), new Range32.ptr(120134, 120138, 4), new Range32.ptr(120139, 120144, 1), new Range32.ptr(120146, 120485, 1), new Range32.ptr(120488, 120512, 1), new Range32.ptr(120514, 120538, 1), new Range32.ptr(120540, 120570, 1), new Range32.ptr(120572, 120596, 1), new Range32.ptr(120598, 120628, 1), new Range32.ptr(120630, 120654, 1), new Range32.ptr(120656, 120686, 1), new Range32.ptr(120688, 120712, 1), new Range32.ptr(120714, 120744, 1), new Range32.ptr(120746, 120770, 1), new Range32.ptr(120772, 120779, 1), new Range32.ptr(124928, 125124, 1), new Range32.ptr(126464, 126467, 1), new Range32.ptr(126469, 126495, 1), new Range32.ptr(126497, 126498, 1), new Range32.ptr(126500, 126503, 3), new Range32.ptr(126505, 126514, 1), new Range32.ptr(126516, 126519, 1), new Range32.ptr(126521, 126523, 2), new Range32.ptr(126530, 126535, 5), new Range32.ptr(126537, 126541, 2), new Range32.ptr(126542, 126543, 1), new Range32.ptr(126545, 126546, 1), new Range32.ptr(126548, 126551, 3), new Range32.ptr(126553, 126561, 2), new Range32.ptr(126562, 126564, 2), new Range32.ptr(126567, 126570, 1), new Range32.ptr(126572, 126578, 1), new Range32.ptr(126580, 126583, 1), new Range32.ptr(126585, 126588, 1), new Range32.ptr(126590, 126592, 2), new Range32.ptr(126593, 126601, 1), new Range32.ptr(126603, 126619, 1), new Range32.ptr(126625, 126627, 1), new Range32.ptr(126629, 126633, 1), new Range32.ptr(126635, 126651, 1), new Range32.ptr(131072, 173782, 1), new Range32.ptr(173824, 177972, 1), new Range32.ptr(177984, 178205, 1), new Range32.ptr(178208, 183969, 1), new Range32.ptr(194560, 195101, 1)]), 6); + _Nd = new RangeTable.ptr(new sliceType([new Range16.ptr(48, 57, 1), new Range16.ptr(1632, 1641, 1), new Range16.ptr(1776, 1785, 1), new Range16.ptr(1984, 1993, 1), new Range16.ptr(2406, 2415, 1), new Range16.ptr(2534, 2543, 1), new Range16.ptr(2662, 2671, 1), new Range16.ptr(2790, 2799, 1), new Range16.ptr(2918, 2927, 1), new Range16.ptr(3046, 3055, 1), new Range16.ptr(3174, 3183, 1), new Range16.ptr(3302, 3311, 1), new Range16.ptr(3430, 3439, 1), new Range16.ptr(3558, 3567, 1), new Range16.ptr(3664, 3673, 1), new Range16.ptr(3792, 3801, 1), new Range16.ptr(3872, 3881, 1), new Range16.ptr(4160, 4169, 1), new Range16.ptr(4240, 4249, 1), new Range16.ptr(6112, 6121, 1), new Range16.ptr(6160, 6169, 1), new Range16.ptr(6470, 6479, 1), new Range16.ptr(6608, 6617, 1), new Range16.ptr(6784, 6793, 1), new Range16.ptr(6800, 6809, 1), new Range16.ptr(6992, 7001, 1), new Range16.ptr(7088, 7097, 1), new Range16.ptr(7232, 7241, 1), new Range16.ptr(7248, 7257, 1), new Range16.ptr(42528, 42537, 1), new Range16.ptr(43216, 43225, 1), new Range16.ptr(43264, 43273, 1), new Range16.ptr(43472, 43481, 1), new Range16.ptr(43504, 43513, 1), new Range16.ptr(43600, 43609, 1), new Range16.ptr(44016, 44025, 1), new Range16.ptr(65296, 65305, 1)]), new sliceType$1([new Range32.ptr(66720, 66729, 1), new Range32.ptr(69734, 69743, 1), new Range32.ptr(69872, 69881, 1), new Range32.ptr(69942, 69951, 1), new Range32.ptr(70096, 70105, 1), new Range32.ptr(70384, 70393, 1), new Range32.ptr(70864, 70873, 1), new Range32.ptr(71248, 71257, 1), new Range32.ptr(71360, 71369, 1), new Range32.ptr(71472, 71481, 1), new Range32.ptr(71904, 71913, 1), new Range32.ptr(92768, 92777, 1), new Range32.ptr(93008, 93017, 1), new Range32.ptr(120782, 120831, 1)]), 1); + $pkg.Digit = _Nd; + $pkg.Letter = _L; + _CaseRanges = new sliceType$3([new CaseRange.ptr(65, 90, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(97, 122, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(181, 181, $toNativeArray($kindInt32, [743, 0, 743])), new CaseRange.ptr(192, 214, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(216, 222, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(224, 246, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(248, 254, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(255, 255, $toNativeArray($kindInt32, [121, 0, 121])), new CaseRange.ptr(256, 303, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(304, 304, $toNativeArray($kindInt32, [0, -199, 0])), new CaseRange.ptr(305, 305, $toNativeArray($kindInt32, [-232, 0, -232])), new CaseRange.ptr(306, 311, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(313, 328, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(330, 375, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(376, 376, $toNativeArray($kindInt32, [0, -121, 0])), new CaseRange.ptr(377, 382, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(383, 383, $toNativeArray($kindInt32, [-300, 0, -300])), new CaseRange.ptr(384, 384, $toNativeArray($kindInt32, [195, 0, 195])), new CaseRange.ptr(385, 385, $toNativeArray($kindInt32, [0, 210, 0])), new CaseRange.ptr(386, 389, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(390, 390, $toNativeArray($kindInt32, [0, 206, 0])), new CaseRange.ptr(391, 392, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(393, 394, $toNativeArray($kindInt32, [0, 205, 0])), new CaseRange.ptr(395, 396, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(398, 398, $toNativeArray($kindInt32, [0, 79, 0])), new CaseRange.ptr(399, 399, $toNativeArray($kindInt32, [0, 202, 0])), new CaseRange.ptr(400, 400, $toNativeArray($kindInt32, [0, 203, 0])), new CaseRange.ptr(401, 402, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(403, 403, $toNativeArray($kindInt32, [0, 205, 0])), new CaseRange.ptr(404, 404, $toNativeArray($kindInt32, [0, 207, 0])), new CaseRange.ptr(405, 405, $toNativeArray($kindInt32, [97, 0, 97])), new CaseRange.ptr(406, 406, $toNativeArray($kindInt32, [0, 211, 0])), new CaseRange.ptr(407, 407, $toNativeArray($kindInt32, [0, 209, 0])), new CaseRange.ptr(408, 409, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(410, 410, $toNativeArray($kindInt32, [163, 0, 163])), new CaseRange.ptr(412, 412, $toNativeArray($kindInt32, [0, 211, 0])), new CaseRange.ptr(413, 413, $toNativeArray($kindInt32, [0, 213, 0])), new CaseRange.ptr(414, 414, $toNativeArray($kindInt32, [130, 0, 130])), new CaseRange.ptr(415, 415, $toNativeArray($kindInt32, [0, 214, 0])), new CaseRange.ptr(416, 421, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(422, 422, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(423, 424, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(425, 425, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(428, 429, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(430, 430, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(431, 432, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(433, 434, $toNativeArray($kindInt32, [0, 217, 0])), new CaseRange.ptr(435, 438, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(439, 439, $toNativeArray($kindInt32, [0, 219, 0])), new CaseRange.ptr(440, 441, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(444, 445, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(447, 447, $toNativeArray($kindInt32, [56, 0, 56])), new CaseRange.ptr(452, 452, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(453, 453, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(454, 454, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(455, 455, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(456, 456, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(457, 457, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(458, 458, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(459, 459, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(460, 460, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(461, 476, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(477, 477, $toNativeArray($kindInt32, [-79, 0, -79])), new CaseRange.ptr(478, 495, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(497, 497, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(498, 498, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(499, 499, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(500, 501, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(502, 502, $toNativeArray($kindInt32, [0, -97, 0])), new CaseRange.ptr(503, 503, $toNativeArray($kindInt32, [0, -56, 0])), new CaseRange.ptr(504, 543, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(544, 544, $toNativeArray($kindInt32, [0, -130, 0])), new CaseRange.ptr(546, 563, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(570, 570, $toNativeArray($kindInt32, [0, 10795, 0])), new CaseRange.ptr(571, 572, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(573, 573, $toNativeArray($kindInt32, [0, -163, 0])), new CaseRange.ptr(574, 574, $toNativeArray($kindInt32, [0, 10792, 0])), new CaseRange.ptr(575, 576, $toNativeArray($kindInt32, [10815, 0, 10815])), new CaseRange.ptr(577, 578, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(579, 579, $toNativeArray($kindInt32, [0, -195, 0])), new CaseRange.ptr(580, 580, $toNativeArray($kindInt32, [0, 69, 0])), new CaseRange.ptr(581, 581, $toNativeArray($kindInt32, [0, 71, 0])), new CaseRange.ptr(582, 591, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(592, 592, $toNativeArray($kindInt32, [10783, 0, 10783])), new CaseRange.ptr(593, 593, $toNativeArray($kindInt32, [10780, 0, 10780])), new CaseRange.ptr(594, 594, $toNativeArray($kindInt32, [10782, 0, 10782])), new CaseRange.ptr(595, 595, $toNativeArray($kindInt32, [-210, 0, -210])), new CaseRange.ptr(596, 596, $toNativeArray($kindInt32, [-206, 0, -206])), new CaseRange.ptr(598, 599, $toNativeArray($kindInt32, [-205, 0, -205])), new CaseRange.ptr(601, 601, $toNativeArray($kindInt32, [-202, 0, -202])), new CaseRange.ptr(603, 603, $toNativeArray($kindInt32, [-203, 0, -203])), new CaseRange.ptr(604, 604, $toNativeArray($kindInt32, [42319, 0, 42319])), new CaseRange.ptr(608, 608, $toNativeArray($kindInt32, [-205, 0, -205])), new CaseRange.ptr(609, 609, $toNativeArray($kindInt32, [42315, 0, 42315])), new CaseRange.ptr(611, 611, $toNativeArray($kindInt32, [-207, 0, -207])), new CaseRange.ptr(613, 613, $toNativeArray($kindInt32, [42280, 0, 42280])), new CaseRange.ptr(614, 614, $toNativeArray($kindInt32, [42308, 0, 42308])), new CaseRange.ptr(616, 616, $toNativeArray($kindInt32, [-209, 0, -209])), new CaseRange.ptr(617, 617, $toNativeArray($kindInt32, [-211, 0, -211])), new CaseRange.ptr(619, 619, $toNativeArray($kindInt32, [10743, 0, 10743])), new CaseRange.ptr(620, 620, $toNativeArray($kindInt32, [42305, 0, 42305])), new CaseRange.ptr(623, 623, $toNativeArray($kindInt32, [-211, 0, -211])), new CaseRange.ptr(625, 625, $toNativeArray($kindInt32, [10749, 0, 10749])), new CaseRange.ptr(626, 626, $toNativeArray($kindInt32, [-213, 0, -213])), new CaseRange.ptr(629, 629, $toNativeArray($kindInt32, [-214, 0, -214])), new CaseRange.ptr(637, 637, $toNativeArray($kindInt32, [10727, 0, 10727])), new CaseRange.ptr(640, 640, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(643, 643, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(647, 647, $toNativeArray($kindInt32, [42282, 0, 42282])), new CaseRange.ptr(648, 648, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(649, 649, $toNativeArray($kindInt32, [-69, 0, -69])), new CaseRange.ptr(650, 651, $toNativeArray($kindInt32, [-217, 0, -217])), new CaseRange.ptr(652, 652, $toNativeArray($kindInt32, [-71, 0, -71])), new CaseRange.ptr(658, 658, $toNativeArray($kindInt32, [-219, 0, -219])), new CaseRange.ptr(669, 669, $toNativeArray($kindInt32, [42261, 0, 42261])), new CaseRange.ptr(670, 670, $toNativeArray($kindInt32, [42258, 0, 42258])), new CaseRange.ptr(837, 837, $toNativeArray($kindInt32, [84, 0, 84])), new CaseRange.ptr(880, 883, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(886, 887, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(891, 893, $toNativeArray($kindInt32, [130, 0, 130])), new CaseRange.ptr(895, 895, $toNativeArray($kindInt32, [0, 116, 0])), new CaseRange.ptr(902, 902, $toNativeArray($kindInt32, [0, 38, 0])), new CaseRange.ptr(904, 906, $toNativeArray($kindInt32, [0, 37, 0])), new CaseRange.ptr(908, 908, $toNativeArray($kindInt32, [0, 64, 0])), new CaseRange.ptr(910, 911, $toNativeArray($kindInt32, [0, 63, 0])), new CaseRange.ptr(913, 929, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(931, 939, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(940, 940, $toNativeArray($kindInt32, [-38, 0, -38])), new CaseRange.ptr(941, 943, $toNativeArray($kindInt32, [-37, 0, -37])), new CaseRange.ptr(945, 961, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(962, 962, $toNativeArray($kindInt32, [-31, 0, -31])), new CaseRange.ptr(963, 971, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(972, 972, $toNativeArray($kindInt32, [-64, 0, -64])), new CaseRange.ptr(973, 974, $toNativeArray($kindInt32, [-63, 0, -63])), new CaseRange.ptr(975, 975, $toNativeArray($kindInt32, [0, 8, 0])), new CaseRange.ptr(976, 976, $toNativeArray($kindInt32, [-62, 0, -62])), new CaseRange.ptr(977, 977, $toNativeArray($kindInt32, [-57, 0, -57])), new CaseRange.ptr(981, 981, $toNativeArray($kindInt32, [-47, 0, -47])), new CaseRange.ptr(982, 982, $toNativeArray($kindInt32, [-54, 0, -54])), new CaseRange.ptr(983, 983, $toNativeArray($kindInt32, [-8, 0, -8])), new CaseRange.ptr(984, 1007, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1008, 1008, $toNativeArray($kindInt32, [-86, 0, -86])), new CaseRange.ptr(1009, 1009, $toNativeArray($kindInt32, [-80, 0, -80])), new CaseRange.ptr(1010, 1010, $toNativeArray($kindInt32, [7, 0, 7])), new CaseRange.ptr(1011, 1011, $toNativeArray($kindInt32, [-116, 0, -116])), new CaseRange.ptr(1012, 1012, $toNativeArray($kindInt32, [0, -60, 0])), new CaseRange.ptr(1013, 1013, $toNativeArray($kindInt32, [-96, 0, -96])), new CaseRange.ptr(1015, 1016, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1017, 1017, $toNativeArray($kindInt32, [0, -7, 0])), new CaseRange.ptr(1018, 1019, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1021, 1023, $toNativeArray($kindInt32, [0, -130, 0])), new CaseRange.ptr(1024, 1039, $toNativeArray($kindInt32, [0, 80, 0])), new CaseRange.ptr(1040, 1071, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(1072, 1103, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(1104, 1119, $toNativeArray($kindInt32, [-80, 0, -80])), new CaseRange.ptr(1120, 1153, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1162, 1215, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1216, 1216, $toNativeArray($kindInt32, [0, 15, 0])), new CaseRange.ptr(1217, 1230, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1231, 1231, $toNativeArray($kindInt32, [-15, 0, -15])), new CaseRange.ptr(1232, 1327, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1329, 1366, $toNativeArray($kindInt32, [0, 48, 0])), new CaseRange.ptr(1377, 1414, $toNativeArray($kindInt32, [-48, 0, -48])), new CaseRange.ptr(4256, 4293, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(4295, 4295, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(4301, 4301, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(5024, 5103, $toNativeArray($kindInt32, [0, 38864, 0])), new CaseRange.ptr(5104, 5109, $toNativeArray($kindInt32, [0, 8, 0])), new CaseRange.ptr(5112, 5117, $toNativeArray($kindInt32, [-8, 0, -8])), new CaseRange.ptr(7545, 7545, $toNativeArray($kindInt32, [35332, 0, 35332])), new CaseRange.ptr(7549, 7549, $toNativeArray($kindInt32, [3814, 0, 3814])), new CaseRange.ptr(7680, 7829, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(7835, 7835, $toNativeArray($kindInt32, [-59, 0, -59])), new CaseRange.ptr(7838, 7838, $toNativeArray($kindInt32, [0, -7615, 0])), new CaseRange.ptr(7840, 7935, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(7936, 7943, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7944, 7951, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7952, 7957, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7960, 7965, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7968, 7975, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7976, 7983, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7984, 7991, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7992, 7999, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8000, 8005, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8008, 8013, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8017, 8017, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8019, 8019, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8021, 8021, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8023, 8023, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8025, 8025, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8027, 8027, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8029, 8029, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8031, 8031, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8032, 8039, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8040, 8047, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8048, 8049, $toNativeArray($kindInt32, [74, 0, 74])), new CaseRange.ptr(8050, 8053, $toNativeArray($kindInt32, [86, 0, 86])), new CaseRange.ptr(8054, 8055, $toNativeArray($kindInt32, [100, 0, 100])), new CaseRange.ptr(8056, 8057, $toNativeArray($kindInt32, [128, 0, 128])), new CaseRange.ptr(8058, 8059, $toNativeArray($kindInt32, [112, 0, 112])), new CaseRange.ptr(8060, 8061, $toNativeArray($kindInt32, [126, 0, 126])), new CaseRange.ptr(8064, 8071, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8072, 8079, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8080, 8087, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8088, 8095, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8096, 8103, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8104, 8111, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8112, 8113, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8115, 8115, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8120, 8121, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8122, 8123, $toNativeArray($kindInt32, [0, -74, 0])), new CaseRange.ptr(8124, 8124, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8126, 8126, $toNativeArray($kindInt32, [-7205, 0, -7205])), new CaseRange.ptr(8131, 8131, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8136, 8139, $toNativeArray($kindInt32, [0, -86, 0])), new CaseRange.ptr(8140, 8140, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8144, 8145, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8152, 8153, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8154, 8155, $toNativeArray($kindInt32, [0, -100, 0])), new CaseRange.ptr(8160, 8161, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8165, 8165, $toNativeArray($kindInt32, [7, 0, 7])), new CaseRange.ptr(8168, 8169, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8170, 8171, $toNativeArray($kindInt32, [0, -112, 0])), new CaseRange.ptr(8172, 8172, $toNativeArray($kindInt32, [0, -7, 0])), new CaseRange.ptr(8179, 8179, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8184, 8185, $toNativeArray($kindInt32, [0, -128, 0])), new CaseRange.ptr(8186, 8187, $toNativeArray($kindInt32, [0, -126, 0])), new CaseRange.ptr(8188, 8188, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8486, 8486, $toNativeArray($kindInt32, [0, -7517, 0])), new CaseRange.ptr(8490, 8490, $toNativeArray($kindInt32, [0, -8383, 0])), new CaseRange.ptr(8491, 8491, $toNativeArray($kindInt32, [0, -8262, 0])), new CaseRange.ptr(8498, 8498, $toNativeArray($kindInt32, [0, 28, 0])), new CaseRange.ptr(8526, 8526, $toNativeArray($kindInt32, [-28, 0, -28])), new CaseRange.ptr(8544, 8559, $toNativeArray($kindInt32, [0, 16, 0])), new CaseRange.ptr(8560, 8575, $toNativeArray($kindInt32, [-16, 0, -16])), new CaseRange.ptr(8579, 8580, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(9398, 9423, $toNativeArray($kindInt32, [0, 26, 0])), new CaseRange.ptr(9424, 9449, $toNativeArray($kindInt32, [-26, 0, -26])), new CaseRange.ptr(11264, 11310, $toNativeArray($kindInt32, [0, 48, 0])), new CaseRange.ptr(11312, 11358, $toNativeArray($kindInt32, [-48, 0, -48])), new CaseRange.ptr(11360, 11361, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11362, 11362, $toNativeArray($kindInt32, [0, -10743, 0])), new CaseRange.ptr(11363, 11363, $toNativeArray($kindInt32, [0, -3814, 0])), new CaseRange.ptr(11364, 11364, $toNativeArray($kindInt32, [0, -10727, 0])), new CaseRange.ptr(11365, 11365, $toNativeArray($kindInt32, [-10795, 0, -10795])), new CaseRange.ptr(11366, 11366, $toNativeArray($kindInt32, [-10792, 0, -10792])), new CaseRange.ptr(11367, 11372, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11373, 11373, $toNativeArray($kindInt32, [0, -10780, 0])), new CaseRange.ptr(11374, 11374, $toNativeArray($kindInt32, [0, -10749, 0])), new CaseRange.ptr(11375, 11375, $toNativeArray($kindInt32, [0, -10783, 0])), new CaseRange.ptr(11376, 11376, $toNativeArray($kindInt32, [0, -10782, 0])), new CaseRange.ptr(11378, 11379, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11381, 11382, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11390, 11391, $toNativeArray($kindInt32, [0, -10815, 0])), new CaseRange.ptr(11392, 11491, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11499, 11502, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11506, 11507, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11520, 11557, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(11559, 11559, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(11565, 11565, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(42560, 42605, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42624, 42651, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42786, 42799, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42802, 42863, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42873, 42876, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42877, 42877, $toNativeArray($kindInt32, [0, -35332, 0])), new CaseRange.ptr(42878, 42887, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42891, 42892, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42893, 42893, $toNativeArray($kindInt32, [0, -42280, 0])), new CaseRange.ptr(42896, 42899, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42902, 42921, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42922, 42922, $toNativeArray($kindInt32, [0, -42308, 0])), new CaseRange.ptr(42923, 42923, $toNativeArray($kindInt32, [0, -42319, 0])), new CaseRange.ptr(42924, 42924, $toNativeArray($kindInt32, [0, -42315, 0])), new CaseRange.ptr(42925, 42925, $toNativeArray($kindInt32, [0, -42305, 0])), new CaseRange.ptr(42928, 42928, $toNativeArray($kindInt32, [0, -42258, 0])), new CaseRange.ptr(42929, 42929, $toNativeArray($kindInt32, [0, -42282, 0])), new CaseRange.ptr(42930, 42930, $toNativeArray($kindInt32, [0, -42261, 0])), new CaseRange.ptr(42931, 42931, $toNativeArray($kindInt32, [0, 928, 0])), new CaseRange.ptr(42932, 42935, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(43859, 43859, $toNativeArray($kindInt32, [-928, 0, -928])), new CaseRange.ptr(43888, 43967, $toNativeArray($kindInt32, [-38864, 0, -38864])), new CaseRange.ptr(65313, 65338, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(65345, 65370, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(66560, 66599, $toNativeArray($kindInt32, [0, 40, 0])), new CaseRange.ptr(66600, 66639, $toNativeArray($kindInt32, [-40, 0, -40])), new CaseRange.ptr(68736, 68786, $toNativeArray($kindInt32, [0, 64, 0])), new CaseRange.ptr(68800, 68850, $toNativeArray($kindInt32, [-64, 0, -64])), new CaseRange.ptr(71840, 71871, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(71872, 71903, $toNativeArray($kindInt32, [-32, 0, -32]))]); + $pkg.CaseRanges = _CaseRanges; + properties = $toNativeArray($kindUint8, [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, 144, 130, 130, 130, 136, 130, 130, 130, 130, 130, 130, 136, 130, 130, 130, 130, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 130, 130, 136, 136, 136, 130, 130, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 130, 130, 130, 136, 130, 136, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 130, 136, 130, 136, 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, 16, 130, 136, 136, 136, 136, 136, 130, 136, 136, 224, 130, 136, 0, 136, 136, 136, 136, 132, 132, 136, 192, 130, 130, 136, 132, 224, 130, 132, 132, 132, 130, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 136, 160, 160, 160, 160, 160, 160, 160, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 136, 192, 192, 192, 192, 192, 192, 192, 192]); + caseOrbit = new sliceType$4([new foldPair.ptr(75, 107), new foldPair.ptr(83, 115), new foldPair.ptr(107, 8490), new foldPair.ptr(115, 383), new foldPair.ptr(181, 924), new foldPair.ptr(197, 229), new foldPair.ptr(223, 7838), new foldPair.ptr(229, 8491), new foldPair.ptr(304, 304), new foldPair.ptr(305, 305), new foldPair.ptr(383, 83), new foldPair.ptr(452, 453), new foldPair.ptr(453, 454), new foldPair.ptr(454, 452), new foldPair.ptr(455, 456), new foldPair.ptr(456, 457), new foldPair.ptr(457, 455), new foldPair.ptr(458, 459), new foldPair.ptr(459, 460), new foldPair.ptr(460, 458), new foldPair.ptr(497, 498), new foldPair.ptr(498, 499), new foldPair.ptr(499, 497), new foldPair.ptr(837, 921), new foldPair.ptr(914, 946), new foldPair.ptr(917, 949), new foldPair.ptr(920, 952), new foldPair.ptr(921, 953), new foldPair.ptr(922, 954), new foldPair.ptr(924, 956), new foldPair.ptr(928, 960), new foldPair.ptr(929, 961), new foldPair.ptr(931, 962), new foldPair.ptr(934, 966), new foldPair.ptr(937, 969), new foldPair.ptr(946, 976), new foldPair.ptr(949, 1013), new foldPair.ptr(952, 977), new foldPair.ptr(953, 8126), new foldPair.ptr(954, 1008), new foldPair.ptr(956, 181), new foldPair.ptr(960, 982), new foldPair.ptr(961, 1009), new foldPair.ptr(962, 963), new foldPair.ptr(963, 931), new foldPair.ptr(966, 981), new foldPair.ptr(969, 8486), new foldPair.ptr(976, 914), new foldPair.ptr(977, 1012), new foldPair.ptr(981, 934), new foldPair.ptr(982, 928), new foldPair.ptr(1008, 922), new foldPair.ptr(1009, 929), new foldPair.ptr(1012, 920), new foldPair.ptr(1013, 917), new foldPair.ptr(7776, 7777), new foldPair.ptr(7777, 7835), new foldPair.ptr(7835, 7776), new foldPair.ptr(7838, 223), new foldPair.ptr(8126, 837), new foldPair.ptr(8486, 937), new foldPair.ptr(8490, 75), new foldPair.ptr(8491, 197)]); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["unicode/utf8"] = (function() { + var $pkg = {}, $init, acceptRange, first, acceptRanges, DecodeRune, DecodeRuneInString, DecodeLastRune, RuneLen, EncodeRune, RuneCount, RuneCountInString, RuneStart; + acceptRange = $pkg.acceptRange = $newType(0, $kindStruct, "utf8.acceptRange", "acceptRange", "unicode/utf8", function(lo_, hi_) { + this.$val = this; + if (arguments.length === 0) { + this.lo = 0; + this.hi = 0; + return; + } + this.lo = lo_; + this.hi = hi_; + }); + DecodeRune = function(p) { + var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, accept, b1, b2, b3, mask, n, p, p0, r, size, sz, x, x$1; + r = 0; + size = 0; + n = p.$length; + if (n < 1) { + _tmp = 65533; + _tmp$1 = 0; + r = _tmp; + size = _tmp$1; + return [r, size]; + } + p0 = (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0]); + x = ((p0 < 0 || p0 >= first.length) ? $throwRuntimeError("index out of range") : first[p0]); + if (x >= 240) { + mask = ((x >> 0) << 31 >> 0) >> 31 >> 0; + _tmp$2 = ((((0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0]) >> 0) & ~mask) >> 0) | (65533 & mask); + _tmp$3 = 1; + r = _tmp$2; + size = _tmp$3; + return [r, size]; + } + sz = (x & 7) >>> 0; + accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? $throwRuntimeError("index out of range") : acceptRanges[x$1])), acceptRange); + if (n < (sz >> 0)) { + _tmp$4 = 65533; + _tmp$5 = 1; + r = _tmp$4; + size = _tmp$5; + return [r, size]; + } + b1 = (1 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 1]); + if (b1 < accept.lo || accept.hi < b1) { + _tmp$6 = 65533; + _tmp$7 = 1; + r = _tmp$6; + size = _tmp$7; + return [r, size]; + } + if (sz === 2) { + _tmp$8 = ((((p0 & 31) >>> 0) >> 0) << 6 >> 0) | (((b1 & 63) >>> 0) >> 0); + _tmp$9 = 2; + r = _tmp$8; + size = _tmp$9; + return [r, size]; + } + b2 = (2 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 2]); + if (b2 < 128 || 191 < b2) { + _tmp$10 = 65533; + _tmp$11 = 1; + r = _tmp$10; + size = _tmp$11; + return [r, size]; + } + if (sz === 3) { + _tmp$12 = (((((p0 & 15) >>> 0) >> 0) << 12 >> 0) | ((((b1 & 63) >>> 0) >> 0) << 6 >> 0)) | (((b2 & 63) >>> 0) >> 0); + _tmp$13 = 3; + r = _tmp$12; + size = _tmp$13; + return [r, size]; + } + b3 = (3 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 3]); + if (b3 < 128 || 191 < b3) { + _tmp$14 = 65533; + _tmp$15 = 1; + r = _tmp$14; + size = _tmp$15; + return [r, size]; + } + _tmp$16 = ((((((p0 & 7) >>> 0) >> 0) << 18 >> 0) | ((((b1 & 63) >>> 0) >> 0) << 12 >> 0)) | ((((b2 & 63) >>> 0) >> 0) << 6 >> 0)) | (((b3 & 63) >>> 0) >> 0); + _tmp$17 = 4; + r = _tmp$16; + size = _tmp$17; + return [r, size]; + }; + $pkg.DecodeRune = DecodeRune; + DecodeRuneInString = function(s) { + var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, accept, mask, n, r, s, s0, s1, s2, s3, size, sz, x, x$1; + r = 0; + size = 0; + n = s.length; + if (n < 1) { + _tmp = 65533; + _tmp$1 = 0; + r = _tmp; + size = _tmp$1; + return [r, size]; + } + s0 = s.charCodeAt(0); + x = ((s0 < 0 || s0 >= first.length) ? $throwRuntimeError("index out of range") : first[s0]); + if (x >= 240) { + mask = ((x >> 0) << 31 >> 0) >> 31 >> 0; + _tmp$2 = (((s.charCodeAt(0) >> 0) & ~mask) >> 0) | (65533 & mask); + _tmp$3 = 1; + r = _tmp$2; + size = _tmp$3; + return [r, size]; + } + sz = (x & 7) >>> 0; + accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? $throwRuntimeError("index out of range") : acceptRanges[x$1])), acceptRange); + if (n < (sz >> 0)) { + _tmp$4 = 65533; + _tmp$5 = 1; + r = _tmp$4; + size = _tmp$5; + return [r, size]; + } + s1 = s.charCodeAt(1); + if (s1 < accept.lo || accept.hi < s1) { + _tmp$6 = 65533; + _tmp$7 = 1; + r = _tmp$6; + size = _tmp$7; + return [r, size]; + } + if (sz === 2) { + _tmp$8 = ((((s0 & 31) >>> 0) >> 0) << 6 >> 0) | (((s1 & 63) >>> 0) >> 0); + _tmp$9 = 2; + r = _tmp$8; + size = _tmp$9; + return [r, size]; + } + s2 = s.charCodeAt(2); + if (s2 < 128 || 191 < s2) { + _tmp$10 = 65533; + _tmp$11 = 1; + r = _tmp$10; + size = _tmp$11; + return [r, size]; + } + if (sz === 3) { + _tmp$12 = (((((s0 & 15) >>> 0) >> 0) << 12 >> 0) | ((((s1 & 63) >>> 0) >> 0) << 6 >> 0)) | (((s2 & 63) >>> 0) >> 0); + _tmp$13 = 3; + r = _tmp$12; + size = _tmp$13; + return [r, size]; + } + s3 = s.charCodeAt(3); + if (s3 < 128 || 191 < s3) { + _tmp$14 = 65533; + _tmp$15 = 1; + r = _tmp$14; + size = _tmp$15; + return [r, size]; + } + _tmp$16 = ((((((s0 & 7) >>> 0) >> 0) << 18 >> 0) | ((((s1 & 63) >>> 0) >> 0) << 12 >> 0)) | ((((s2 & 63) >>> 0) >> 0) << 6 >> 0)) | (((s3 & 63) >>> 0) >> 0); + _tmp$17 = 4; + r = _tmp$16; + size = _tmp$17; + return [r, size]; + }; + $pkg.DecodeRuneInString = DecodeRuneInString; + DecodeLastRune = function(p) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, end, lim, p, r, size, start; + r = 0; + size = 0; + end = p.$length; + if (end === 0) { + _tmp = 65533; + _tmp$1 = 0; + r = _tmp; + size = _tmp$1; + return [r, size]; + } + start = end - 1 >> 0; + r = (((start < 0 || start >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + start]) >> 0); + if (r < 128) { + _tmp$2 = r; + _tmp$3 = 1; + r = _tmp$2; + size = _tmp$3; + return [r, size]; + } + lim = end - 4 >> 0; + if (lim < 0) { + lim = 0; + } + start = start - (1) >> 0; + while (true) { + if (!(start >= lim)) { break; } + if (RuneStart(((start < 0 || start >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + start]))) { + break; + } + start = start - (1) >> 0; + } + if (start < 0) { + start = 0; + } + _tuple = DecodeRune($subslice(p, start, end)); + r = _tuple[0]; + size = _tuple[1]; + if (!(((start + size >> 0) === end))) { + _tmp$4 = 65533; + _tmp$5 = 1; + r = _tmp$4; + size = _tmp$5; + return [r, size]; + } + _tmp$6 = r; + _tmp$7 = size; + r = _tmp$6; + size = _tmp$7; + return [r, size]; + }; + $pkg.DecodeLastRune = DecodeLastRune; + RuneLen = function(r) { + var $ptr, r; + if (r < 0) { + return -1; + } else if (r <= 127) { + return 1; + } else if (r <= 2047) { + return 2; + } else if (55296 <= r && r <= 57343) { + return -1; + } else if (r <= 65535) { + return 3; + } else if (r <= 1114111) { + return 4; + } + return -1; + }; + $pkg.RuneLen = RuneLen; + EncodeRune = function(p, r) { + var $ptr, i, p, r; + i = (r >>> 0); + if (i <= 127) { + (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0] = (r << 24 >>> 24)); + return 1; + } else if (i <= 2047) { + (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0] = ((192 | ((r >> 6 >> 0) << 24 >>> 24)) >>> 0)); + (1 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 1] = ((128 | (((r << 24 >>> 24) & 63) >>> 0)) >>> 0)); + return 2; + } else if ((i > 1114111) || (55296 <= i && i <= 57343)) { + r = 65533; + (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0] = ((224 | ((r >> 12 >> 0) << 24 >>> 24)) >>> 0)); + (1 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 1] = ((128 | ((((r >> 6 >> 0) << 24 >>> 24) & 63) >>> 0)) >>> 0)); + (2 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 2] = ((128 | (((r << 24 >>> 24) & 63) >>> 0)) >>> 0)); + return 3; + } else if (i <= 65535) { + (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0] = ((224 | ((r >> 12 >> 0) << 24 >>> 24)) >>> 0)); + (1 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 1] = ((128 | ((((r >> 6 >> 0) << 24 >>> 24) & 63) >>> 0)) >>> 0)); + (2 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 2] = ((128 | (((r << 24 >>> 24) & 63) >>> 0)) >>> 0)); + return 3; + } else { + (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0] = ((240 | ((r >> 18 >> 0) << 24 >>> 24)) >>> 0)); + (1 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 1] = ((128 | ((((r >> 12 >> 0) << 24 >>> 24) & 63) >>> 0)) >>> 0)); + (2 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 2] = ((128 | ((((r >> 6 >> 0) << 24 >>> 24) & 63) >>> 0)) >>> 0)); + (3 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 3] = ((128 | (((r << 24 >>> 24) & 63) >>> 0)) >>> 0)); + return 4; + } + }; + $pkg.EncodeRune = EncodeRune; + RuneCount = function(p) { + var $ptr, accept, c, c$1, c$2, c$3, i, n, np, p, size, x, x$1, x$2, x$3, x$4; + np = p.$length; + n = 0; + i = 0; + while (true) { + if (!(i < np)) { break; } + n = n + (1) >> 0; + c = ((i < 0 || i >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i]); + if (c < 128) { + i = i + (1) >> 0; + continue; + } + x = ((c < 0 || c >= first.length) ? $throwRuntimeError("index out of range") : first[c]); + if (x === 241) { + i = i + (1) >> 0; + continue; + } + size = (((x & 7) >>> 0) >> 0); + if ((i + size >> 0) > np) { + i = i + (1) >> 0; + continue; + } + accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? $throwRuntimeError("index out of range") : acceptRanges[x$1])), acceptRange); + c$1 = (x$2 = i + 1 >> 0, ((x$2 < 0 || x$2 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x$2])); + if (c$1 < accept.lo || accept.hi < c$1) { + size = 1; + } else if (size === 2) { + } else { + c$2 = (x$3 = i + 2 >> 0, ((x$3 < 0 || x$3 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x$3])); + if (c$2 < 128 || 191 < c$2) { + size = 1; + } else if (size === 3) { + } else { + c$3 = (x$4 = i + 3 >> 0, ((x$4 < 0 || x$4 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x$4])); + if (c$3 < 128 || 191 < c$3) { + size = 1; + } + } + } + i = i + (size) >> 0; + } + return n; + }; + $pkg.RuneCount = RuneCount; + RuneCountInString = function(s) { + var $ptr, accept, c, c$1, c$2, c$3, i, n, ns, s, size, x, x$1; + n = 0; + ns = s.length; + i = 0; + while (true) { + if (!(i < ns)) { break; } + c = s.charCodeAt(i); + if (c < 128) { + i = i + (1) >> 0; + n = n + (1) >> 0; + continue; + } + x = ((c < 0 || c >= first.length) ? $throwRuntimeError("index out of range") : first[c]); + if (x === 241) { + i = i + (1) >> 0; + n = n + (1) >> 0; + continue; + } + size = (((x & 7) >>> 0) >> 0); + if ((i + size >> 0) > ns) { + i = i + (1) >> 0; + n = n + (1) >> 0; + continue; + } + accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? $throwRuntimeError("index out of range") : acceptRanges[x$1])), acceptRange); + c$1 = s.charCodeAt((i + 1 >> 0)); + if (c$1 < accept.lo || accept.hi < c$1) { + size = 1; + } else if (size === 2) { + } else { + c$2 = s.charCodeAt((i + 2 >> 0)); + if (c$2 < 128 || 191 < c$2) { + size = 1; + } else if (size === 3) { + } else { + c$3 = s.charCodeAt((i + 3 >> 0)); + if (c$3 < 128 || 191 < c$3) { + size = 1; + } + } + } + i = i + (size) >> 0; + n = n + (1) >> 0; + } + n = n; + return n; + }; + $pkg.RuneCountInString = RuneCountInString; + RuneStart = function(b) { + var $ptr, b; + return !((((b & 192) >>> 0) === 128)); + }; + $pkg.RuneStart = RuneStart; + acceptRange.init([{prop: "lo", name: "lo", pkg: "unicode/utf8", typ: $Uint8, tag: ""}, {prop: "hi", name: "hi", pkg: "unicode/utf8", typ: $Uint8, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + first = $toNativeArray($kindUint8, [240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 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, 19, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 35, 3, 3, 52, 4, 4, 4, 68, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241]); + acceptRanges = $toNativeArray($kindStruct, [new acceptRange.ptr(128, 191), new acceptRange.ptr(160, 191), new acceptRange.ptr(128, 159), new acceptRange.ptr(144, 191), new acceptRange.ptr(128, 143)]); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["bytes"] = (function() { + var $pkg = {}, $init, errors, io, unicode, utf8, Buffer, readOp, ptrType, sliceType, arrayType, arrayType$1, IndexByte, makeSlice, EqualFold; + errors = $packages["errors"]; + io = $packages["io"]; + unicode = $packages["unicode"]; + utf8 = $packages["unicode/utf8"]; + Buffer = $pkg.Buffer = $newType(0, $kindStruct, "bytes.Buffer", "Buffer", "bytes", function(buf_, off_, runeBytes_, bootstrap_, lastRead_) { + this.$val = this; + if (arguments.length === 0) { + this.buf = sliceType.nil; + this.off = 0; + this.runeBytes = arrayType.zero(); + this.bootstrap = arrayType$1.zero(); + this.lastRead = 0; + return; + } + this.buf = buf_; + this.off = off_; + this.runeBytes = runeBytes_; + this.bootstrap = bootstrap_; + this.lastRead = lastRead_; + }); + readOp = $pkg.readOp = $newType(4, $kindInt, "bytes.readOp", "readOp", "bytes", null); + ptrType = $ptrType(Buffer); + sliceType = $sliceType($Uint8); + arrayType = $arrayType($Uint8, 4); + arrayType$1 = $arrayType($Uint8, 64); + IndexByte = function(s, c) { + var $ptr, _i, _ref, b, c, i, s; + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + b = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (b === c) { + return i; + } + _i++; + } + return -1; + }; + $pkg.IndexByte = IndexByte; + Buffer.ptr.prototype.Bytes = function() { + var $ptr, b; + b = this; + return $subslice(b.buf, b.off); + }; + Buffer.prototype.Bytes = function() { return this.$val.Bytes(); }; + Buffer.ptr.prototype.String = function() { + var $ptr, b; + b = this; + if (b === ptrType.nil) { + return ""; + } + return $bytesToString($subslice(b.buf, b.off)); + }; + Buffer.prototype.String = function() { return this.$val.String(); }; + Buffer.ptr.prototype.Len = function() { + var $ptr, b; + b = this; + return b.buf.$length - b.off >> 0; + }; + Buffer.prototype.Len = function() { return this.$val.Len(); }; + Buffer.ptr.prototype.Cap = function() { + var $ptr, b; + b = this; + return b.buf.$capacity; + }; + Buffer.prototype.Cap = function() { return this.$val.Cap(); }; + Buffer.ptr.prototype.Truncate = function(n) { + var $ptr, b, n; + b = this; + b.lastRead = 0; + if (n < 0 || n > b.Len()) { + $panic(new $String("bytes.Buffer: truncation out of range")); + } else if ((n === 0)) { + b.off = 0; + } + b.buf = $subslice(b.buf, 0, (b.off + n >> 0)); + }; + Buffer.prototype.Truncate = function(n) { return this.$val.Truncate(n); }; + Buffer.ptr.prototype.Reset = function() { + var $ptr, b; + b = this; + b.Truncate(0); + }; + Buffer.prototype.Reset = function() { return this.$val.Reset(); }; + Buffer.ptr.prototype.grow = function(n) { + var $ptr, _q, b, buf, m, n; + b = this; + m = b.Len(); + if ((m === 0) && !((b.off === 0))) { + b.Truncate(0); + } + if ((b.buf.$length + n >> 0) > b.buf.$capacity) { + buf = sliceType.nil; + if (b.buf === sliceType.nil && n <= 64) { + buf = $subslice(new sliceType(b.bootstrap), 0); + } else if ((m + n >> 0) <= (_q = b.buf.$capacity / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))) { + $copySlice(b.buf, $subslice(b.buf, b.off)); + buf = $subslice(b.buf, 0, m); + } else { + buf = makeSlice(($imul(2, b.buf.$capacity)) + n >> 0); + $copySlice(buf, $subslice(b.buf, b.off)); + } + b.buf = buf; + b.off = 0; + } + b.buf = $subslice(b.buf, 0, ((b.off + m >> 0) + n >> 0)); + return b.off + m >> 0; + }; + Buffer.prototype.grow = function(n) { return this.$val.grow(n); }; + Buffer.ptr.prototype.Grow = function(n) { + var $ptr, b, m, n; + b = this; + if (n < 0) { + $panic(new $String("bytes.Buffer.Grow: negative count")); + } + m = b.grow(n); + b.buf = $subslice(b.buf, 0, m); + }; + Buffer.prototype.Grow = function(n) { return this.$val.Grow(n); }; + Buffer.ptr.prototype.Write = function(p) { + var $ptr, _tmp, _tmp$1, b, err, m, n, p; + n = 0; + err = $ifaceNil; + b = this; + b.lastRead = 0; + m = b.grow(p.$length); + _tmp = $copySlice($subslice(b.buf, m), p); + _tmp$1 = $ifaceNil; + n = _tmp; + err = _tmp$1; + return [n, err]; + }; + Buffer.prototype.Write = function(p) { return this.$val.Write(p); }; + Buffer.ptr.prototype.WriteString = function(s) { + var $ptr, _tmp, _tmp$1, b, err, m, n, s; + n = 0; + err = $ifaceNil; + b = this; + b.lastRead = 0; + m = b.grow(s.length); + _tmp = $copyString($subslice(b.buf, m), s); + _tmp$1 = $ifaceNil; + n = _tmp; + err = _tmp$1; + return [n, err]; + }; + Buffer.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; + Buffer.ptr.prototype.ReadFrom = function(r) { + var $ptr, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, free, m, n, newBuf, r, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; free = $f.free; m = $f.m; n = $f.n; newBuf = $f.newBuf; r = $f.r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = new $Int64(0, 0); + err = $ifaceNil; + b = this; + b.lastRead = 0; + if (b.off >= b.buf.$length) { + b.Truncate(0); + } + /* while (true) { */ case 1: + free = b.buf.$capacity - b.buf.$length >> 0; + if (free < 512) { + newBuf = b.buf; + if ((b.off + free >> 0) < 512) { + newBuf = makeSlice(($imul(2, b.buf.$capacity)) + 512 >> 0); + } + $copySlice(newBuf, $subslice(b.buf, b.off)); + b.buf = $subslice(newBuf, 0, (b.buf.$length - b.off >> 0)); + b.off = 0; + } + _r = r.Read($subslice(b.buf, b.buf.$length, b.buf.$capacity)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + m = _tuple[0]; + e = _tuple[1]; + b.buf = $subslice(b.buf, 0, (b.buf.$length + m >> 0)); + n = (x = new $Int64(0, m), new $Int64(n.$high + x.$high, n.$low + x.$low)); + if ($interfaceIsEqual(e, io.EOF)) { + /* break; */ $s = 2; continue; + } + if (!($interfaceIsEqual(e, $ifaceNil))) { + _tmp = n; + _tmp$1 = e; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + /* } */ $s = 1; continue; case 2: + _tmp$2 = n; + _tmp$3 = $ifaceNil; + n = _tmp$2; + err = _tmp$3; + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.ReadFrom }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.free = free; $f.m = m; $f.n = n; $f.newBuf = newBuf; $f.r = r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Buffer.prototype.ReadFrom = function(r) { return this.$val.ReadFrom(r); }; + makeSlice = function(n) { + var $ptr, n, $deferred; + /* */ var $err = null; try { $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + $deferred.push([(function() { + var $ptr; + if (!($interfaceIsEqual($recover(), $ifaceNil))) { + $panic($pkg.ErrTooLarge); + } + }), []]); + return $makeSlice(sliceType, n); + /* */ } catch(err) { $err = err; return sliceType.nil; } finally { $callDeferred($deferred, $err); } + }; + Buffer.ptr.prototype.WriteTo = function(w) { + var $ptr, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, m, n, nBytes, w, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; n = $f.n; nBytes = $f.nBytes; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = new $Int64(0, 0); + err = $ifaceNil; + b = this; + b.lastRead = 0; + /* */ if (b.off < b.buf.$length) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (b.off < b.buf.$length) { */ case 1: + nBytes = b.Len(); + _r = w.Write($subslice(b.buf, b.off)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + m = _tuple[0]; + e = _tuple[1]; + if (m > nBytes) { + $panic(new $String("bytes.Buffer.WriteTo: invalid Write count")); + } + b.off = b.off + (m) >> 0; + n = new $Int64(0, m); + if (!($interfaceIsEqual(e, $ifaceNil))) { + _tmp = n; + _tmp$1 = e; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + if (!((m === nBytes))) { + _tmp$2 = n; + _tmp$3 = io.ErrShortWrite; + n = _tmp$2; + err = _tmp$3; + return [n, err]; + } + /* } */ case 2: + b.Truncate(0); + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.WriteTo }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.n = n; $f.nBytes = nBytes; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; + }; + Buffer.prototype.WriteTo = function(w) { return this.$val.WriteTo(w); }; + Buffer.ptr.prototype.WriteByte = function(c) { + var $ptr, b, c, m, x; + b = this; + b.lastRead = 0; + m = b.grow(1); + (x = b.buf, ((m < 0 || m >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + m] = c)); + return $ifaceNil; + }; + Buffer.prototype.WriteByte = function(c) { return this.$val.WriteByte(c); }; + Buffer.ptr.prototype.WriteRune = function(r) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, b, err, n, r; + n = 0; + err = $ifaceNil; + b = this; + if (r < 128) { + b.WriteByte((r << 24 >>> 24)); + _tmp = 1; + _tmp$1 = $ifaceNil; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + n = utf8.EncodeRune($subslice(new sliceType(b.runeBytes), 0), r); + b.Write($subslice(new sliceType(b.runeBytes), 0, n)); + _tmp$2 = n; + _tmp$3 = $ifaceNil; + n = _tmp$2; + err = _tmp$3; + return [n, err]; + }; + Buffer.prototype.WriteRune = function(r) { return this.$val.WriteRune(r); }; + Buffer.ptr.prototype.Read = function(p) { + var $ptr, _tmp, _tmp$1, b, err, n, p; + n = 0; + err = $ifaceNil; + b = this; + b.lastRead = 0; + if (b.off >= b.buf.$length) { + b.Truncate(0); + if (p.$length === 0) { + return [n, err]; + } + _tmp = 0; + _tmp$1 = io.EOF; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + n = $copySlice(p, $subslice(b.buf, b.off)); + b.off = b.off + (n) >> 0; + if (n > 0) { + b.lastRead = 2; + } + return [n, err]; + }; + Buffer.prototype.Read = function(p) { return this.$val.Read(p); }; + Buffer.ptr.prototype.Next = function(n) { + var $ptr, b, data, m, n; + b = this; + b.lastRead = 0; + m = b.Len(); + if (n > m) { + n = m; + } + data = $subslice(b.buf, b.off, (b.off + n >> 0)); + b.off = b.off + (n) >> 0; + if (n > 0) { + b.lastRead = 2; + } + return data; + }; + Buffer.prototype.Next = function(n) { return this.$val.Next(n); }; + Buffer.ptr.prototype.ReadByte = function() { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, b, c, err, x, x$1; + c = 0; + err = $ifaceNil; + b = this; + b.lastRead = 0; + if (b.off >= b.buf.$length) { + b.Truncate(0); + _tmp = 0; + _tmp$1 = io.EOF; + c = _tmp; + err = _tmp$1; + return [c, err]; + } + c = (x = b.buf, x$1 = b.off, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); + b.off = b.off + (1) >> 0; + b.lastRead = 2; + _tmp$2 = c; + _tmp$3 = $ifaceNil; + c = _tmp$2; + err = _tmp$3; + return [c, err]; + }; + Buffer.prototype.ReadByte = function() { return this.$val.ReadByte(); }; + Buffer.ptr.prototype.ReadRune = function() { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tuple, b, c, err, n, r, size, x, x$1; + r = 0; + size = 0; + err = $ifaceNil; + b = this; + b.lastRead = 0; + if (b.off >= b.buf.$length) { + b.Truncate(0); + _tmp = 0; + _tmp$1 = 0; + _tmp$2 = io.EOF; + r = _tmp; + size = _tmp$1; + err = _tmp$2; + return [r, size, err]; + } + b.lastRead = 1; + c = (x = b.buf, x$1 = b.off, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); + if (c < 128) { + b.off = b.off + (1) >> 0; + _tmp$3 = (c >> 0); + _tmp$4 = 1; + _tmp$5 = $ifaceNil; + r = _tmp$3; + size = _tmp$4; + err = _tmp$5; + return [r, size, err]; + } + _tuple = utf8.DecodeRune($subslice(b.buf, b.off)); + r = _tuple[0]; + n = _tuple[1]; + b.off = b.off + (n) >> 0; + _tmp$6 = r; + _tmp$7 = n; + _tmp$8 = $ifaceNil; + r = _tmp$6; + size = _tmp$7; + err = _tmp$8; + return [r, size, err]; + }; + Buffer.prototype.ReadRune = function() { return this.$val.ReadRune(); }; + Buffer.ptr.prototype.UnreadRune = function() { + var $ptr, _tuple, b, n; + b = this; + if (!((b.lastRead === 1))) { + return errors.New("bytes.Buffer: UnreadRune: previous operation was not ReadRune"); + } + b.lastRead = 0; + if (b.off > 0) { + _tuple = utf8.DecodeLastRune($subslice(b.buf, 0, b.off)); + n = _tuple[1]; + b.off = b.off - (n) >> 0; + } + return $ifaceNil; + }; + Buffer.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; + Buffer.ptr.prototype.UnreadByte = function() { + var $ptr, b; + b = this; + if (!((b.lastRead === 1)) && !((b.lastRead === 2))) { + return errors.New("bytes.Buffer: UnreadByte: previous operation was not a read"); + } + b.lastRead = 0; + if (b.off > 0) { + b.off = b.off - (1) >> 0; + } + return $ifaceNil; + }; + Buffer.prototype.UnreadByte = function() { return this.$val.UnreadByte(); }; + Buffer.ptr.prototype.ReadBytes = function(delim) { + var $ptr, _tuple, b, delim, err, line, slice; + line = sliceType.nil; + err = $ifaceNil; + b = this; + _tuple = b.readSlice(delim); + slice = _tuple[0]; + err = _tuple[1]; + line = $appendSlice(line, slice); + return [line, err]; + }; + Buffer.prototype.ReadBytes = function(delim) { return this.$val.ReadBytes(delim); }; + Buffer.ptr.prototype.readSlice = function(delim) { + var $ptr, _tmp, _tmp$1, b, delim, end, err, i, line; + line = sliceType.nil; + err = $ifaceNil; + b = this; + i = IndexByte($subslice(b.buf, b.off), delim); + end = (b.off + i >> 0) + 1 >> 0; + if (i < 0) { + end = b.buf.$length; + err = io.EOF; + } + line = $subslice(b.buf, b.off, end); + b.off = end; + b.lastRead = 2; + _tmp = line; + _tmp$1 = err; + line = _tmp; + err = _tmp$1; + return [line, err]; + }; + Buffer.prototype.readSlice = function(delim) { return this.$val.readSlice(delim); }; + Buffer.ptr.prototype.ReadString = function(delim) { + var $ptr, _tmp, _tmp$1, _tuple, b, delim, err, line, slice; + line = ""; + err = $ifaceNil; + b = this; + _tuple = b.readSlice(delim); + slice = _tuple[0]; + err = _tuple[1]; + _tmp = $bytesToString(slice); + _tmp$1 = err; + line = _tmp; + err = _tmp$1; + return [line, err]; + }; + Buffer.prototype.ReadString = function(delim) { return this.$val.ReadString(delim); }; + EqualFold = function(s, t) { + var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, r, r$1, r$2, s, size, size$1, sr, t, tr; + while (true) { + if (!(!((s.$length === 0)) && !((t.$length === 0)))) { break; } + _tmp = 0; + _tmp$1 = 0; + sr = _tmp; + tr = _tmp$1; + if ((0 >= s.$length ? $throwRuntimeError("index out of range") : s.$array[s.$offset + 0]) < 128) { + _tmp$2 = ((0 >= s.$length ? $throwRuntimeError("index out of range") : s.$array[s.$offset + 0]) >> 0); + _tmp$3 = $subslice(s, 1); + sr = _tmp$2; + s = _tmp$3; + } else { + _tuple = utf8.DecodeRune(s); + r = _tuple[0]; + size = _tuple[1]; + _tmp$4 = r; + _tmp$5 = $subslice(s, size); + sr = _tmp$4; + s = _tmp$5; + } + if ((0 >= t.$length ? $throwRuntimeError("index out of range") : t.$array[t.$offset + 0]) < 128) { + _tmp$6 = ((0 >= t.$length ? $throwRuntimeError("index out of range") : t.$array[t.$offset + 0]) >> 0); + _tmp$7 = $subslice(t, 1); + tr = _tmp$6; + t = _tmp$7; + } else { + _tuple$1 = utf8.DecodeRune(t); + r$1 = _tuple$1[0]; + size$1 = _tuple$1[1]; + _tmp$8 = r$1; + _tmp$9 = $subslice(t, size$1); + tr = _tmp$8; + t = _tmp$9; + } + if (tr === sr) { + continue; + } + if (tr < sr) { + _tmp$10 = sr; + _tmp$11 = tr; + tr = _tmp$10; + sr = _tmp$11; + } + if (tr < 128 && 65 <= sr && sr <= 90) { + if (tr === ((sr + 97 >> 0) - 65 >> 0)) { + continue; + } + return false; + } + r$2 = unicode.SimpleFold(sr); + while (true) { + if (!(!((r$2 === sr)) && r$2 < tr)) { break; } + r$2 = unicode.SimpleFold(r$2); + } + if (r$2 === tr) { + continue; + } + return false; + } + return s.$length === t.$length; + }; + $pkg.EqualFold = EqualFold; + ptrType.methods = [{prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "grow", name: "grow", pkg: "bytes", typ: $funcType([$Int], [$Int], false)}, {prop: "Grow", name: "Grow", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([io.Reader], [$Int64, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([io.Writer], [$Int64, $error], false)}, {prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [$error], false)}, {prop: "WriteRune", name: "WriteRune", pkg: "", typ: $funcType([$Int32], [$Int, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([$Int], [sliceType], false)}, {prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}, {prop: "ReadBytes", name: "ReadBytes", pkg: "", typ: $funcType([$Uint8], [sliceType, $error], false)}, {prop: "readSlice", name: "readSlice", pkg: "bytes", typ: $funcType([$Uint8], [sliceType, $error], false)}, {prop: "ReadString", name: "ReadString", pkg: "", typ: $funcType([$Uint8], [$String, $error], false)}]; + Buffer.init([{prop: "buf", name: "buf", pkg: "bytes", typ: sliceType, tag: ""}, {prop: "off", name: "off", pkg: "bytes", typ: $Int, tag: ""}, {prop: "runeBytes", name: "runeBytes", pkg: "bytes", typ: arrayType, tag: ""}, {prop: "bootstrap", name: "bootstrap", pkg: "bytes", typ: arrayType$1, tag: ""}, {prop: "lastRead", name: "lastRead", pkg: "bytes", typ: readOp, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = unicode.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf8.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.ErrTooLarge = errors.New("bytes.Buffer: too large"); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["math"] = (function() { + var $pkg = {}, $init, js, arrayType, arrayType$1, arrayType$2, structType, arrayType$3, math, zero, posInf, negInf, nan, buf, pow10tab, Exp, Frexp, Inf, IsInf, IsNaN, Log, Log2, NaN, init, Float32bits, Float32frombits, Float64bits, Float64frombits, Abs, normalize, frexp, log2, init$1; + js = $packages["github.com/gopherjs/gopherjs/js"]; + arrayType = $arrayType($Uint32, 2); + arrayType$1 = $arrayType($Float32, 2); + arrayType$2 = $arrayType($Float64, 1); + structType = $structType([{prop: "uint32array", name: "uint32array", pkg: "math", typ: arrayType, tag: ""}, {prop: "float32array", name: "float32array", pkg: "math", typ: arrayType$1, tag: ""}, {prop: "float64array", name: "float64array", pkg: "math", typ: arrayType$2, tag: ""}]); + arrayType$3 = $arrayType($Float64, 70); + Exp = function(x) { + var $ptr, x; + return $parseFloat(math.exp(x)); + }; + $pkg.Exp = Exp; + Frexp = function(f) { + var $ptr, _tuple, exp$1, f, frac; + frac = 0; + exp$1 = 0; + _tuple = frexp(f); + frac = _tuple[0]; + exp$1 = _tuple[1]; + return [frac, exp$1]; + }; + $pkg.Frexp = Frexp; + Inf = function(sign) { + var $ptr, sign; + if (sign >= 0) { + return posInf; + } else { + return negInf; + } + }; + $pkg.Inf = Inf; + IsInf = function(f, sign) { + var $ptr, f, sign; + if (f === posInf) { + return sign >= 0; + } + if (f === negInf) { + return sign <= 0; + } + return false; + }; + $pkg.IsInf = IsInf; + IsNaN = function(f) { + var $ptr, f, is; + is = false; + is = !((f === f)); + return is; + }; + $pkg.IsNaN = IsNaN; + Log = function(x) { + var $ptr, x; + if (!((x === x))) { + return nan; + } + return $parseFloat(math.log(x)); + }; + $pkg.Log = Log; + Log2 = function(x) { + var $ptr, x; + return log2(x); + }; + $pkg.Log2 = Log2; + NaN = function() { + var $ptr; + return nan; + }; + $pkg.NaN = NaN; + init = function() { + var $ptr, ab; + ab = new ($global.ArrayBuffer)(8); + buf.uint32array = new ($global.Uint32Array)(ab); + buf.float32array = new ($global.Float32Array)(ab); + buf.float64array = new ($global.Float64Array)(ab); + }; + Float32bits = function(f) { + var $ptr, f; + buf.float32array[0] = f; + return buf.uint32array[0]; + }; + $pkg.Float32bits = Float32bits; + Float32frombits = function(b) { + var $ptr, b; + buf.uint32array[0] = b; + return buf.float32array[0]; + }; + $pkg.Float32frombits = Float32frombits; + Float64bits = function(f) { + var $ptr, f, x, x$1; + buf.float64array[0] = f; + return (x = $shiftLeft64(new $Uint64(0, buf.uint32array[1]), 32), x$1 = new $Uint64(0, buf.uint32array[0]), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); + }; + $pkg.Float64bits = Float64bits; + Float64frombits = function(b) { + var $ptr, b; + buf.uint32array[0] = (b.$low >>> 0); + buf.uint32array[1] = ($shiftRightUint64(b, 32).$low >>> 0); + return buf.float64array[0]; + }; + $pkg.Float64frombits = Float64frombits; + Abs = function(x) { + var $ptr, x; + if (x < 0) { + return -x; + } + if (x === 0) { + return 0; + } + return x; + }; + $pkg.Abs = Abs; + normalize = function(x) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, exp$1, x, y; + y = 0; + exp$1 = 0; + if (Abs(x) < 2.2250738585072014e-308) { + _tmp = x * 4.503599627370496e+15; + _tmp$1 = -52; + y = _tmp; + exp$1 = _tmp$1; + return [y, exp$1]; + } + _tmp$2 = x; + _tmp$3 = 0; + y = _tmp$2; + exp$1 = _tmp$3; + return [y, exp$1]; + }; + frexp = function(f) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, exp$1, f, frac, x, x$1, x$2, x$3; + frac = 0; + exp$1 = 0; + if ((f === 0)) { + _tmp = f; + _tmp$1 = 0; + frac = _tmp; + exp$1 = _tmp$1; + return [frac, exp$1]; + } else if (IsInf(f, 0) || IsNaN(f)) { + _tmp$2 = f; + _tmp$3 = 0; + frac = _tmp$2; + exp$1 = _tmp$3; + return [frac, exp$1]; + } + _tuple = normalize(f); + f = _tuple[0]; + exp$1 = _tuple[1]; + x = Float64bits(f); + exp$1 = exp$1 + (((((x$1 = $shiftRightUint64(x, 52), new $Uint64(x$1.$high & 0, (x$1.$low & 2047) >>> 0)).$low >> 0) - 1023 >> 0) + 1 >> 0)) >> 0; + x = (x$2 = new $Uint64(2146435072, 0), new $Uint64(x.$high & ~x$2.$high, (x.$low & ~x$2.$low) >>> 0)); + x = (x$3 = new $Uint64(1071644672, 0), new $Uint64(x.$high | x$3.$high, (x.$low | x$3.$low) >>> 0)); + frac = Float64frombits(x); + return [frac, exp$1]; + }; + log2 = function(x) { + var $ptr, _tuple, exp$1, frac, x; + _tuple = Frexp(x); + frac = _tuple[0]; + exp$1 = _tuple[1]; + if (frac === 0.5) { + return (exp$1 - 1 >> 0); + } + return Log(frac) * 1.4426950408889634 + exp$1; + }; + init$1 = function() { + var $ptr, _q, i, m, x; + pow10tab[0] = 1; + pow10tab[1] = 10; + i = 2; + while (true) { + if (!(i < 70)) { break; } + m = (_q = i / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + ((i < 0 || i >= pow10tab.length) ? $throwRuntimeError("index out of range") : pow10tab[i] = ((m < 0 || m >= pow10tab.length) ? $throwRuntimeError("index out of range") : pow10tab[m]) * (x = i - m >> 0, ((x < 0 || x >= pow10tab.length) ? $throwRuntimeError("index out of range") : pow10tab[x]))); + i = i + (1) >> 0; + } + }; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + buf = new structType.ptr(arrayType.zero(), arrayType$1.zero(), arrayType$2.zero()); + pow10tab = arrayType$3.zero(); + math = $global.Math; + zero = 0; + posInf = 1 / zero; + negInf = -1 / zero; + nan = 0 / zero; + init(); + init$1(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["strconv"] = (function() { + var $pkg = {}, $init, errors, math, utf8, NumError, decimal, leftCheat, extFloat, floatInfo, decimalSlice, sliceType, sliceType$1, sliceType$2, sliceType$3, sliceType$4, sliceType$5, arrayType, ptrType, sliceType$6, arrayType$1, arrayType$2, ptrType$1, arrayType$3, arrayType$4, ptrType$2, ptrType$3, ptrType$4, optimize, powtab, float64pow10, float32pow10, leftcheats, smallPowersOfTen, powersOfTen, uint64pow10, float32info, float32info$24ptr, float64info, float64info$24ptr, isPrint16, isNotPrint16, isPrint32, isNotPrint32, isGraphic, shifts, ParseBool, equalIgnoreCase, special, readFloat, atof64exact, atof32exact, atof32, atof64, ParseFloat, syntaxError, rangeError, ParseUint, ParseInt, digitZero, trim, rightShift, prefixIsLessThan, leftShift, shouldRoundUp, frexp10Many, adjustLastDigitFixed, adjustLastDigit, FormatFloat, AppendFloat, genericFtoa, bigFtoa, formatDigits, roundShortest, fmtE, fmtF, fmtB, min, max, FormatInt, Itoa, AppendInt, AppendUint, formatBits, quoteWith, Quote, QuoteToASCII, QuoteRune, AppendQuoteRune, QuoteRuneToASCII, AppendQuoteRuneToASCII, CanBackquote, unhex, UnquoteChar, Unquote, contains, bsearch16, bsearch32, IsPrint, isInGraphicList; + errors = $packages["errors"]; + math = $packages["math"]; + utf8 = $packages["unicode/utf8"]; + NumError = $pkg.NumError = $newType(0, $kindStruct, "strconv.NumError", "NumError", "strconv", function(Func_, Num_, Err_) { + this.$val = this; + if (arguments.length === 0) { + this.Func = ""; + this.Num = ""; + this.Err = $ifaceNil; + return; + } + this.Func = Func_; + this.Num = Num_; + this.Err = Err_; + }); + decimal = $pkg.decimal = $newType(0, $kindStruct, "strconv.decimal", "decimal", "strconv", function(d_, nd_, dp_, neg_, trunc_) { + this.$val = this; + if (arguments.length === 0) { + this.d = arrayType.zero(); + this.nd = 0; + this.dp = 0; + this.neg = false; + this.trunc = false; + return; + } + this.d = d_; + this.nd = nd_; + this.dp = dp_; + this.neg = neg_; + this.trunc = trunc_; + }); + leftCheat = $pkg.leftCheat = $newType(0, $kindStruct, "strconv.leftCheat", "leftCheat", "strconv", function(delta_, cutoff_) { + this.$val = this; + if (arguments.length === 0) { + this.delta = 0; + this.cutoff = ""; + return; + } + this.delta = delta_; + this.cutoff = cutoff_; + }); + extFloat = $pkg.extFloat = $newType(0, $kindStruct, "strconv.extFloat", "extFloat", "strconv", function(mant_, exp_, neg_) { + this.$val = this; + if (arguments.length === 0) { + this.mant = new $Uint64(0, 0); + this.exp = 0; + this.neg = false; + return; + } + this.mant = mant_; + this.exp = exp_; + this.neg = neg_; + }); + floatInfo = $pkg.floatInfo = $newType(0, $kindStruct, "strconv.floatInfo", "floatInfo", "strconv", function(mantbits_, expbits_, bias_) { + this.$val = this; + if (arguments.length === 0) { + this.mantbits = 0; + this.expbits = 0; + this.bias = 0; + return; + } + this.mantbits = mantbits_; + this.expbits = expbits_; + this.bias = bias_; + }); + decimalSlice = $pkg.decimalSlice = $newType(0, $kindStruct, "strconv.decimalSlice", "decimalSlice", "strconv", function(d_, nd_, dp_, neg_) { + this.$val = this; + if (arguments.length === 0) { + this.d = sliceType$6.nil; + this.nd = 0; + this.dp = 0; + this.neg = false; + return; + } + this.d = d_; + this.nd = nd_; + this.dp = dp_; + this.neg = neg_; + }); + sliceType = $sliceType($Int); + sliceType$1 = $sliceType($Float64); + sliceType$2 = $sliceType($Float32); + sliceType$3 = $sliceType(leftCheat); + sliceType$4 = $sliceType($Uint16); + sliceType$5 = $sliceType($Uint32); + arrayType = $arrayType($Uint8, 800); + ptrType = $ptrType(NumError); + sliceType$6 = $sliceType($Uint8); + arrayType$1 = $arrayType($Uint8, 24); + arrayType$2 = $arrayType($Uint8, 32); + ptrType$1 = $ptrType(floatInfo); + arrayType$3 = $arrayType($Uint8, 65); + arrayType$4 = $arrayType($Uint8, 4); + ptrType$2 = $ptrType(decimal); + ptrType$3 = $ptrType(decimalSlice); + ptrType$4 = $ptrType(extFloat); + ParseBool = function(str) { + var $ptr, _1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, err, str, value; + value = false; + err = $ifaceNil; + _1 = str; + if (_1 === ("1") || _1 === ("t") || _1 === ("T") || _1 === ("true") || _1 === ("TRUE") || _1 === ("True")) { + _tmp = true; + _tmp$1 = $ifaceNil; + value = _tmp; + err = _tmp$1; + return [value, err]; + } else if (_1 === ("0") || _1 === ("f") || _1 === ("F") || _1 === ("false") || _1 === ("FALSE") || _1 === ("False")) { + _tmp$2 = false; + _tmp$3 = $ifaceNil; + value = _tmp$2; + err = _tmp$3; + return [value, err]; + } + _tmp$4 = false; + _tmp$5 = syntaxError("ParseBool", str); + value = _tmp$4; + err = _tmp$5; + return [value, err]; + }; + $pkg.ParseBool = ParseBool; + equalIgnoreCase = function(s1, s2) { + var $ptr, c1, c2, i, s1, s2; + if (!((s1.length === s2.length))) { + return false; + } + i = 0; + while (true) { + if (!(i < s1.length)) { break; } + c1 = s1.charCodeAt(i); + if (65 <= c1 && c1 <= 90) { + c1 = c1 + (32) << 24 >>> 24; + } + c2 = s2.charCodeAt(i); + if (65 <= c2 && c2 <= 90) { + c2 = c2 + (32) << 24 >>> 24; + } + if (!((c1 === c2))) { + return false; + } + i = i + (1) >> 0; + } + return true; + }; + special = function(s) { + var $ptr, _1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, f, ok, s; + f = 0; + ok = false; + if (s.length === 0) { + return [f, ok]; + } + _1 = s.charCodeAt(0); + if (_1 === (43)) { + if (equalIgnoreCase(s, "+inf") || equalIgnoreCase(s, "+infinity")) { + _tmp = math.Inf(1); + _tmp$1 = true; + f = _tmp; + ok = _tmp$1; + return [f, ok]; + } + } else if (_1 === (45)) { + if (equalIgnoreCase(s, "-inf") || equalIgnoreCase(s, "-infinity")) { + _tmp$2 = math.Inf(-1); + _tmp$3 = true; + f = _tmp$2; + ok = _tmp$3; + return [f, ok]; + } + } else if ((_1 === (110)) || (_1 === (78))) { + if (equalIgnoreCase(s, "nan")) { + _tmp$4 = math.NaN(); + _tmp$5 = true; + f = _tmp$4; + ok = _tmp$5; + return [f, ok]; + } + } else if ((_1 === (105)) || (_1 === (73))) { + if (equalIgnoreCase(s, "inf") || equalIgnoreCase(s, "infinity")) { + _tmp$6 = math.Inf(1); + _tmp$7 = true; + f = _tmp$6; + ok = _tmp$7; + return [f, ok]; + } + } else { + return [f, ok]; + } + return [f, ok]; + }; + decimal.ptr.prototype.set = function(s) { + var $ptr, b, e, esign, i, ok, s, sawdigits, sawdot, x, x$1; + ok = false; + b = this; + i = 0; + b.neg = false; + b.trunc = false; + if (i >= s.length) { + return ok; + } + if ((s.charCodeAt(i) === 43)) { + i = i + (1) >> 0; + } else if ((s.charCodeAt(i) === 45)) { + b.neg = true; + i = i + (1) >> 0; + } + sawdot = false; + sawdigits = false; + while (true) { + if (!(i < s.length)) { break; } + if ((s.charCodeAt(i) === 46)) { + if (sawdot) { + return ok; + } + sawdot = true; + b.dp = b.nd; + i = i + (1) >> 0; + continue; + } else if (48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57) { + sawdigits = true; + if ((s.charCodeAt(i) === 48) && (b.nd === 0)) { + b.dp = b.dp - (1) >> 0; + i = i + (1) >> 0; + continue; + } + if (b.nd < 800) { + (x = b.d, x$1 = b.nd, ((x$1 < 0 || x$1 >= x.length) ? $throwRuntimeError("index out of range") : x[x$1] = s.charCodeAt(i))); + b.nd = b.nd + (1) >> 0; + } else if (!((s.charCodeAt(i) === 48))) { + b.trunc = true; + } + i = i + (1) >> 0; + continue; + } + break; + } + if (!sawdigits) { + return ok; + } + if (!sawdot) { + b.dp = b.nd; + } + if (i < s.length && ((s.charCodeAt(i) === 101) || (s.charCodeAt(i) === 69))) { + i = i + (1) >> 0; + if (i >= s.length) { + return ok; + } + esign = 1; + if (s.charCodeAt(i) === 43) { + i = i + (1) >> 0; + } else if (s.charCodeAt(i) === 45) { + i = i + (1) >> 0; + esign = -1; + } + if (i >= s.length || s.charCodeAt(i) < 48 || s.charCodeAt(i) > 57) { + return ok; + } + e = 0; + while (true) { + if (!(i < s.length && 48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57)) { break; } + if (e < 10000) { + e = (($imul(e, 10)) + (s.charCodeAt(i) >> 0) >> 0) - 48 >> 0; + } + i = i + (1) >> 0; + } + b.dp = b.dp + (($imul(e, esign))) >> 0; + } + if (!((i === s.length))) { + return ok; + } + ok = true; + return ok; + }; + decimal.prototype.set = function(s) { return this.$val.set(s); }; + readFloat = function(s) { + var $ptr, _2, c, dp, e, esign, exp, i, mantissa, nd, ndMant, neg, ok, s, sawdigits, sawdot, trunc, x; + mantissa = new $Uint64(0, 0); + exp = 0; + neg = false; + trunc = false; + ok = false; + i = 0; + if (i >= s.length) { + return [mantissa, exp, neg, trunc, ok]; + } + if ((s.charCodeAt(i) === 43)) { + i = i + (1) >> 0; + } else if ((s.charCodeAt(i) === 45)) { + neg = true; + i = i + (1) >> 0; + } + sawdot = false; + sawdigits = false; + nd = 0; + ndMant = 0; + dp = 0; + while (true) { + if (!(i < s.length)) { break; } + c = s.charCodeAt(i); + _2 = true; + if (_2 === ((c === 46))) { + if (sawdot) { + return [mantissa, exp, neg, trunc, ok]; + } + sawdot = true; + dp = nd; + i = i + (1) >> 0; + continue; + } else if (_2 === (48 <= c && c <= 57)) { + sawdigits = true; + if ((c === 48) && (nd === 0)) { + dp = dp - (1) >> 0; + i = i + (1) >> 0; + continue; + } + nd = nd + (1) >> 0; + if (ndMant < 19) { + mantissa = $mul64(mantissa, (new $Uint64(0, 10))); + mantissa = (x = new $Uint64(0, (c - 48 << 24 >>> 24)), new $Uint64(mantissa.$high + x.$high, mantissa.$low + x.$low)); + ndMant = ndMant + (1) >> 0; + } else if (!((s.charCodeAt(i) === 48))) { + trunc = true; + } + i = i + (1) >> 0; + continue; + } + break; + } + if (!sawdigits) { + return [mantissa, exp, neg, trunc, ok]; + } + if (!sawdot) { + dp = nd; + } + if (i < s.length && ((s.charCodeAt(i) === 101) || (s.charCodeAt(i) === 69))) { + i = i + (1) >> 0; + if (i >= s.length) { + return [mantissa, exp, neg, trunc, ok]; + } + esign = 1; + if (s.charCodeAt(i) === 43) { + i = i + (1) >> 0; + } else if (s.charCodeAt(i) === 45) { + i = i + (1) >> 0; + esign = -1; + } + if (i >= s.length || s.charCodeAt(i) < 48 || s.charCodeAt(i) > 57) { + return [mantissa, exp, neg, trunc, ok]; + } + e = 0; + while (true) { + if (!(i < s.length && 48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57)) { break; } + if (e < 10000) { + e = (($imul(e, 10)) + (s.charCodeAt(i) >> 0) >> 0) - 48 >> 0; + } + i = i + (1) >> 0; + } + dp = dp + (($imul(e, esign))) >> 0; + } + if (!((i === s.length))) { + return [mantissa, exp, neg, trunc, ok]; + } + exp = dp - ndMant >> 0; + ok = true; + return [mantissa, exp, neg, trunc, ok]; + }; + decimal.ptr.prototype.floatBits = function(flt) { + var $ptr, _tmp, _tmp$1, b, bits, d, exp, flt, mant, n, n$1, n$2, overflow, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, y, y$1, y$2, y$3, $s; + /* */ $s = 0; s: while (true) { switch ($s) { case 0: + b = new $Uint64(0, 0); + overflow = false; + d = this; + exp = 0; + mant = new $Uint64(0, 0); + /* */ if (d.nd === 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (d.nd === 0) { */ case 1: + mant = new $Uint64(0, 0); + exp = flt.bias; + /* goto out */ $s = 3; continue; + /* } */ case 2: + /* */ if (d.dp > 310) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (d.dp > 310) { */ case 4: + /* goto overflow */ $s = 6; continue; + /* } */ case 5: + /* */ if (d.dp < -330) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (d.dp < -330) { */ case 7: + mant = new $Uint64(0, 0); + exp = flt.bias; + /* goto out */ $s = 3; continue; + /* } */ case 8: + exp = 0; + while (true) { + if (!(d.dp > 0)) { break; } + n = 0; + if (d.dp >= powtab.$length) { + n = 27; + } else { + n = (x = d.dp, ((x < 0 || x >= powtab.$length) ? $throwRuntimeError("index out of range") : powtab.$array[powtab.$offset + x])); + } + d.Shift(-n); + exp = exp + (n) >> 0; + } + while (true) { + if (!(d.dp < 0 || (d.dp === 0) && d.d[0] < 53)) { break; } + n$1 = 0; + if (-d.dp >= powtab.$length) { + n$1 = 27; + } else { + n$1 = (x$1 = -d.dp, ((x$1 < 0 || x$1 >= powtab.$length) ? $throwRuntimeError("index out of range") : powtab.$array[powtab.$offset + x$1])); + } + d.Shift(n$1); + exp = exp - (n$1) >> 0; + } + exp = exp - (1) >> 0; + if (exp < (flt.bias + 1 >> 0)) { + n$2 = (flt.bias + 1 >> 0) - exp >> 0; + d.Shift(-n$2); + exp = exp + (n$2) >> 0; + } + /* */ if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) { */ case 9: + /* goto overflow */ $s = 6; continue; + /* } */ case 10: + d.Shift(((1 + flt.mantbits >>> 0) >> 0)); + mant = d.RoundedInteger(); + /* */ if ((x$2 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) { $s = 11; continue; } + /* */ $s = 12; continue; + /* if ((x$2 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) { */ case 11: + mant = $shiftRightUint64(mant, (1)); + exp = exp + (1) >> 0; + /* */ if ((exp - flt.bias >> 0) >= (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0)) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if ((exp - flt.bias >> 0) >= (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0)) { */ case 13: + /* goto overflow */ $s = 6; continue; + /* } */ case 14: + /* } */ case 12: + if ((x$3 = (x$4 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high & x$4.$high, (mant.$low & x$4.$low) >>> 0)), (x$3.$high === 0 && x$3.$low === 0))) { + exp = flt.bias; + } + /* goto out */ $s = 3; continue; + /* overflow: */ case 6: + mant = new $Uint64(0, 0); + exp = (((y$2 = flt.expbits, y$2 < 32 ? (1 << y$2) : 0) >> 0) - 1 >> 0) + flt.bias >> 0; + overflow = true; + /* out: */ case 3: + bits = (x$5 = (x$6 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$6.$high - 0, x$6.$low - 1)), new $Uint64(mant.$high & x$5.$high, (mant.$low & x$5.$low) >>> 0)); + bits = (x$7 = $shiftLeft64(new $Uint64(0, (((exp - flt.bias >> 0)) & ((((y$3 = flt.expbits, y$3 < 32 ? (1 << y$3) : 0) >> 0) - 1 >> 0)))), flt.mantbits), new $Uint64(bits.$high | x$7.$high, (bits.$low | x$7.$low) >>> 0)); + if (d.neg) { + bits = (x$8 = $shiftLeft64($shiftLeft64(new $Uint64(0, 1), flt.mantbits), flt.expbits), new $Uint64(bits.$high | x$8.$high, (bits.$low | x$8.$low) >>> 0)); + } + _tmp = bits; + _tmp$1 = overflow; + b = _tmp; + overflow = _tmp$1; + return [b, overflow]; + /* */ } return; } + }; + decimal.prototype.floatBits = function(flt) { return this.$val.floatBits(flt); }; + atof64exact = function(mantissa, exp, neg) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, exp, f, mantissa, neg, ok, x, x$1, x$2; + f = 0; + ok = false; + if (!((x = $shiftRightUint64(mantissa, float64info.mantbits), (x.$high === 0 && x.$low === 0)))) { + return [f, ok]; + } + f = $flatten64(mantissa); + if (neg) { + f = -f; + } + if ((exp === 0)) { + _tmp = f; + _tmp$1 = true; + f = _tmp; + ok = _tmp$1; + return [f, ok]; + } else if (exp > 0 && exp <= 37) { + if (exp > 22) { + f = f * ((x$1 = exp - 22 >> 0, ((x$1 < 0 || x$1 >= float64pow10.$length) ? $throwRuntimeError("index out of range") : float64pow10.$array[float64pow10.$offset + x$1]))); + exp = 22; + } + if (f > 1e+15 || f < -1e+15) { + return [f, ok]; + } + _tmp$2 = f * ((exp < 0 || exp >= float64pow10.$length) ? $throwRuntimeError("index out of range") : float64pow10.$array[float64pow10.$offset + exp]); + _tmp$3 = true; + f = _tmp$2; + ok = _tmp$3; + return [f, ok]; + } else if (exp < 0 && exp >= -22) { + _tmp$4 = f / (x$2 = -exp, ((x$2 < 0 || x$2 >= float64pow10.$length) ? $throwRuntimeError("index out of range") : float64pow10.$array[float64pow10.$offset + x$2])); + _tmp$5 = true; + f = _tmp$4; + ok = _tmp$5; + return [f, ok]; + } + return [f, ok]; + }; + atof32exact = function(mantissa, exp, neg) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, exp, f, mantissa, neg, ok, x, x$1, x$2; + f = 0; + ok = false; + if (!((x = $shiftRightUint64(mantissa, float32info.mantbits), (x.$high === 0 && x.$low === 0)))) { + return [f, ok]; + } + f = $flatten64(mantissa); + if (neg) { + f = -f; + } + if ((exp === 0)) { + _tmp = f; + _tmp$1 = true; + f = _tmp; + ok = _tmp$1; + return [f, ok]; + } else if (exp > 0 && exp <= 17) { + if (exp > 10) { + f = $fround(f * ((x$1 = exp - 10 >> 0, ((x$1 < 0 || x$1 >= float32pow10.$length) ? $throwRuntimeError("index out of range") : float32pow10.$array[float32pow10.$offset + x$1])))); + exp = 10; + } + if (f > 1e+07 || f < -1e+07) { + return [f, ok]; + } + _tmp$2 = $fround(f * ((exp < 0 || exp >= float32pow10.$length) ? $throwRuntimeError("index out of range") : float32pow10.$array[float32pow10.$offset + exp])); + _tmp$3 = true; + f = _tmp$2; + ok = _tmp$3; + return [f, ok]; + } else if (exp < 0 && exp >= -10) { + _tmp$4 = $fround(f / (x$2 = -exp, ((x$2 < 0 || x$2 >= float32pow10.$length) ? $throwRuntimeError("index out of range") : float32pow10.$array[float32pow10.$offset + x$2]))); + _tmp$5 = true; + f = _tmp$4; + ok = _tmp$5; + return [f, ok]; + } + return [f, ok]; + }; + atof32 = function(s) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, b$1, d, err, exp, ext, f, f$1, mantissa, neg, ok, ok$1, ok$2, ok$3, ovf, ovf$1, s, trunc, val; + f = 0; + err = $ifaceNil; + _tuple = special(s); + val = _tuple[0]; + ok = _tuple[1]; + if (ok) { + _tmp = $fround(val); + _tmp$1 = $ifaceNil; + f = _tmp; + err = _tmp$1; + return [f, err]; + } + if (optimize) { + _tuple$1 = readFloat(s); + mantissa = _tuple$1[0]; + exp = _tuple$1[1]; + neg = _tuple$1[2]; + trunc = _tuple$1[3]; + ok$1 = _tuple$1[4]; + if (ok$1) { + if (!trunc) { + _tuple$2 = atof32exact(mantissa, exp, neg); + f$1 = _tuple$2[0]; + ok$2 = _tuple$2[1]; + if (ok$2) { + _tmp$2 = f$1; + _tmp$3 = $ifaceNil; + f = _tmp$2; + err = _tmp$3; + return [f, err]; + } + } + ext = new extFloat.ptr(new $Uint64(0, 0), 0, false); + ok$3 = ext.AssignDecimal(mantissa, exp, neg, trunc, float32info); + if (ok$3) { + _tuple$3 = ext.floatBits(float32info); + b = _tuple$3[0]; + ovf = _tuple$3[1]; + f = math.Float32frombits((b.$low >>> 0)); + if (ovf) { + err = rangeError("ParseFloat", s); + } + _tmp$4 = f; + _tmp$5 = err; + f = _tmp$4; + err = _tmp$5; + return [f, err]; + } + } + } + d = new decimal.ptr(arrayType.zero(), 0, 0, false, false); + if (!d.set(s)) { + _tmp$6 = 0; + _tmp$7 = syntaxError("ParseFloat", s); + f = _tmp$6; + err = _tmp$7; + return [f, err]; + } + _tuple$4 = d.floatBits(float32info); + b$1 = _tuple$4[0]; + ovf$1 = _tuple$4[1]; + f = math.Float32frombits((b$1.$low >>> 0)); + if (ovf$1) { + err = rangeError("ParseFloat", s); + } + _tmp$8 = f; + _tmp$9 = err; + f = _tmp$8; + err = _tmp$9; + return [f, err]; + }; + atof64 = function(s) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, b$1, d, err, exp, ext, f, f$1, mantissa, neg, ok, ok$1, ok$2, ok$3, ovf, ovf$1, s, trunc, val; + f = 0; + err = $ifaceNil; + _tuple = special(s); + val = _tuple[0]; + ok = _tuple[1]; + if (ok) { + _tmp = val; + _tmp$1 = $ifaceNil; + f = _tmp; + err = _tmp$1; + return [f, err]; + } + if (optimize) { + _tuple$1 = readFloat(s); + mantissa = _tuple$1[0]; + exp = _tuple$1[1]; + neg = _tuple$1[2]; + trunc = _tuple$1[3]; + ok$1 = _tuple$1[4]; + if (ok$1) { + if (!trunc) { + _tuple$2 = atof64exact(mantissa, exp, neg); + f$1 = _tuple$2[0]; + ok$2 = _tuple$2[1]; + if (ok$2) { + _tmp$2 = f$1; + _tmp$3 = $ifaceNil; + f = _tmp$2; + err = _tmp$3; + return [f, err]; + } + } + ext = new extFloat.ptr(new $Uint64(0, 0), 0, false); + ok$3 = ext.AssignDecimal(mantissa, exp, neg, trunc, float64info); + if (ok$3) { + _tuple$3 = ext.floatBits(float64info); + b = _tuple$3[0]; + ovf = _tuple$3[1]; + f = math.Float64frombits(b); + if (ovf) { + err = rangeError("ParseFloat", s); + } + _tmp$4 = f; + _tmp$5 = err; + f = _tmp$4; + err = _tmp$5; + return [f, err]; + } + } + } + d = new decimal.ptr(arrayType.zero(), 0, 0, false, false); + if (!d.set(s)) { + _tmp$6 = 0; + _tmp$7 = syntaxError("ParseFloat", s); + f = _tmp$6; + err = _tmp$7; + return [f, err]; + } + _tuple$4 = d.floatBits(float64info); + b$1 = _tuple$4[0]; + ovf$1 = _tuple$4[1]; + f = math.Float64frombits(b$1); + if (ovf$1) { + err = rangeError("ParseFloat", s); + } + _tmp$8 = f; + _tmp$9 = err; + f = _tmp$8; + err = _tmp$9; + return [f, err]; + }; + ParseFloat = function(s, bitSize) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, bitSize, err, err1, err1$1, f, f1, f1$1, s; + f = 0; + err = $ifaceNil; + if (bitSize === 32) { + _tuple = atof32(s); + f1 = _tuple[0]; + err1 = _tuple[1]; + _tmp = f1; + _tmp$1 = err1; + f = _tmp; + err = _tmp$1; + return [f, err]; + } + _tuple$1 = atof64(s); + f1$1 = _tuple$1[0]; + err1$1 = _tuple$1[1]; + _tmp$2 = f1$1; + _tmp$3 = err1$1; + f = _tmp$2; + err = _tmp$3; + return [f, err]; + }; + $pkg.ParseFloat = ParseFloat; + NumError.ptr.prototype.Error = function() { + var $ptr, _r, e, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + e = this; + _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return "strconv." + e.Func + ": " + "parsing " + Quote(e.Num) + ": " + _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: NumError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; + }; + NumError.prototype.Error = function() { return this.$val.Error(); }; + syntaxError = function(fn, str) { + var $ptr, fn, str; + return new NumError.ptr(fn, str, $pkg.ErrSyntax); + }; + rangeError = function(fn, str) { + var $ptr, fn, str; + return new NumError.ptr(fn, str, $pkg.ErrRange); + }; + ParseUint = function(s, base, bitSize) { + var $ptr, _1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, base, bitSize, cutoff, d, err, i, maxVal, n, n1, s, v, x, x$1, x$2, $s; + /* */ $s = 0; s: while (true) { switch ($s) { case 0: + n = new $Uint64(0, 0); + err = $ifaceNil; + _tmp = new $Uint64(0, 0); + _tmp$1 = new $Uint64(0, 0); + cutoff = _tmp; + maxVal = _tmp$1; + if (bitSize === 0) { + bitSize = 32; + } + i = 0; + /* */ if (s.length < 1) { $s = 2; continue; } + /* */ if (2 <= base && base <= 36) { $s = 3; continue; } + /* */ if ((base === 0)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (s.length < 1) { */ case 2: + err = $pkg.ErrSyntax; + /* goto Error */ $s = 7; continue; + $s = 6; continue; + /* } else if (2 <= base && base <= 36) { */ case 3: + $s = 6; continue; + /* } else if ((base === 0)) { */ case 4: + /* */ if ((s.charCodeAt(0) === 48) && s.length > 1 && ((s.charCodeAt(1) === 120) || (s.charCodeAt(1) === 88))) { $s = 9; continue; } + /* */ if ((s.charCodeAt(0) === 48)) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if ((s.charCodeAt(0) === 48) && s.length > 1 && ((s.charCodeAt(1) === 120) || (s.charCodeAt(1) === 88))) { */ case 9: + /* */ if (s.length < 3) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if (s.length < 3) { */ case 13: + err = $pkg.ErrSyntax; + /* goto Error */ $s = 7; continue; + /* } */ case 14: + base = 16; + i = 2; + $s = 12; continue; + /* } else if ((s.charCodeAt(0) === 48)) { */ case 10: + base = 8; + i = 1; + $s = 12; continue; + /* } else { */ case 11: + base = 10; + /* } */ case 12: + case 8: + $s = 6; continue; + /* } else { */ case 5: + err = errors.New("invalid base " + Itoa(base)); + /* goto Error */ $s = 7; continue; + /* } */ case 6: + case 1: + _1 = base; + if (_1 === (10)) { + cutoff = new $Uint64(429496729, 2576980378); + } else if (_1 === (16)) { + cutoff = new $Uint64(268435456, 0); + } else { + cutoff = (x = $div64(new $Uint64(4294967295, 4294967295), new $Uint64(0, base), false), new $Uint64(x.$high + 0, x.$low + 1)); + } + maxVal = (x$1 = $shiftLeft64(new $Uint64(0, 1), (bitSize >>> 0)), new $Uint64(x$1.$high - 0, x$1.$low - 1)); + /* while (true) { */ case 15: + /* if (!(i < s.length)) { break; } */ if(!(i < s.length)) { $s = 16; continue; } + v = 0; + d = s.charCodeAt(i); + /* */ if (48 <= d && d <= 57) { $s = 18; continue; } + /* */ if (97 <= d && d <= 122) { $s = 19; continue; } + /* */ if (65 <= d && d <= 90) { $s = 20; continue; } + /* */ $s = 21; continue; + /* if (48 <= d && d <= 57) { */ case 18: + v = d - 48 << 24 >>> 24; + $s = 22; continue; + /* } else if (97 <= d && d <= 122) { */ case 19: + v = (d - 97 << 24 >>> 24) + 10 << 24 >>> 24; + $s = 22; continue; + /* } else if (65 <= d && d <= 90) { */ case 20: + v = (d - 65 << 24 >>> 24) + 10 << 24 >>> 24; + $s = 22; continue; + /* } else { */ case 21: + n = new $Uint64(0, 0); + err = $pkg.ErrSyntax; + /* goto Error */ $s = 7; continue; + /* } */ case 22: + case 17: + /* */ if (v >= (base << 24 >>> 24)) { $s = 23; continue; } + /* */ $s = 24; continue; + /* if (v >= (base << 24 >>> 24)) { */ case 23: + n = new $Uint64(0, 0); + err = $pkg.ErrSyntax; + /* goto Error */ $s = 7; continue; + /* } */ case 24: + /* */ if ((n.$high > cutoff.$high || (n.$high === cutoff.$high && n.$low >= cutoff.$low))) { $s = 25; continue; } + /* */ $s = 26; continue; + /* if ((n.$high > cutoff.$high || (n.$high === cutoff.$high && n.$low >= cutoff.$low))) { */ case 25: + n = new $Uint64(4294967295, 4294967295); + err = $pkg.ErrRange; + /* goto Error */ $s = 7; continue; + /* } */ case 26: + n = $mul64(n, (new $Uint64(0, base))); + n1 = (x$2 = new $Uint64(0, v), new $Uint64(n.$high + x$2.$high, n.$low + x$2.$low)); + /* */ if ((n1.$high < n.$high || (n1.$high === n.$high && n1.$low < n.$low)) || (n1.$high > maxVal.$high || (n1.$high === maxVal.$high && n1.$low > maxVal.$low))) { $s = 27; continue; } + /* */ $s = 28; continue; + /* if ((n1.$high < n.$high || (n1.$high === n.$high && n1.$low < n.$low)) || (n1.$high > maxVal.$high || (n1.$high === maxVal.$high && n1.$low > maxVal.$low))) { */ case 27: + n = new $Uint64(4294967295, 4294967295); + err = $pkg.ErrRange; + /* goto Error */ $s = 7; continue; + /* } */ case 28: + n = n1; + i = i + (1) >> 0; + /* } */ $s = 15; continue; case 16: + _tmp$2 = n; + _tmp$3 = $ifaceNil; + n = _tmp$2; + err = _tmp$3; + return [n, err]; + /* Error: */ case 7: + _tmp$4 = n; + _tmp$5 = new NumError.ptr("ParseUint", s, err); + n = _tmp$4; + err = _tmp$5; + return [n, err]; + /* */ $s = -1; case -1: } return; } + }; + $pkg.ParseUint = ParseUint; + ParseInt = function(s, base, bitSize) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, base, bitSize, cutoff, err, i, n, neg, s, s0, un, x, x$1; + i = new $Int64(0, 0); + err = $ifaceNil; + if (bitSize === 0) { + bitSize = 32; + } + if (s.length === 0) { + _tmp = new $Int64(0, 0); + _tmp$1 = syntaxError("ParseInt", s); + i = _tmp; + err = _tmp$1; + return [i, err]; + } + s0 = s; + neg = false; + if (s.charCodeAt(0) === 43) { + s = s.substring(1); + } else if (s.charCodeAt(0) === 45) { + neg = true; + s = s.substring(1); + } + un = new $Uint64(0, 0); + _tuple = ParseUint(s, base, bitSize); + un = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual($assertType(err, ptrType).Err, $pkg.ErrRange))) { + $assertType(err, ptrType).Func = "ParseInt"; + $assertType(err, ptrType).Num = s0; + _tmp$2 = new $Int64(0, 0); + _tmp$3 = err; + i = _tmp$2; + err = _tmp$3; + return [i, err]; + } + cutoff = $shiftLeft64(new $Uint64(0, 1), ((bitSize - 1 >> 0) >>> 0)); + if (!neg && (un.$high > cutoff.$high || (un.$high === cutoff.$high && un.$low >= cutoff.$low))) { + _tmp$4 = (x = new $Uint64(cutoff.$high - 0, cutoff.$low - 1), new $Int64(x.$high, x.$low)); + _tmp$5 = rangeError("ParseInt", s0); + i = _tmp$4; + err = _tmp$5; + return [i, err]; + } + if (neg && (un.$high > cutoff.$high || (un.$high === cutoff.$high && un.$low > cutoff.$low))) { + _tmp$6 = (x$1 = new $Int64(cutoff.$high, cutoff.$low), new $Int64(-x$1.$high, -x$1.$low)); + _tmp$7 = rangeError("ParseInt", s0); + i = _tmp$6; + err = _tmp$7; + return [i, err]; + } + n = new $Int64(un.$high, un.$low); + if (neg) { + n = new $Int64(-n.$high, -n.$low); + } + _tmp$8 = n; + _tmp$9 = $ifaceNil; + i = _tmp$8; + err = _tmp$9; + return [i, err]; + }; + $pkg.ParseInt = ParseInt; + decimal.ptr.prototype.String = function() { + var $ptr, a, buf, n, w; + a = this; + n = 10 + a.nd >> 0; + if (a.dp > 0) { + n = n + (a.dp) >> 0; + } + if (a.dp < 0) { + n = n + (-a.dp) >> 0; + } + buf = $makeSlice(sliceType$6, n); + w = 0; + if ((a.nd === 0)) { + return "0"; + } else if (a.dp <= 0) { + ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = 48); + w = w + (1) >> 0; + ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = 46); + w = w + (1) >> 0; + w = w + (digitZero($subslice(buf, w, (w + -a.dp >> 0)))) >> 0; + w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), 0, a.nd))) >> 0; + } else if (a.dp < a.nd) { + w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), 0, a.dp))) >> 0; + ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = 46); + w = w + (1) >> 0; + w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), a.dp, a.nd))) >> 0; + } else { + w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), 0, a.nd))) >> 0; + w = w + (digitZero($subslice(buf, w, ((w + a.dp >> 0) - a.nd >> 0)))) >> 0; + } + return $bytesToString($subslice(buf, 0, w)); + }; + decimal.prototype.String = function() { return this.$val.String(); }; + digitZero = function(dst) { + var $ptr, _i, _ref, dst, i; + _ref = dst; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + ((i < 0 || i >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + i] = 48); + _i++; + } + return dst.$length; + }; + trim = function(a) { + var $ptr, a, x, x$1; + while (true) { + if (!(a.nd > 0 && ((x = a.d, x$1 = a.nd - 1 >> 0, ((x$1 < 0 || x$1 >= x.length) ? $throwRuntimeError("index out of range") : x[x$1])) === 48))) { break; } + a.nd = a.nd - (1) >> 0; + } + if (a.nd === 0) { + a.dp = 0; + } + }; + decimal.ptr.prototype.Assign = function(v) { + var $ptr, a, buf, n, v, v1, x, x$1, x$2; + a = this; + buf = arrayType$1.zero(); + n = 0; + while (true) { + if (!((v.$high > 0 || (v.$high === 0 && v.$low > 0)))) { break; } + v1 = $div64(v, new $Uint64(0, 10), false); + v = (x = $mul64(new $Uint64(0, 10), v1), new $Uint64(v.$high - x.$high, v.$low - x.$low)); + ((n < 0 || n >= buf.length) ? $throwRuntimeError("index out of range") : buf[n] = (new $Uint64(v.$high + 0, v.$low + 48).$low << 24 >>> 24)); + n = n + (1) >> 0; + v = v1; + } + a.nd = 0; + n = n - (1) >> 0; + while (true) { + if (!(n >= 0)) { break; } + (x$1 = a.d, x$2 = a.nd, ((x$2 < 0 || x$2 >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[x$2] = ((n < 0 || n >= buf.length) ? $throwRuntimeError("index out of range") : buf[n]))); + a.nd = a.nd + (1) >> 0; + n = n - (1) >> 0; + } + a.dp = a.nd; + trim(a); + }; + decimal.prototype.Assign = function(v) { return this.$val.Assign(v); }; + rightShift = function(a, k) { + var $ptr, a, c, c$1, dig, dig$1, k, n, r, w, x, x$1, x$2, x$3, y, y$1, y$2, y$3, y$4, y$5; + r = 0; + w = 0; + n = 0; + while (true) { + if (!(((y = k, y < 32 ? (n >>> y) : 0) >>> 0) === 0)) { break; } + if (r >= a.nd) { + if (n === 0) { + a.nd = 0; + return; + } + while (true) { + if (!(((y$1 = k, y$1 < 32 ? (n >>> y$1) : 0) >>> 0) === 0)) { break; } + n = n * 10 >>> 0; + r = r + (1) >> 0; + } + break; + } + c = ((x = a.d, ((r < 0 || r >= x.length) ? $throwRuntimeError("index out of range") : x[r])) >>> 0); + n = ((n * 10 >>> 0) + c >>> 0) - 48 >>> 0; + r = r + (1) >> 0; + } + a.dp = a.dp - ((r - 1 >> 0)) >> 0; + while (true) { + if (!(r < a.nd)) { break; } + c$1 = ((x$1 = a.d, ((r < 0 || r >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[r])) >>> 0); + dig = (y$2 = k, y$2 < 32 ? (n >>> y$2) : 0) >>> 0; + n = n - (((y$3 = k, y$3 < 32 ? (dig << y$3) : 0) >>> 0)) >>> 0; + (x$2 = a.d, ((w < 0 || w >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[w] = ((dig + 48 >>> 0) << 24 >>> 24))); + w = w + (1) >> 0; + n = ((n * 10 >>> 0) + c$1 >>> 0) - 48 >>> 0; + r = r + (1) >> 0; + } + while (true) { + if (!(n > 0)) { break; } + dig$1 = (y$4 = k, y$4 < 32 ? (n >>> y$4) : 0) >>> 0; + n = n - (((y$5 = k, y$5 < 32 ? (dig$1 << y$5) : 0) >>> 0)) >>> 0; + if (w < 800) { + (x$3 = a.d, ((w < 0 || w >= x$3.length) ? $throwRuntimeError("index out of range") : x$3[w] = ((dig$1 + 48 >>> 0) << 24 >>> 24))); + w = w + (1) >> 0; + } else if (dig$1 > 0) { + a.trunc = true; + } + n = n * 10 >>> 0; + } + a.nd = w; + trim(a); + }; + prefixIsLessThan = function(b, s) { + var $ptr, b, i, s; + i = 0; + while (true) { + if (!(i < s.length)) { break; } + if (i >= b.$length) { + return true; + } + if (!((((i < 0 || i >= b.$length) ? $throwRuntimeError("index out of range") : b.$array[b.$offset + i]) === s.charCodeAt(i)))) { + return ((i < 0 || i >= b.$length) ? $throwRuntimeError("index out of range") : b.$array[b.$offset + i]) < s.charCodeAt(i); + } + i = i + (1) >> 0; + } + return false; + }; + leftShift = function(a, k) { + var $ptr, _q, _q$1, a, delta, k, n, quo, quo$1, r, rem, rem$1, w, x, x$1, x$2, y; + delta = ((k < 0 || k >= leftcheats.$length) ? $throwRuntimeError("index out of range") : leftcheats.$array[leftcheats.$offset + k]).delta; + if (prefixIsLessThan($subslice(new sliceType$6(a.d), 0, a.nd), ((k < 0 || k >= leftcheats.$length) ? $throwRuntimeError("index out of range") : leftcheats.$array[leftcheats.$offset + k]).cutoff)) { + delta = delta - (1) >> 0; + } + r = a.nd; + w = a.nd + delta >> 0; + n = 0; + r = r - (1) >> 0; + while (true) { + if (!(r >= 0)) { break; } + n = n + (((y = k, y < 32 ? (((((x = a.d, ((r < 0 || r >= x.length) ? $throwRuntimeError("index out of range") : x[r])) >>> 0) - 48 >>> 0)) << y) : 0) >>> 0)) >>> 0; + quo = (_q = n / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + rem = n - (10 * quo >>> 0) >>> 0; + w = w - (1) >> 0; + if (w < 800) { + (x$1 = a.d, ((w < 0 || w >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[w] = ((rem + 48 >>> 0) << 24 >>> 24))); + } else if (!((rem === 0))) { + a.trunc = true; + } + n = quo; + r = r - (1) >> 0; + } + while (true) { + if (!(n > 0)) { break; } + quo$1 = (_q$1 = n / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); + rem$1 = n - (10 * quo$1 >>> 0) >>> 0; + w = w - (1) >> 0; + if (w < 800) { + (x$2 = a.d, ((w < 0 || w >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[w] = ((rem$1 + 48 >>> 0) << 24 >>> 24))); + } else if (!((rem$1 === 0))) { + a.trunc = true; + } + n = quo$1; + } + a.nd = a.nd + (delta) >> 0; + if (a.nd >= 800) { + a.nd = 800; + } + a.dp = a.dp + (delta) >> 0; + trim(a); + }; + decimal.ptr.prototype.Shift = function(k) { + var $ptr, a, k; + a = this; + if ((a.nd === 0)) { + } else if (k > 0) { + while (true) { + if (!(k > 28)) { break; } + leftShift(a, 28); + k = k - (28) >> 0; + } + leftShift(a, (k >>> 0)); + } else if (k < 0) { + while (true) { + if (!(k < -28)) { break; } + rightShift(a, 28); + k = k + (28) >> 0; + } + rightShift(a, (-k >>> 0)); + } + }; + decimal.prototype.Shift = function(k) { return this.$val.Shift(k); }; + shouldRoundUp = function(a, nd) { + var $ptr, _r, a, nd, x, x$1, x$2, x$3; + if (nd < 0 || nd >= a.nd) { + return false; + } + if (((x = a.d, ((nd < 0 || nd >= x.length) ? $throwRuntimeError("index out of range") : x[nd])) === 53) && ((nd + 1 >> 0) === a.nd)) { + if (a.trunc) { + return true; + } + return nd > 0 && !(((_r = (((x$1 = a.d, x$2 = nd - 1 >> 0, ((x$2 < 0 || x$2 >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[x$2])) - 48 << 24 >>> 24)) % 2, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0)); + } + return (x$3 = a.d, ((nd < 0 || nd >= x$3.length) ? $throwRuntimeError("index out of range") : x$3[nd])) >= 53; + }; + decimal.ptr.prototype.Round = function(nd) { + var $ptr, a, nd; + a = this; + if (nd < 0 || nd >= a.nd) { + return; + } + if (shouldRoundUp(a, nd)) { + a.RoundUp(nd); + } else { + a.RoundDown(nd); + } + }; + decimal.prototype.Round = function(nd) { return this.$val.Round(nd); }; + decimal.ptr.prototype.RoundDown = function(nd) { + var $ptr, a, nd; + a = this; + if (nd < 0 || nd >= a.nd) { + return; + } + a.nd = nd; + trim(a); + }; + decimal.prototype.RoundDown = function(nd) { return this.$val.RoundDown(nd); }; + decimal.ptr.prototype.RoundUp = function(nd) { + var $ptr, a, c, i, nd, x, x$1, x$2; + a = this; + if (nd < 0 || nd >= a.nd) { + return; + } + i = nd - 1 >> 0; + while (true) { + if (!(i >= 0)) { break; } + c = (x = a.d, ((i < 0 || i >= x.length) ? $throwRuntimeError("index out of range") : x[i])); + if (c < 57) { + (x$2 = a.d, ((i < 0 || i >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[i] = ((x$1 = a.d, ((i < 0 || i >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[i])) + (1) << 24 >>> 24))); + a.nd = i + 1 >> 0; + return; + } + i = i - (1) >> 0; + } + a.d[0] = 49; + a.nd = 1; + a.dp = a.dp + (1) >> 0; + }; + decimal.prototype.RoundUp = function(nd) { return this.$val.RoundUp(nd); }; + decimal.ptr.prototype.RoundedInteger = function() { + var $ptr, a, i, n, x, x$1, x$2, x$3; + a = this; + if (a.dp > 20) { + return new $Uint64(4294967295, 4294967295); + } + i = 0; + n = new $Uint64(0, 0); + i = 0; + while (true) { + if (!(i < a.dp && i < a.nd)) { break; } + n = (x = $mul64(n, new $Uint64(0, 10)), x$1 = new $Uint64(0, ((x$2 = a.d, ((i < 0 || i >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[i])) - 48 << 24 >>> 24)), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); + i = i + (1) >> 0; + } + while (true) { + if (!(i < a.dp)) { break; } + n = $mul64(n, (new $Uint64(0, 10))); + i = i + (1) >> 0; + } + if (shouldRoundUp(a, a.dp)) { + n = (x$3 = new $Uint64(0, 1), new $Uint64(n.$high + x$3.$high, n.$low + x$3.$low)); + } + return n; + }; + decimal.prototype.RoundedInteger = function() { return this.$val.RoundedInteger(); }; + extFloat.ptr.prototype.floatBits = function(flt) { + var $ptr, bits, exp, f, flt, mant, n, overflow, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, y$1, y$2; + bits = new $Uint64(0, 0); + overflow = false; + f = this; + f.Normalize(); + exp = f.exp + 63 >> 0; + if (exp < (flt.bias + 1 >> 0)) { + n = (flt.bias + 1 >> 0) - exp >> 0; + f.mant = $shiftRightUint64(f.mant, ((n >>> 0))); + exp = exp + (n) >> 0; + } + mant = $shiftRightUint64(f.mant, ((63 - flt.mantbits >>> 0))); + if (!((x = (x$1 = f.mant, x$2 = $shiftLeft64(new $Uint64(0, 1), ((62 - flt.mantbits >>> 0))), new $Uint64(x$1.$high & x$2.$high, (x$1.$low & x$2.$low) >>> 0)), (x.$high === 0 && x.$low === 0)))) { + mant = (x$3 = new $Uint64(0, 1), new $Uint64(mant.$high + x$3.$high, mant.$low + x$3.$low)); + } + if ((x$4 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$4.$high && mant.$low === x$4.$low))) { + mant = $shiftRightUint64(mant, (1)); + exp = exp + (1) >> 0; + } + if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) { + mant = new $Uint64(0, 0); + exp = (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0) + flt.bias >> 0; + overflow = true; + } else if ((x$5 = (x$6 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high & x$6.$high, (mant.$low & x$6.$low) >>> 0)), (x$5.$high === 0 && x$5.$low === 0))) { + exp = flt.bias; + } + bits = (x$7 = (x$8 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$8.$high - 0, x$8.$low - 1)), new $Uint64(mant.$high & x$7.$high, (mant.$low & x$7.$low) >>> 0)); + bits = (x$9 = $shiftLeft64(new $Uint64(0, (((exp - flt.bias >> 0)) & ((((y$2 = flt.expbits, y$2 < 32 ? (1 << y$2) : 0) >> 0) - 1 >> 0)))), flt.mantbits), new $Uint64(bits.$high | x$9.$high, (bits.$low | x$9.$low) >>> 0)); + if (f.neg) { + bits = (x$10 = $shiftLeft64(new $Uint64(0, 1), ((flt.mantbits + flt.expbits >>> 0))), new $Uint64(bits.$high | x$10.$high, (bits.$low | x$10.$low) >>> 0)); + } + return [bits, overflow]; + }; + extFloat.prototype.floatBits = function(flt) { return this.$val.floatBits(flt); }; + extFloat.ptr.prototype.AssignComputeBounds = function(mant, exp, neg, flt) { + var $ptr, _tmp, _tmp$1, exp, expBiased, f, flt, lower, mant, neg, upper, x, x$1, x$2, x$3, x$4; + lower = new extFloat.ptr(new $Uint64(0, 0), 0, false); + upper = new extFloat.ptr(new $Uint64(0, 0), 0, false); + f = this; + f.mant = mant; + f.exp = exp - (flt.mantbits >> 0) >> 0; + f.neg = neg; + if (f.exp <= 0 && (x = $shiftLeft64(($shiftRightUint64(mant, (-f.exp >>> 0))), (-f.exp >>> 0)), (mant.$high === x.$high && mant.$low === x.$low))) { + f.mant = $shiftRightUint64(f.mant, ((-f.exp >>> 0))); + f.exp = 0; + _tmp = $clone(f, extFloat); + _tmp$1 = $clone(f, extFloat); + extFloat.copy(lower, _tmp); + extFloat.copy(upper, _tmp$1); + return [lower, upper]; + } + expBiased = exp - flt.bias >> 0; + extFloat.copy(upper, new extFloat.ptr((x$1 = $mul64(new $Uint64(0, 2), f.mant), new $Uint64(x$1.$high + 0, x$1.$low + 1)), f.exp - 1 >> 0, f.neg)); + if (!((x$2 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) || (expBiased === 1)) { + extFloat.copy(lower, new extFloat.ptr((x$3 = $mul64(new $Uint64(0, 2), f.mant), new $Uint64(x$3.$high - 0, x$3.$low - 1)), f.exp - 1 >> 0, f.neg)); + } else { + extFloat.copy(lower, new extFloat.ptr((x$4 = $mul64(new $Uint64(0, 4), f.mant), new $Uint64(x$4.$high - 0, x$4.$low - 1)), f.exp - 2 >> 0, f.neg)); + } + return [lower, upper]; + }; + extFloat.prototype.AssignComputeBounds = function(mant, exp, neg, flt) { return this.$val.AssignComputeBounds(mant, exp, neg, flt); }; + extFloat.ptr.prototype.Normalize = function() { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, exp, f, mant, shift, x, x$1, x$2, x$3, x$4, x$5; + shift = 0; + f = this; + _tmp = f.mant; + _tmp$1 = f.exp; + mant = _tmp; + exp = _tmp$1; + if ((mant.$high === 0 && mant.$low === 0)) { + shift = 0; + return shift; + } + if ((x = $shiftRightUint64(mant, 32), (x.$high === 0 && x.$low === 0))) { + mant = $shiftLeft64(mant, (32)); + exp = exp - (32) >> 0; + } + if ((x$1 = $shiftRightUint64(mant, 48), (x$1.$high === 0 && x$1.$low === 0))) { + mant = $shiftLeft64(mant, (16)); + exp = exp - (16) >> 0; + } + if ((x$2 = $shiftRightUint64(mant, 56), (x$2.$high === 0 && x$2.$low === 0))) { + mant = $shiftLeft64(mant, (8)); + exp = exp - (8) >> 0; + } + if ((x$3 = $shiftRightUint64(mant, 60), (x$3.$high === 0 && x$3.$low === 0))) { + mant = $shiftLeft64(mant, (4)); + exp = exp - (4) >> 0; + } + if ((x$4 = $shiftRightUint64(mant, 62), (x$4.$high === 0 && x$4.$low === 0))) { + mant = $shiftLeft64(mant, (2)); + exp = exp - (2) >> 0; + } + if ((x$5 = $shiftRightUint64(mant, 63), (x$5.$high === 0 && x$5.$low === 0))) { + mant = $shiftLeft64(mant, (1)); + exp = exp - (1) >> 0; + } + shift = ((f.exp - exp >> 0) >>> 0); + _tmp$2 = mant; + _tmp$3 = exp; + f.mant = _tmp$2; + f.exp = _tmp$3; + return shift; + }; + extFloat.prototype.Normalize = function() { return this.$val.Normalize(); }; + extFloat.ptr.prototype.Multiply = function(g) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, cross1, cross2, f, fhi, flo, g, ghi, glo, rem, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + g = $clone(g, extFloat); + f = this; + _tmp = $shiftRightUint64(f.mant, 32); + _tmp$1 = new $Uint64(0, (f.mant.$low >>> 0)); + fhi = _tmp; + flo = _tmp$1; + _tmp$2 = $shiftRightUint64(g.mant, 32); + _tmp$3 = new $Uint64(0, (g.mant.$low >>> 0)); + ghi = _tmp$2; + glo = _tmp$3; + cross1 = $mul64(fhi, glo); + cross2 = $mul64(flo, ghi); + f.mant = (x = (x$1 = $mul64(fhi, ghi), x$2 = $shiftRightUint64(cross1, 32), new $Uint64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)), x$3 = $shiftRightUint64(cross2, 32), new $Uint64(x.$high + x$3.$high, x.$low + x$3.$low)); + rem = (x$4 = (x$5 = new $Uint64(0, (cross1.$low >>> 0)), x$6 = new $Uint64(0, (cross2.$low >>> 0)), new $Uint64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)), x$7 = $shiftRightUint64(($mul64(flo, glo)), 32), new $Uint64(x$4.$high + x$7.$high, x$4.$low + x$7.$low)); + rem = (x$8 = new $Uint64(0, 2147483648), new $Uint64(rem.$high + x$8.$high, rem.$low + x$8.$low)); + f.mant = (x$9 = f.mant, x$10 = ($shiftRightUint64(rem, 32)), new $Uint64(x$9.$high + x$10.$high, x$9.$low + x$10.$low)); + f.exp = (f.exp + g.exp >> 0) + 64 >> 0; + }; + extFloat.prototype.Multiply = function(g) { return this.$val.Multiply(g); }; + extFloat.ptr.prototype.AssignDecimal = function(mantissa, exp10, neg, trunc, flt) { + var $ptr, _q, _r, adjExp, denormalExp, errors$1, exp10, extrabits, f, flt, halfway, i, mant_extra, mantissa, neg, ok, shift, trunc, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y; + ok = false; + f = this; + errors$1 = 0; + if (trunc) { + errors$1 = errors$1 + (4) >> 0; + } + f.mant = mantissa; + f.exp = 0; + f.neg = neg; + i = (_q = ((exp10 - -348 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + if (exp10 < -348 || i >= 87) { + ok = false; + return ok; + } + adjExp = (_r = ((exp10 - -348 >> 0)) % 8, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); + if (adjExp < 19 && (x = (x$1 = 19 - adjExp >> 0, ((x$1 < 0 || x$1 >= uint64pow10.length) ? $throwRuntimeError("index out of range") : uint64pow10[x$1])), (mantissa.$high < x.$high || (mantissa.$high === x.$high && mantissa.$low < x.$low)))) { + f.mant = $mul64(f.mant, (((adjExp < 0 || adjExp >= uint64pow10.length) ? $throwRuntimeError("index out of range") : uint64pow10[adjExp]))); + f.Normalize(); + } else { + f.Normalize(); + f.Multiply(((adjExp < 0 || adjExp >= smallPowersOfTen.length) ? $throwRuntimeError("index out of range") : smallPowersOfTen[adjExp])); + errors$1 = errors$1 + (4) >> 0; + } + f.Multiply(((i < 0 || i >= powersOfTen.length) ? $throwRuntimeError("index out of range") : powersOfTen[i])); + if (errors$1 > 0) { + errors$1 = errors$1 + (1) >> 0; + } + errors$1 = errors$1 + (4) >> 0; + shift = f.Normalize(); + errors$1 = (y = (shift), y < 32 ? (errors$1 << y) : 0) >> 0; + denormalExp = flt.bias - 63 >> 0; + extrabits = 0; + if (f.exp <= denormalExp) { + extrabits = (((63 - flt.mantbits >>> 0) + 1 >>> 0) + ((denormalExp - f.exp >> 0) >>> 0) >>> 0); + } else { + extrabits = (63 - flt.mantbits >>> 0); + } + halfway = $shiftLeft64(new $Uint64(0, 1), ((extrabits - 1 >>> 0))); + mant_extra = (x$2 = f.mant, x$3 = (x$4 = $shiftLeft64(new $Uint64(0, 1), extrabits), new $Uint64(x$4.$high - 0, x$4.$low - 1)), new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)); + if ((x$5 = (x$6 = new $Int64(halfway.$high, halfway.$low), x$7 = new $Int64(0, errors$1), new $Int64(x$6.$high - x$7.$high, x$6.$low - x$7.$low)), x$8 = new $Int64(mant_extra.$high, mant_extra.$low), (x$5.$high < x$8.$high || (x$5.$high === x$8.$high && x$5.$low < x$8.$low))) && (x$9 = new $Int64(mant_extra.$high, mant_extra.$low), x$10 = (x$11 = new $Int64(halfway.$high, halfway.$low), x$12 = new $Int64(0, errors$1), new $Int64(x$11.$high + x$12.$high, x$11.$low + x$12.$low)), (x$9.$high < x$10.$high || (x$9.$high === x$10.$high && x$9.$low < x$10.$low)))) { + ok = false; + return ok; + } + ok = true; + return ok; + }; + extFloat.prototype.AssignDecimal = function(mantissa, exp10, neg, trunc, flt) { return this.$val.AssignDecimal(mantissa, exp10, neg, trunc, flt); }; + extFloat.ptr.prototype.frexp10 = function() { + var $ptr, _q, _q$1, _tmp, _tmp$1, approxExp10, exp, exp10, f, i, index; + exp10 = 0; + index = 0; + f = this; + approxExp10 = (_q = ($imul(((-46 - f.exp >> 0)), 28)) / 93, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + i = (_q$1 = ((approxExp10 - -348 >> 0)) / 8, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); + Loop: + while (true) { + exp = (f.exp + ((i < 0 || i >= powersOfTen.length) ? $throwRuntimeError("index out of range") : powersOfTen[i]).exp >> 0) + 64 >> 0; + if (exp < -60) { + i = i + (1) >> 0; + } else if (exp > -32) { + i = i - (1) >> 0; + } else { + break Loop; + } + } + f.Multiply(((i < 0 || i >= powersOfTen.length) ? $throwRuntimeError("index out of range") : powersOfTen[i])); + _tmp = -((-348 + ($imul(i, 8)) >> 0)); + _tmp$1 = i; + exp10 = _tmp; + index = _tmp$1; + return [exp10, index]; + }; + extFloat.prototype.frexp10 = function() { return this.$val.frexp10(); }; + frexp10Many = function(a, b, c) { + var $ptr, _tuple, a, b, c, exp10, i; + exp10 = 0; + _tuple = c.frexp10(); + exp10 = _tuple[0]; + i = _tuple[1]; + a.Multiply(((i < 0 || i >= powersOfTen.length) ? $throwRuntimeError("index out of range") : powersOfTen[i])); + b.Multiply(((i < 0 || i >= powersOfTen.length) ? $throwRuntimeError("index out of range") : powersOfTen[i])); + return exp10; + }; + extFloat.ptr.prototype.FixedDecimal = function(d, n) { + var $CE$B5, $ptr, _q, _q$1, _tmp, _tmp$1, _tuple, buf, d, digit, exp10, f, fraction, i, i$1, i$2, integer, integerDigits, n, nd, needed, ok, pos, pow, pow10, rest, shift, v, v1, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + f = this; + if ((x = f.mant, (x.$high === 0 && x.$low === 0))) { + d.nd = 0; + d.dp = 0; + d.neg = f.neg; + return true; + } + if (n === 0) { + $panic(new $String("strconv: internal error: extFloat.FixedDecimal called with n == 0")); + } + f.Normalize(); + _tuple = f.frexp10(); + exp10 = _tuple[0]; + shift = (-f.exp >>> 0); + integer = ($shiftRightUint64(f.mant, shift).$low >>> 0); + fraction = (x$1 = f.mant, x$2 = $shiftLeft64(new $Uint64(0, integer), shift), new $Uint64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)); + $CE$B5 = new $Uint64(0, 1); + needed = n; + integerDigits = 0; + pow10 = new $Uint64(0, 1); + _tmp = 0; + _tmp$1 = new $Uint64(0, 1); + i = _tmp; + pow = _tmp$1; + while (true) { + if (!(i < 20)) { break; } + if ((x$3 = new $Uint64(0, integer), (pow.$high > x$3.$high || (pow.$high === x$3.$high && pow.$low > x$3.$low)))) { + integerDigits = i; + break; + } + pow = $mul64(pow, (new $Uint64(0, 10))); + i = i + (1) >> 0; + } + rest = integer; + if (integerDigits > needed) { + pow10 = (x$4 = integerDigits - needed >> 0, ((x$4 < 0 || x$4 >= uint64pow10.length) ? $throwRuntimeError("index out of range") : uint64pow10[x$4])); + integer = (_q = integer / ((pow10.$low >>> 0)), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + rest = rest - (($imul(integer, (pow10.$low >>> 0)) >>> 0)) >>> 0; + } else { + rest = 0; + } + buf = arrayType$2.zero(); + pos = 32; + v = integer; + while (true) { + if (!(v > 0)) { break; } + v1 = (_q$1 = v / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); + v = v - (($imul(10, v1) >>> 0)) >>> 0; + pos = pos - (1) >> 0; + ((pos < 0 || pos >= buf.length) ? $throwRuntimeError("index out of range") : buf[pos] = ((v + 48 >>> 0) << 24 >>> 24)); + v = v1; + } + i$1 = pos; + while (true) { + if (!(i$1 < 32)) { break; } + (x$5 = d.d, x$6 = i$1 - pos >> 0, ((x$6 < 0 || x$6 >= x$5.$length) ? $throwRuntimeError("index out of range") : x$5.$array[x$5.$offset + x$6] = ((i$1 < 0 || i$1 >= buf.length) ? $throwRuntimeError("index out of range") : buf[i$1]))); + i$1 = i$1 + (1) >> 0; + } + nd = 32 - pos >> 0; + d.nd = nd; + d.dp = integerDigits + exp10 >> 0; + needed = needed - (nd) >> 0; + if (needed > 0) { + if (!((rest === 0)) || !((pow10.$high === 0 && pow10.$low === 1))) { + $panic(new $String("strconv: internal error, rest != 0 but needed > 0")); + } + while (true) { + if (!(needed > 0)) { break; } + fraction = $mul64(fraction, (new $Uint64(0, 10))); + $CE$B5 = $mul64($CE$B5, (new $Uint64(0, 10))); + if ((x$7 = $mul64(new $Uint64(0, 2), $CE$B5), x$8 = $shiftLeft64(new $Uint64(0, 1), shift), (x$7.$high > x$8.$high || (x$7.$high === x$8.$high && x$7.$low > x$8.$low)))) { + return false; + } + digit = $shiftRightUint64(fraction, shift); + (x$9 = d.d, ((nd < 0 || nd >= x$9.$length) ? $throwRuntimeError("index out of range") : x$9.$array[x$9.$offset + nd] = (new $Uint64(digit.$high + 0, digit.$low + 48).$low << 24 >>> 24))); + fraction = (x$10 = $shiftLeft64(digit, shift), new $Uint64(fraction.$high - x$10.$high, fraction.$low - x$10.$low)); + nd = nd + (1) >> 0; + needed = needed - (1) >> 0; + } + d.nd = nd; + } + ok = adjustLastDigitFixed(d, (x$11 = $shiftLeft64(new $Uint64(0, rest), shift), new $Uint64(x$11.$high | fraction.$high, (x$11.$low | fraction.$low) >>> 0)), pow10, shift, $CE$B5); + if (!ok) { + return false; + } + i$2 = d.nd - 1 >> 0; + while (true) { + if (!(i$2 >= 0)) { break; } + if (!(((x$12 = d.d, ((i$2 < 0 || i$2 >= x$12.$length) ? $throwRuntimeError("index out of range") : x$12.$array[x$12.$offset + i$2])) === 48))) { + d.nd = i$2 + 1 >> 0; + break; + } + i$2 = i$2 - (1) >> 0; + } + return true; + }; + extFloat.prototype.FixedDecimal = function(d, n) { return this.$val.FixedDecimal(d, n); }; + adjustLastDigitFixed = function(d, num, den, shift, $CE$B5) { + var $CE$B5, $ptr, d, den, i, num, shift, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + if ((x = $shiftLeft64(den, shift), (num.$high > x.$high || (num.$high === x.$high && num.$low > x.$low)))) { + $panic(new $String("strconv: num > den< x$2.$high || (x$1.$high === x$2.$high && x$1.$low > x$2.$low)))) { + $panic(new $String("strconv: \xCE\xB5 > (den< x$6.$high || (x$5.$high === x$6.$high && x$5.$low > x$6.$low)))) { + i = d.nd - 1 >> 0; + while (true) { + if (!(i >= 0)) { break; } + if ((x$7 = d.d, ((i < 0 || i >= x$7.$length) ? $throwRuntimeError("index out of range") : x$7.$array[x$7.$offset + i])) === 57) { + d.nd = d.nd - (1) >> 0; + } else { + break; + } + i = i - (1) >> 0; + } + if (i < 0) { + (x$8 = d.d, (0 >= x$8.$length ? $throwRuntimeError("index out of range") : x$8.$array[x$8.$offset + 0] = 49)); + d.nd = 1; + d.dp = d.dp + (1) >> 0; + } else { + (x$10 = d.d, ((i < 0 || i >= x$10.$length) ? $throwRuntimeError("index out of range") : x$10.$array[x$10.$offset + i] = ((x$9 = d.d, ((i < 0 || i >= x$9.$length) ? $throwRuntimeError("index out of range") : x$9.$array[x$9.$offset + i])) + (1) << 24 >>> 24))); + } + return true; + } + return false; + }; + extFloat.ptr.prototype.ShortestDecimal = function(d, lower, upper) { + var $ptr, _q, _tmp, _tmp$1, _tmp$2, _tmp$3, allowance, buf, currentDiff, d, digit, digit$1, exp10, f, fraction, i, i$1, i$2, integer, integerDigits, lower, multiplier, n, nd, pow, pow$1, shift, targetDiff, upper, v, v1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$22, x$23, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + f = this; + if ((x = f.mant, (x.$high === 0 && x.$low === 0))) { + d.nd = 0; + d.dp = 0; + d.neg = f.neg; + return true; + } + if ((f.exp === 0) && $equal(lower, f, extFloat) && $equal(lower, upper, extFloat)) { + buf = arrayType$1.zero(); + n = 23; + v = f.mant; + while (true) { + if (!((v.$high > 0 || (v.$high === 0 && v.$low > 0)))) { break; } + v1 = $div64(v, new $Uint64(0, 10), false); + v = (x$1 = $mul64(new $Uint64(0, 10), v1), new $Uint64(v.$high - x$1.$high, v.$low - x$1.$low)); + ((n < 0 || n >= buf.length) ? $throwRuntimeError("index out of range") : buf[n] = (new $Uint64(v.$high + 0, v.$low + 48).$low << 24 >>> 24)); + n = n - (1) >> 0; + v = v1; + } + nd = (24 - n >> 0) - 1 >> 0; + i = 0; + while (true) { + if (!(i < nd)) { break; } + (x$3 = d.d, ((i < 0 || i >= x$3.$length) ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + i] = (x$2 = (n + 1 >> 0) + i >> 0, ((x$2 < 0 || x$2 >= buf.length) ? $throwRuntimeError("index out of range") : buf[x$2])))); + i = i + (1) >> 0; + } + _tmp = nd; + _tmp$1 = nd; + d.nd = _tmp; + d.dp = _tmp$1; + while (true) { + if (!(d.nd > 0 && ((x$4 = d.d, x$5 = d.nd - 1 >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + x$5])) === 48))) { break; } + d.nd = d.nd - (1) >> 0; + } + if (d.nd === 0) { + d.dp = 0; + } + d.neg = f.neg; + return true; + } + upper.Normalize(); + if (f.exp > upper.exp) { + f.mant = $shiftLeft64(f.mant, (((f.exp - upper.exp >> 0) >>> 0))); + f.exp = upper.exp; + } + if (lower.exp > upper.exp) { + lower.mant = $shiftLeft64(lower.mant, (((lower.exp - upper.exp >> 0) >>> 0))); + lower.exp = upper.exp; + } + exp10 = frexp10Many(lower, f, upper); + upper.mant = (x$6 = upper.mant, x$7 = new $Uint64(0, 1), new $Uint64(x$6.$high + x$7.$high, x$6.$low + x$7.$low)); + lower.mant = (x$8 = lower.mant, x$9 = new $Uint64(0, 1), new $Uint64(x$8.$high - x$9.$high, x$8.$low - x$9.$low)); + shift = (-upper.exp >>> 0); + integer = ($shiftRightUint64(upper.mant, shift).$low >>> 0); + fraction = (x$10 = upper.mant, x$11 = $shiftLeft64(new $Uint64(0, integer), shift), new $Uint64(x$10.$high - x$11.$high, x$10.$low - x$11.$low)); + allowance = (x$12 = upper.mant, x$13 = lower.mant, new $Uint64(x$12.$high - x$13.$high, x$12.$low - x$13.$low)); + targetDiff = (x$14 = upper.mant, x$15 = f.mant, new $Uint64(x$14.$high - x$15.$high, x$14.$low - x$15.$low)); + integerDigits = 0; + _tmp$2 = 0; + _tmp$3 = new $Uint64(0, 1); + i$1 = _tmp$2; + pow = _tmp$3; + while (true) { + if (!(i$1 < 20)) { break; } + if ((x$16 = new $Uint64(0, integer), (pow.$high > x$16.$high || (pow.$high === x$16.$high && pow.$low > x$16.$low)))) { + integerDigits = i$1; + break; + } + pow = $mul64(pow, (new $Uint64(0, 10))); + i$1 = i$1 + (1) >> 0; + } + i$2 = 0; + while (true) { + if (!(i$2 < integerDigits)) { break; } + pow$1 = (x$17 = (integerDigits - i$2 >> 0) - 1 >> 0, ((x$17 < 0 || x$17 >= uint64pow10.length) ? $throwRuntimeError("index out of range") : uint64pow10[x$17])); + digit = (_q = integer / (pow$1.$low >>> 0), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + (x$18 = d.d, ((i$2 < 0 || i$2 >= x$18.$length) ? $throwRuntimeError("index out of range") : x$18.$array[x$18.$offset + i$2] = ((digit + 48 >>> 0) << 24 >>> 24))); + integer = integer - (($imul(digit, (pow$1.$low >>> 0)) >>> 0)) >>> 0; + currentDiff = (x$19 = $shiftLeft64(new $Uint64(0, integer), shift), new $Uint64(x$19.$high + fraction.$high, x$19.$low + fraction.$low)); + if ((currentDiff.$high < allowance.$high || (currentDiff.$high === allowance.$high && currentDiff.$low < allowance.$low))) { + d.nd = i$2 + 1 >> 0; + d.dp = integerDigits + exp10 >> 0; + d.neg = f.neg; + return adjustLastDigit(d, currentDiff, targetDiff, allowance, $shiftLeft64(pow$1, shift), new $Uint64(0, 2)); + } + i$2 = i$2 + (1) >> 0; + } + d.nd = integerDigits; + d.dp = d.nd + exp10 >> 0; + d.neg = f.neg; + digit$1 = 0; + multiplier = new $Uint64(0, 1); + while (true) { + fraction = $mul64(fraction, (new $Uint64(0, 10))); + multiplier = $mul64(multiplier, (new $Uint64(0, 10))); + digit$1 = ($shiftRightUint64(fraction, shift).$low >> 0); + (x$20 = d.d, x$21 = d.nd, ((x$21 < 0 || x$21 >= x$20.$length) ? $throwRuntimeError("index out of range") : x$20.$array[x$20.$offset + x$21] = ((digit$1 + 48 >> 0) << 24 >>> 24))); + d.nd = d.nd + (1) >> 0; + fraction = (x$22 = $shiftLeft64(new $Uint64(0, digit$1), shift), new $Uint64(fraction.$high - x$22.$high, fraction.$low - x$22.$low)); + if ((x$23 = $mul64(allowance, multiplier), (fraction.$high < x$23.$high || (fraction.$high === x$23.$high && fraction.$low < x$23.$low)))) { + return adjustLastDigit(d, fraction, $mul64(targetDiff, multiplier), $mul64(allowance, multiplier), $shiftLeft64(new $Uint64(0, 1), shift), $mul64(multiplier, new $Uint64(0, 2))); + } + } + }; + extFloat.prototype.ShortestDecimal = function(d, lower, upper) { return this.$val.ShortestDecimal(d, lower, upper); }; + adjustLastDigit = function(d, currentDiff, targetDiff, maxDiff, ulpDecimal, ulpBinary) { + var $ptr, _index, currentDiff, d, maxDiff, targetDiff, ulpBinary, ulpDecimal, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + if ((x = $mul64(new $Uint64(0, 2), ulpBinary), (ulpDecimal.$high < x.$high || (ulpDecimal.$high === x.$high && ulpDecimal.$low < x.$low)))) { + return false; + } + while (true) { + if (!((x$1 = (x$2 = (x$3 = $div64(ulpDecimal, new $Uint64(0, 2), false), new $Uint64(currentDiff.$high + x$3.$high, currentDiff.$low + x$3.$low)), new $Uint64(x$2.$high + ulpBinary.$high, x$2.$low + ulpBinary.$low)), (x$1.$high < targetDiff.$high || (x$1.$high === targetDiff.$high && x$1.$low < targetDiff.$low))))) { break; } + _index = d.nd - 1 >> 0; + (x$5 = d.d, ((_index < 0 || _index >= x$5.$length) ? $throwRuntimeError("index out of range") : x$5.$array[x$5.$offset + _index] = ((x$4 = d.d, ((_index < 0 || _index >= x$4.$length) ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + _index])) - (1) << 24 >>> 24))); + currentDiff = (x$6 = ulpDecimal, new $Uint64(currentDiff.$high + x$6.$high, currentDiff.$low + x$6.$low)); + } + if ((x$7 = new $Uint64(currentDiff.$high + ulpDecimal.$high, currentDiff.$low + ulpDecimal.$low), x$8 = (x$9 = (x$10 = $div64(ulpDecimal, new $Uint64(0, 2), false), new $Uint64(targetDiff.$high + x$10.$high, targetDiff.$low + x$10.$low)), new $Uint64(x$9.$high + ulpBinary.$high, x$9.$low + ulpBinary.$low)), (x$7.$high < x$8.$high || (x$7.$high === x$8.$high && x$7.$low <= x$8.$low)))) { + return false; + } + if ((currentDiff.$high < ulpBinary.$high || (currentDiff.$high === ulpBinary.$high && currentDiff.$low < ulpBinary.$low)) || (x$11 = new $Uint64(maxDiff.$high - ulpBinary.$high, maxDiff.$low - ulpBinary.$low), (currentDiff.$high > x$11.$high || (currentDiff.$high === x$11.$high && currentDiff.$low > x$11.$low)))) { + return false; + } + if ((d.nd === 1) && ((x$12 = d.d, (0 >= x$12.$length ? $throwRuntimeError("index out of range") : x$12.$array[x$12.$offset + 0])) === 48)) { + d.nd = 0; + d.dp = 0; + } + return true; + }; + FormatFloat = function(f, fmt, prec, bitSize) { + var $ptr, bitSize, f, fmt, prec; + return $bytesToString(genericFtoa($makeSlice(sliceType$6, 0, max(prec + 4 >> 0, 24)), f, fmt, prec, bitSize)); + }; + $pkg.FormatFloat = FormatFloat; + AppendFloat = function(dst, f, fmt, prec, bitSize) { + var $ptr, bitSize, dst, f, fmt, prec; + return genericFtoa(dst, f, fmt, prec, bitSize); + }; + $pkg.AppendFloat = AppendFloat; + genericFtoa = function(dst, val, fmt, prec, bitSize) { + var $ptr, _1, _2, _3, _4, _tuple, bitSize, bits, buf, buf$1, digits, digs, dst, exp, f, f$1, flt, fmt, lower, mant, neg, ok, prec, s, shortest, upper, val, x, x$1, x$2, x$3, y, y$1; + bits = new $Uint64(0, 0); + flt = ptrType$1.nil; + _1 = bitSize; + if (_1 === (32)) { + bits = new $Uint64(0, math.Float32bits($fround(val))); + flt = float32info; + } else if (_1 === (64)) { + bits = math.Float64bits(val); + flt = float64info; + } else { + $panic(new $String("strconv: illegal AppendFloat/FormatFloat bitSize")); + } + neg = !((x = $shiftRightUint64(bits, ((flt.expbits + flt.mantbits >>> 0))), (x.$high === 0 && x.$low === 0))); + exp = ($shiftRightUint64(bits, flt.mantbits).$low >> 0) & ((((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)); + mant = (x$1 = (x$2 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$2.$high - 0, x$2.$low - 1)), new $Uint64(bits.$high & x$1.$high, (bits.$low & x$1.$low) >>> 0)); + _2 = exp; + if (_2 === ((((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0))) { + s = ""; + if (!((mant.$high === 0 && mant.$low === 0))) { + s = "NaN"; + } else if (neg) { + s = "-Inf"; + } else { + s = "+Inf"; + } + return $appendSlice(dst, s); + } else if (_2 === (0)) { + exp = exp + (1) >> 0; + } else { + mant = (x$3 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high | x$3.$high, (mant.$low | x$3.$low) >>> 0)); + } + exp = exp + (flt.bias) >> 0; + if (fmt === 98) { + return fmtB(dst, neg, mant, exp, flt); + } + if (!optimize) { + return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); + } + digs = new decimalSlice.ptr(sliceType$6.nil, 0, 0, false); + ok = false; + shortest = prec < 0; + if (shortest) { + f = new extFloat.ptr(new $Uint64(0, 0), 0, false); + _tuple = f.AssignComputeBounds(mant, exp, neg, flt); + lower = $clone(_tuple[0], extFloat); + upper = $clone(_tuple[1], extFloat); + buf = arrayType$2.zero(); + digs.d = new sliceType$6(buf); + ok = f.ShortestDecimal(digs, lower, upper); + if (!ok) { + return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); + } + _3 = fmt; + if ((_3 === (101)) || (_3 === (69))) { + prec = max(digs.nd - 1 >> 0, 0); + } else if (_3 === (102)) { + prec = max(digs.nd - digs.dp >> 0, 0); + } else if ((_3 === (103)) || (_3 === (71))) { + prec = digs.nd; + } + } else if (!((fmt === 102))) { + digits = prec; + _4 = fmt; + if ((_4 === (101)) || (_4 === (69))) { + digits = digits + (1) >> 0; + } else if ((_4 === (103)) || (_4 === (71))) { + if (prec === 0) { + prec = 1; + } + digits = prec; + } + if (digits <= 15) { + buf$1 = arrayType$1.zero(); + digs.d = new sliceType$6(buf$1); + f$1 = new extFloat.ptr(mant, exp - (flt.mantbits >> 0) >> 0, neg); + ok = f$1.FixedDecimal(digs, digits); + } + } + if (!ok) { + return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); + } + return formatDigits(dst, shortest, neg, digs, prec, fmt); + }; + bigFtoa = function(dst, prec, fmt, neg, mant, exp, flt) { + var $ptr, _5, _6, d, digs, dst, exp, flt, fmt, mant, neg, prec, shortest; + d = new decimal.ptr(arrayType.zero(), 0, 0, false, false); + d.Assign(mant); + d.Shift(exp - (flt.mantbits >> 0) >> 0); + digs = new decimalSlice.ptr(sliceType$6.nil, 0, 0, false); + shortest = prec < 0; + if (shortest) { + roundShortest(d, mant, exp, flt); + decimalSlice.copy(digs, new decimalSlice.ptr(new sliceType$6(d.d), d.nd, d.dp, false)); + _5 = fmt; + if ((_5 === (101)) || (_5 === (69))) { + prec = digs.nd - 1 >> 0; + } else if (_5 === (102)) { + prec = max(digs.nd - digs.dp >> 0, 0); + } else if ((_5 === (103)) || (_5 === (71))) { + prec = digs.nd; + } + } else { + _6 = fmt; + if ((_6 === (101)) || (_6 === (69))) { + d.Round(prec + 1 >> 0); + } else if (_6 === (102)) { + d.Round(d.dp + prec >> 0); + } else if ((_6 === (103)) || (_6 === (71))) { + if (prec === 0) { + prec = 1; + } + d.Round(prec); + } + decimalSlice.copy(digs, new decimalSlice.ptr(new sliceType$6(d.d), d.nd, d.dp, false)); + } + return formatDigits(dst, shortest, neg, digs, prec, fmt); + }; + formatDigits = function(dst, shortest, neg, digs, prec, fmt) { + var $ptr, _7, digs, dst, eprec, exp, fmt, neg, prec, shortest; + digs = $clone(digs, decimalSlice); + _7 = fmt; + if ((_7 === (101)) || (_7 === (69))) { + return fmtE(dst, neg, digs, prec, fmt); + } else if (_7 === (102)) { + return fmtF(dst, neg, digs, prec); + } else if ((_7 === (103)) || (_7 === (71))) { + eprec = prec; + if (eprec > digs.nd && digs.nd >= digs.dp) { + eprec = digs.nd; + } + if (shortest) { + eprec = 6; + } + exp = digs.dp - 1 >> 0; + if (exp < -4 || exp >= eprec) { + if (prec > digs.nd) { + prec = digs.nd; + } + return fmtE(dst, neg, digs, prec - 1 >> 0, (fmt + 101 << 24 >>> 24) - 103 << 24 >>> 24); + } + if (prec > digs.dp) { + prec = digs.nd; + } + return fmtF(dst, neg, digs, max(prec - digs.dp >> 0, 0)); + } + return $append(dst, 37, fmt); + }; + roundShortest = function(d, mant, exp, flt) { + var $ptr, d, exp, explo, flt, i, inclusive, l, lower, m, mant, mantlo, minexp, okdown, okup, u, upper, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; + if ((mant.$high === 0 && mant.$low === 0)) { + d.nd = 0; + return; + } + minexp = flt.bias + 1 >> 0; + if (exp > minexp && ($imul(332, ((d.dp - d.nd >> 0)))) >= ($imul(100, ((exp - (flt.mantbits >> 0) >> 0))))) { + return; + } + upper = new decimal.ptr(arrayType.zero(), 0, 0, false, false); + upper.Assign((x = $mul64(mant, new $Uint64(0, 2)), new $Uint64(x.$high + 0, x.$low + 1))); + upper.Shift((exp - (flt.mantbits >> 0) >> 0) - 1 >> 0); + mantlo = new $Uint64(0, 0); + explo = 0; + if ((x$1 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), (mant.$high > x$1.$high || (mant.$high === x$1.$high && mant.$low > x$1.$low))) || (exp === minexp)) { + mantlo = new $Uint64(mant.$high - 0, mant.$low - 1); + explo = exp; + } else { + mantlo = (x$2 = $mul64(mant, new $Uint64(0, 2)), new $Uint64(x$2.$high - 0, x$2.$low - 1)); + explo = exp - 1 >> 0; + } + lower = new decimal.ptr(arrayType.zero(), 0, 0, false, false); + lower.Assign((x$3 = $mul64(mantlo, new $Uint64(0, 2)), new $Uint64(x$3.$high + 0, x$3.$low + 1))); + lower.Shift((explo - (flt.mantbits >> 0) >> 0) - 1 >> 0); + inclusive = (x$4 = $div64(mant, new $Uint64(0, 2), true), (x$4.$high === 0 && x$4.$low === 0)); + i = 0; + while (true) { + if (!(i < d.nd)) { break; } + l = 48; + if (i < lower.nd) { + l = (x$5 = lower.d, ((i < 0 || i >= x$5.length) ? $throwRuntimeError("index out of range") : x$5[i])); + } + m = (x$6 = d.d, ((i < 0 || i >= x$6.length) ? $throwRuntimeError("index out of range") : x$6[i])); + u = 48; + if (i < upper.nd) { + u = (x$7 = upper.d, ((i < 0 || i >= x$7.length) ? $throwRuntimeError("index out of range") : x$7[i])); + } + okdown = !((l === m)) || inclusive && ((i + 1 >> 0) === lower.nd); + okup = !((m === u)) && (inclusive || (m + 1 << 24 >>> 24) < u || (i + 1 >> 0) < upper.nd); + if (okdown && okup) { + d.Round(i + 1 >> 0); + return; + } else if (okdown) { + d.RoundDown(i + 1 >> 0); + return; + } else if (okup) { + d.RoundUp(i + 1 >> 0); + return; + } + i = i + (1) >> 0; + } + }; + fmtE = function(dst, neg, d, prec, fmt) { + var $ptr, _q, _q$1, _q$2, _r, _r$1, _r$2, ch, d, dst, exp, fmt, i, m, neg, prec, x; + d = $clone(d, decimalSlice); + if (neg) { + dst = $append(dst, 45); + } + ch = 48; + if (!((d.nd === 0))) { + ch = (x = d.d, (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0])); + } + dst = $append(dst, ch); + if (prec > 0) { + dst = $append(dst, 46); + i = 1; + m = min(d.nd, prec + 1 >> 0); + if (i < m) { + dst = $appendSlice(dst, $subslice(d.d, i, m)); + i = m; + } + while (true) { + if (!(i <= prec)) { break; } + dst = $append(dst, 48); + i = i + (1) >> 0; + } + } + dst = $append(dst, fmt); + exp = d.dp - 1 >> 0; + if (d.nd === 0) { + exp = 0; + } + if (exp < 0) { + ch = 45; + exp = -exp; + } else { + ch = 43; + } + dst = $append(dst, ch); + if (exp < 10) { + dst = $append(dst, 48, (exp << 24 >>> 24) + 48 << 24 >>> 24); + } else if (exp < 100) { + dst = $append(dst, ((_q = exp / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24) + 48 << 24 >>> 24, ((_r = exp % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) << 24 >>> 24) + 48 << 24 >>> 24); + } else { + dst = $append(dst, ((_q$1 = exp / 100, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24) + 48 << 24 >>> 24, (_r$1 = ((_q$2 = exp / 10, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24) % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24, ((_r$2 = exp % 10, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24) + 48 << 24 >>> 24); + } + return dst; + }; + fmtF = function(dst, neg, d, prec) { + var $ptr, ch, d, dst, i, j, m, neg, prec, x; + d = $clone(d, decimalSlice); + if (neg) { + dst = $append(dst, 45); + } + if (d.dp > 0) { + m = min(d.nd, d.dp); + dst = $appendSlice(dst, $subslice(d.d, 0, m)); + while (true) { + if (!(m < d.dp)) { break; } + dst = $append(dst, 48); + m = m + (1) >> 0; + } + } else { + dst = $append(dst, 48); + } + if (prec > 0) { + dst = $append(dst, 46); + i = 0; + while (true) { + if (!(i < prec)) { break; } + ch = 48; + j = d.dp + i >> 0; + if (0 <= j && j < d.nd) { + ch = (x = d.d, ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j])); + } + dst = $append(dst, ch); + i = i + (1) >> 0; + } + } + return dst; + }; + fmtB = function(dst, neg, mant, exp, flt) { + var $ptr, _tuple, _tuple$1, dst, exp, flt, mant, neg; + if (neg) { + dst = $append(dst, 45); + } + _tuple = formatBits(dst, mant, 10, false, true); + dst = _tuple[0]; + dst = $append(dst, 112); + exp = exp - ((flt.mantbits >> 0)) >> 0; + if (exp >= 0) { + dst = $append(dst, 43); + } + _tuple$1 = formatBits(dst, new $Uint64(0, exp), 10, exp < 0, true); + dst = _tuple$1[0]; + return dst; + }; + min = function(a, b) { + var $ptr, a, b; + if (a < b) { + return a; + } + return b; + }; + max = function(a, b) { + var $ptr, a, b; + if (a > b) { + return a; + } + return b; + }; + FormatInt = function(i, base) { + var $ptr, _tuple, base, i, s; + _tuple = formatBits(sliceType$6.nil, new $Uint64(i.$high, i.$low), base, (i.$high < 0 || (i.$high === 0 && i.$low < 0)), false); + s = _tuple[1]; + return s; + }; + $pkg.FormatInt = FormatInt; + Itoa = function(i) { + var $ptr, i; + return FormatInt(new $Int64(0, i), 10); + }; + $pkg.Itoa = Itoa; + AppendInt = function(dst, i, base) { + var $ptr, _tuple, base, dst, i; + _tuple = formatBits(dst, new $Uint64(i.$high, i.$low), base, (i.$high < 0 || (i.$high === 0 && i.$low < 0)), true); + dst = _tuple[0]; + return dst; + }; + $pkg.AppendInt = AppendInt; + AppendUint = function(dst, i, base) { + var $ptr, _tuple, base, dst, i; + _tuple = formatBits(dst, i, base, false, true); + dst = _tuple[0]; + return dst; + }; + $pkg.AppendUint = AppendUint; + formatBits = function(dst, u, base, neg, append_) { + var $ptr, _q, _q$1, a, append_, b, b$1, base, d, dst, i, j, m, neg, q, q$1, q$2, qs, s, s$1, u, us, us$1, x, x$1; + d = sliceType$6.nil; + s = ""; + if (base < 2 || base > 36) { + $panic(new $String("strconv: illegal AppendInt/FormatInt base")); + } + a = arrayType$3.zero(); + i = 65; + if (neg) { + u = new $Uint64(-u.$high, -u.$low); + } + if (base === 10) { + if (true) { + while (true) { + if (!((u.$high > 0 || (u.$high === 0 && u.$low > 4294967295)))) { break; } + q = $div64(u, new $Uint64(0, 1000000000), false); + us = ((x = $mul64(q, new $Uint64(0, 1000000000)), new $Uint64(u.$high - x.$high, u.$low - x.$low)).$low >>> 0); + j = 9; + while (true) { + if (!(j > 0)) { break; } + i = i - (1) >> 0; + qs = (_q = us / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = (((us - ($imul(qs, 10) >>> 0) >>> 0) + 48 >>> 0) << 24 >>> 24)); + us = qs; + j = j - (1) >> 0; + } + u = q; + } + } + us$1 = (u.$low >>> 0); + while (true) { + if (!(us$1 >= 10)) { break; } + i = i - (1) >> 0; + q$1 = (_q$1 = us$1 / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); + ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = (((us$1 - ($imul(q$1, 10) >>> 0) >>> 0) + 48 >>> 0) << 24 >>> 24)); + us$1 = q$1; + } + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = ((us$1 + 48 >>> 0) << 24 >>> 24)); + } else { + s$1 = ((base < 0 || base >= shifts.length) ? $throwRuntimeError("index out of range") : shifts[base]); + if (s$1 > 0) { + b = new $Uint64(0, base); + m = (b.$low >>> 0) - 1 >>> 0; + while (true) { + if (!((u.$high > b.$high || (u.$high === b.$high && u.$low >= b.$low)))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((((u.$low >>> 0) & m) >>> 0))); + u = $shiftRightUint64(u, (s$1)); + } + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((u.$low >>> 0))); + } else { + b$1 = new $Uint64(0, base); + while (true) { + if (!((u.$high > b$1.$high || (u.$high === b$1.$high && u.$low >= b$1.$low)))) { break; } + i = i - (1) >> 0; + q$2 = $div64(u, b$1, false); + ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((x$1 = $mul64(q$2, b$1), new $Uint64(u.$high - x$1.$high, u.$low - x$1.$low)).$low >>> 0))); + u = q$2; + } + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((u.$low >>> 0))); + } + } + if (neg) { + i = i - (1) >> 0; + ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = 45); + } + if (append_) { + d = $appendSlice(dst, $subslice(new sliceType$6(a), i)); + return [d, s]; + } + s = $bytesToString($subslice(new sliceType$6(a), i)); + return [d, s]; + }; + quoteWith = function(s, quote, ASCIIonly, graphicOnly) { + var $ptr, ASCIIonly, _1, _q, _tuple, buf, graphicOnly, n, quote, r, runeTmp, s, s$1, s$2, width; + runeTmp = arrayType$4.zero(); + buf = $makeSlice(sliceType$6, 0, (_q = ($imul(3, s.length)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); + buf = $append(buf, quote); + width = 0; + while (true) { + if (!(s.length > 0)) { break; } + r = (s.charCodeAt(0) >> 0); + width = 1; + if (r >= 128) { + _tuple = utf8.DecodeRuneInString(s); + r = _tuple[0]; + width = _tuple[1]; + } + if ((width === 1) && (r === 65533)) { + buf = $appendSlice(buf, "\\x"); + buf = $append(buf, "0123456789abcdef".charCodeAt((s.charCodeAt(0) >>> 4 << 24 >>> 24))); + buf = $append(buf, "0123456789abcdef".charCodeAt(((s.charCodeAt(0) & 15) >>> 0))); + s = s.substring(width); + continue; + } + if ((r === (quote >> 0)) || (r === 92)) { + buf = $append(buf, 92); + buf = $append(buf, (r << 24 >>> 24)); + s = s.substring(width); + continue; + } + if (ASCIIonly) { + if (r < 128 && IsPrint(r)) { + buf = $append(buf, (r << 24 >>> 24)); + s = s.substring(width); + continue; + } + } else if (IsPrint(r) || graphicOnly && isInGraphicList(r)) { + n = utf8.EncodeRune(new sliceType$6(runeTmp), r); + buf = $appendSlice(buf, $subslice(new sliceType$6(runeTmp), 0, n)); + s = s.substring(width); + continue; + } + _1 = r; + if (_1 === (7)) { + buf = $appendSlice(buf, "\\a"); + } else if (_1 === (8)) { + buf = $appendSlice(buf, "\\b"); + } else if (_1 === (12)) { + buf = $appendSlice(buf, "\\f"); + } else if (_1 === (10)) { + buf = $appendSlice(buf, "\\n"); + } else if (_1 === (13)) { + buf = $appendSlice(buf, "\\r"); + } else if (_1 === (9)) { + buf = $appendSlice(buf, "\\t"); + } else if (_1 === (11)) { + buf = $appendSlice(buf, "\\v"); + } else { + if (r < 32) { + buf = $appendSlice(buf, "\\x"); + buf = $append(buf, "0123456789abcdef".charCodeAt((s.charCodeAt(0) >>> 4 << 24 >>> 24))); + buf = $append(buf, "0123456789abcdef".charCodeAt(((s.charCodeAt(0) & 15) >>> 0))); + } else if (r > 1114111) { + r = 65533; + buf = $appendSlice(buf, "\\u"); + s$1 = 12; + while (true) { + if (!(s$1 >= 0)) { break; } + buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min((s$1 >>> 0), 31)) >> 0) & 15))); + s$1 = s$1 - (4) >> 0; + } + } else if (r < 65536) { + buf = $appendSlice(buf, "\\u"); + s$1 = 12; + while (true) { + if (!(s$1 >= 0)) { break; } + buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min((s$1 >>> 0), 31)) >> 0) & 15))); + s$1 = s$1 - (4) >> 0; + } + } else { + buf = $appendSlice(buf, "\\U"); + s$2 = 28; + while (true) { + if (!(s$2 >= 0)) { break; } + buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min((s$2 >>> 0), 31)) >> 0) & 15))); + s$2 = s$2 - (4) >> 0; + } + } + } + s = s.substring(width); + } + buf = $append(buf, quote); + return $bytesToString(buf); + }; + Quote = function(s) { + var $ptr, s; + return quoteWith(s, 34, false, false); + }; + $pkg.Quote = Quote; + QuoteToASCII = function(s) { + var $ptr, s; + return quoteWith(s, 34, true, false); + }; + $pkg.QuoteToASCII = QuoteToASCII; + QuoteRune = function(r) { + var $ptr, r; + return quoteWith($encodeRune(r), 39, false, false); + }; + $pkg.QuoteRune = QuoteRune; + AppendQuoteRune = function(dst, r) { + var $ptr, dst, r; + return $appendSlice(dst, QuoteRune(r)); + }; + $pkg.AppendQuoteRune = AppendQuoteRune; + QuoteRuneToASCII = function(r) { + var $ptr, r; + return quoteWith($encodeRune(r), 39, true, false); + }; + $pkg.QuoteRuneToASCII = QuoteRuneToASCII; + AppendQuoteRuneToASCII = function(dst, r) { + var $ptr, dst, r; + return $appendSlice(dst, QuoteRuneToASCII(r)); + }; + $pkg.AppendQuoteRuneToASCII = AppendQuoteRuneToASCII; + CanBackquote = function(s) { + var $ptr, _tuple, r, s, wid; + while (true) { + if (!(s.length > 0)) { break; } + _tuple = utf8.DecodeRuneInString(s); + r = _tuple[0]; + wid = _tuple[1]; + s = s.substring(wid); + if (wid > 1) { + if (r === 65279) { + return false; + } + continue; + } + if (r === 65533) { + return false; + } + if ((r < 32 && !((r === 9))) || (r === 96) || (r === 127)) { + return false; + } + } + return true; + }; + $pkg.CanBackquote = CanBackquote; + unhex = function(b) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, c, ok, v; + v = 0; + ok = false; + c = (b >> 0); + if (48 <= c && c <= 57) { + _tmp = c - 48 >> 0; + _tmp$1 = true; + v = _tmp; + ok = _tmp$1; + return [v, ok]; + } else if (97 <= c && c <= 102) { + _tmp$2 = (c - 97 >> 0) + 10 >> 0; + _tmp$3 = true; + v = _tmp$2; + ok = _tmp$3; + return [v, ok]; + } else if (65 <= c && c <= 70) { + _tmp$4 = (c - 65 >> 0) + 10 >> 0; + _tmp$5 = true; + v = _tmp$4; + ok = _tmp$5; + return [v, ok]; + } + return [v, ok]; + }; + UnquoteChar = function(s, quote) { + var $ptr, _2, _3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, c, c$1, err, j, j$1, multibyte, n, ok, quote, r, s, size, tail, v, v$1, value, x, x$1; + value = 0; + multibyte = false; + tail = ""; + err = $ifaceNil; + c = s.charCodeAt(0); + if ((c === quote) && ((quote === 39) || (quote === 34))) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } else if (c >= 128) { + _tuple = utf8.DecodeRuneInString(s); + r = _tuple[0]; + size = _tuple[1]; + _tmp = r; + _tmp$1 = true; + _tmp$2 = s.substring(size); + _tmp$3 = $ifaceNil; + value = _tmp; + multibyte = _tmp$1; + tail = _tmp$2; + err = _tmp$3; + return [value, multibyte, tail, err]; + } else if (!((c === 92))) { + _tmp$4 = (s.charCodeAt(0) >> 0); + _tmp$5 = false; + _tmp$6 = s.substring(1); + _tmp$7 = $ifaceNil; + value = _tmp$4; + multibyte = _tmp$5; + tail = _tmp$6; + err = _tmp$7; + return [value, multibyte, tail, err]; + } + if (s.length <= 1) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + c$1 = s.charCodeAt(1); + s = s.substring(2); + switch (0) { default: + _2 = c$1; + if (_2 === (97)) { + value = 7; + } else if (_2 === (98)) { + value = 8; + } else if (_2 === (102)) { + value = 12; + } else if (_2 === (110)) { + value = 10; + } else if (_2 === (114)) { + value = 13; + } else if (_2 === (116)) { + value = 9; + } else if (_2 === (118)) { + value = 11; + } else if ((_2 === (120)) || (_2 === (117)) || (_2 === (85))) { + n = 0; + _3 = c$1; + if (_3 === (120)) { + n = 2; + } else if (_3 === (117)) { + n = 4; + } else if (_3 === (85)) { + n = 8; + } + v = 0; + if (s.length < n) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + j = 0; + while (true) { + if (!(j < n)) { break; } + _tuple$1 = unhex(s.charCodeAt(j)); + x = _tuple$1[0]; + ok = _tuple$1[1]; + if (!ok) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + v = (v << 4 >> 0) | x; + j = j + (1) >> 0; + } + s = s.substring(n); + if (c$1 === 120) { + value = v; + break; + } + if (v > 1114111) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + value = v; + multibyte = true; + } else if ((_2 === (48)) || (_2 === (49)) || (_2 === (50)) || (_2 === (51)) || (_2 === (52)) || (_2 === (53)) || (_2 === (54)) || (_2 === (55))) { + v$1 = (c$1 >> 0) - 48 >> 0; + if (s.length < 2) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + j$1 = 0; + while (true) { + if (!(j$1 < 2)) { break; } + x$1 = (s.charCodeAt(j$1) >> 0) - 48 >> 0; + if (x$1 < 0 || x$1 > 7) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + v$1 = ((v$1 << 3 >> 0)) | x$1; + j$1 = j$1 + (1) >> 0; + } + s = s.substring(2); + if (v$1 > 255) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + value = v$1; + } else if (_2 === (92)) { + value = 92; + } else if ((_2 === (39)) || (_2 === (34))) { + if (!((c$1 === quote))) { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + value = (c$1 >> 0); + } else { + err = $pkg.ErrSyntax; + return [value, multibyte, tail, err]; + } + } + tail = s; + return [value, multibyte, tail, err]; + }; + $pkg.UnquoteChar = UnquoteChar; + Unquote = function(s) { + var $ptr, _4, _q, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, buf, c, err, err$1, multibyte, n, n$1, quote, r, runeTmp, s, size, ss, t; + t = ""; + err = $ifaceNil; + n = s.length; + if (n < 2) { + _tmp = ""; + _tmp$1 = $pkg.ErrSyntax; + t = _tmp; + err = _tmp$1; + return [t, err]; + } + quote = s.charCodeAt(0); + if (!((quote === s.charCodeAt((n - 1 >> 0))))) { + _tmp$2 = ""; + _tmp$3 = $pkg.ErrSyntax; + t = _tmp$2; + err = _tmp$3; + return [t, err]; + } + s = s.substring(1, (n - 1 >> 0)); + if (quote === 96) { + if (contains(s, 96)) { + _tmp$4 = ""; + _tmp$5 = $pkg.ErrSyntax; + t = _tmp$4; + err = _tmp$5; + return [t, err]; + } + _tmp$6 = s; + _tmp$7 = $ifaceNil; + t = _tmp$6; + err = _tmp$7; + return [t, err]; + } + if (!((quote === 34)) && !((quote === 39))) { + _tmp$8 = ""; + _tmp$9 = $pkg.ErrSyntax; + t = _tmp$8; + err = _tmp$9; + return [t, err]; + } + if (contains(s, 10)) { + _tmp$10 = ""; + _tmp$11 = $pkg.ErrSyntax; + t = _tmp$10; + err = _tmp$11; + return [t, err]; + } + if (!contains(s, 92) && !contains(s, quote)) { + _4 = quote; + if (_4 === (34)) { + _tmp$12 = s; + _tmp$13 = $ifaceNil; + t = _tmp$12; + err = _tmp$13; + return [t, err]; + } else if (_4 === (39)) { + _tuple = utf8.DecodeRuneInString(s); + r = _tuple[0]; + size = _tuple[1]; + if ((size === s.length) && (!((r === 65533)) || !((size === 1)))) { + _tmp$14 = s; + _tmp$15 = $ifaceNil; + t = _tmp$14; + err = _tmp$15; + return [t, err]; + } + } + } + runeTmp = arrayType$4.zero(); + buf = $makeSlice(sliceType$6, 0, (_q = ($imul(3, s.length)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); + while (true) { + if (!(s.length > 0)) { break; } + _tuple$1 = UnquoteChar(s, quote); + c = _tuple$1[0]; + multibyte = _tuple$1[1]; + ss = _tuple$1[2]; + err$1 = _tuple$1[3]; + if (!($interfaceIsEqual(err$1, $ifaceNil))) { + _tmp$16 = ""; + _tmp$17 = err$1; + t = _tmp$16; + err = _tmp$17; + return [t, err]; + } + s = ss; + if (c < 128 || !multibyte) { + buf = $append(buf, (c << 24 >>> 24)); + } else { + n$1 = utf8.EncodeRune(new sliceType$6(runeTmp), c); + buf = $appendSlice(buf, $subslice(new sliceType$6(runeTmp), 0, n$1)); + } + if ((quote === 39) && !((s.length === 0))) { + _tmp$18 = ""; + _tmp$19 = $pkg.ErrSyntax; + t = _tmp$18; + err = _tmp$19; + return [t, err]; + } + } + _tmp$20 = $bytesToString(buf); + _tmp$21 = $ifaceNil; + t = _tmp$20; + err = _tmp$21; + return [t, err]; + }; + $pkg.Unquote = Unquote; + contains = function(s, c) { + var $ptr, c, i, s; + i = 0; + while (true) { + if (!(i < s.length)) { break; } + if (s.charCodeAt(i) === c) { + return true; + } + i = i + (1) >> 0; + } + return false; + }; + bsearch16 = function(a, x) { + var $ptr, _q, _tmp, _tmp$1, a, h, i, j, x; + _tmp = 0; + _tmp$1 = a.$length; + i = _tmp; + j = _tmp$1; + while (true) { + if (!(i < j)) { break; } + h = i + (_q = ((j - i >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; + if (((h < 0 || h >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + h]) < x) { + i = h + 1 >> 0; + } else { + j = h; + } + } + return i; + }; + bsearch32 = function(a, x) { + var $ptr, _q, _tmp, _tmp$1, a, h, i, j, x; + _tmp = 0; + _tmp$1 = a.$length; + i = _tmp; + j = _tmp$1; + while (true) { + if (!(i < j)) { break; } + h = i + (_q = ((j - i >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; + if (((h < 0 || h >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + h]) < x) { + i = h + 1 >> 0; + } else { + j = h; + } + } + return i; + }; + IsPrint = function(r) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, i, i$1, isNotPrint, isNotPrint$1, isPrint, isPrint$1, j, j$1, r, rr, rr$1, x, x$1, x$2, x$3; + if (r <= 255) { + if (32 <= r && r <= 126) { + return true; + } + if (161 <= r && r <= 255) { + return !((r === 173)); + } + return false; + } + if (0 <= r && r < 65536) { + _tmp = (r << 16 >>> 16); + _tmp$1 = isPrint16; + _tmp$2 = isNotPrint16; + rr = _tmp; + isPrint = _tmp$1; + isNotPrint = _tmp$2; + i = bsearch16(isPrint, rr); + if (i >= isPrint.$length || rr < (x = (i & ~1) >> 0, ((x < 0 || x >= isPrint.$length) ? $throwRuntimeError("index out of range") : isPrint.$array[isPrint.$offset + x])) || (x$1 = i | 1, ((x$1 < 0 || x$1 >= isPrint.$length) ? $throwRuntimeError("index out of range") : isPrint.$array[isPrint.$offset + x$1])) < rr) { + return false; + } + j = bsearch16(isNotPrint, rr); + return j >= isNotPrint.$length || !((((j < 0 || j >= isNotPrint.$length) ? $throwRuntimeError("index out of range") : isNotPrint.$array[isNotPrint.$offset + j]) === rr)); + } + _tmp$3 = (r >>> 0); + _tmp$4 = isPrint32; + _tmp$5 = isNotPrint32; + rr$1 = _tmp$3; + isPrint$1 = _tmp$4; + isNotPrint$1 = _tmp$5; + i$1 = bsearch32(isPrint$1, rr$1); + if (i$1 >= isPrint$1.$length || rr$1 < (x$2 = (i$1 & ~1) >> 0, ((x$2 < 0 || x$2 >= isPrint$1.$length) ? $throwRuntimeError("index out of range") : isPrint$1.$array[isPrint$1.$offset + x$2])) || (x$3 = i$1 | 1, ((x$3 < 0 || x$3 >= isPrint$1.$length) ? $throwRuntimeError("index out of range") : isPrint$1.$array[isPrint$1.$offset + x$3])) < rr$1) { + return false; + } + if (r >= 131072) { + return true; + } + r = r - (65536) >> 0; + j$1 = bsearch16(isNotPrint$1, (r << 16 >>> 16)); + return j$1 >= isNotPrint$1.$length || !((((j$1 < 0 || j$1 >= isNotPrint$1.$length) ? $throwRuntimeError("index out of range") : isNotPrint$1.$array[isNotPrint$1.$offset + j$1]) === (r << 16 >>> 16))); + }; + $pkg.IsPrint = IsPrint; + isInGraphicList = function(r) { + var $ptr, i, r, rr; + if (r > 65535) { + return false; + } + rr = (r << 16 >>> 16); + i = bsearch16(isGraphic, rr); + return i < isGraphic.$length && (rr === ((i < 0 || i >= isGraphic.$length) ? $throwRuntimeError("index out of range") : isGraphic.$array[isGraphic.$offset + i])); + }; + ptrType.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$2.methods = [{prop: "set", name: "set", pkg: "strconv", typ: $funcType([$String], [$Bool], false)}, {prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType$1], [$Uint64, $Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Assign", name: "Assign", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "Shift", name: "Shift", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundDown", name: "RoundDown", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundUp", name: "RoundUp", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundedInteger", name: "RoundedInteger", pkg: "", typ: $funcType([], [$Uint64], false)}]; + ptrType$4.methods = [{prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType$1], [$Uint64, $Bool], false)}, {prop: "AssignComputeBounds", name: "AssignComputeBounds", pkg: "", typ: $funcType([$Uint64, $Int, $Bool, ptrType$1], [extFloat, extFloat], false)}, {prop: "Normalize", name: "Normalize", pkg: "", typ: $funcType([], [$Uint], false)}, {prop: "Multiply", name: "Multiply", pkg: "", typ: $funcType([extFloat], [], false)}, {prop: "AssignDecimal", name: "AssignDecimal", pkg: "", typ: $funcType([$Uint64, $Int, $Bool, $Bool, ptrType$1], [$Bool], false)}, {prop: "frexp10", name: "frexp10", pkg: "strconv", typ: $funcType([], [$Int, $Int], false)}, {prop: "FixedDecimal", name: "FixedDecimal", pkg: "", typ: $funcType([ptrType$3, $Int], [$Bool], false)}, {prop: "ShortestDecimal", name: "ShortestDecimal", pkg: "", typ: $funcType([ptrType$3, ptrType$4, ptrType$4], [$Bool], false)}]; + NumError.init([{prop: "Func", name: "Func", pkg: "", typ: $String, tag: ""}, {prop: "Num", name: "Num", pkg: "", typ: $String, tag: ""}, {prop: "Err", name: "Err", pkg: "", typ: $error, tag: ""}]); + decimal.init([{prop: "d", name: "d", pkg: "strconv", typ: arrayType, tag: ""}, {prop: "nd", name: "nd", pkg: "strconv", typ: $Int, tag: ""}, {prop: "dp", name: "dp", pkg: "strconv", typ: $Int, tag: ""}, {prop: "neg", name: "neg", pkg: "strconv", typ: $Bool, tag: ""}, {prop: "trunc", name: "trunc", pkg: "strconv", typ: $Bool, tag: ""}]); + leftCheat.init([{prop: "delta", name: "delta", pkg: "strconv", typ: $Int, tag: ""}, {prop: "cutoff", name: "cutoff", pkg: "strconv", typ: $String, tag: ""}]); + extFloat.init([{prop: "mant", name: "mant", pkg: "strconv", typ: $Uint64, tag: ""}, {prop: "exp", name: "exp", pkg: "strconv", typ: $Int, tag: ""}, {prop: "neg", name: "neg", pkg: "strconv", typ: $Bool, tag: ""}]); + floatInfo.init([{prop: "mantbits", name: "mantbits", pkg: "strconv", typ: $Uint, tag: ""}, {prop: "expbits", name: "expbits", pkg: "strconv", typ: $Uint, tag: ""}, {prop: "bias", name: "bias", pkg: "strconv", typ: $Int, tag: ""}]); + decimalSlice.init([{prop: "d", name: "d", pkg: "strconv", typ: sliceType$6, tag: ""}, {prop: "nd", name: "nd", pkg: "strconv", typ: $Int, tag: ""}, {prop: "dp", name: "dp", pkg: "strconv", typ: $Int, tag: ""}, {prop: "neg", name: "neg", pkg: "strconv", typ: $Bool, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = math.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf8.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + optimize = true; + powtab = new sliceType([1, 3, 6, 9, 13, 16, 19, 23, 26]); + float64pow10 = new sliceType$1([1, 10, 100, 1000, 10000, 100000, 1e+06, 1e+07, 1e+08, 1e+09, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, 1e+21, 1e+22]); + float32pow10 = new sliceType$2([1, 10, 100, 1000, 10000, 100000, 1e+06, 1e+07, 1e+08, 1e+09, 1e+10]); + $pkg.ErrRange = errors.New("value out of range"); + $pkg.ErrSyntax = errors.New("invalid syntax"); + leftcheats = new sliceType$3([new leftCheat.ptr(0, ""), new leftCheat.ptr(1, "5"), new leftCheat.ptr(1, "25"), new leftCheat.ptr(1, "125"), new leftCheat.ptr(2, "625"), new leftCheat.ptr(2, "3125"), new leftCheat.ptr(2, "15625"), new leftCheat.ptr(3, "78125"), new leftCheat.ptr(3, "390625"), new leftCheat.ptr(3, "1953125"), new leftCheat.ptr(4, "9765625"), new leftCheat.ptr(4, "48828125"), new leftCheat.ptr(4, "244140625"), new leftCheat.ptr(4, "1220703125"), new leftCheat.ptr(5, "6103515625"), new leftCheat.ptr(5, "30517578125"), new leftCheat.ptr(5, "152587890625"), new leftCheat.ptr(6, "762939453125"), new leftCheat.ptr(6, "3814697265625"), new leftCheat.ptr(6, "19073486328125"), new leftCheat.ptr(7, "95367431640625"), new leftCheat.ptr(7, "476837158203125"), new leftCheat.ptr(7, "2384185791015625"), new leftCheat.ptr(7, "11920928955078125"), new leftCheat.ptr(8, "59604644775390625"), new leftCheat.ptr(8, "298023223876953125"), new leftCheat.ptr(8, "1490116119384765625"), new leftCheat.ptr(9, "7450580596923828125"), new leftCheat.ptr(9, "37252902984619140625"), new leftCheat.ptr(9, "186264514923095703125"), new leftCheat.ptr(10, "931322574615478515625"), new leftCheat.ptr(10, "4656612873077392578125"), new leftCheat.ptr(10, "23283064365386962890625"), new leftCheat.ptr(10, "116415321826934814453125"), new leftCheat.ptr(11, "582076609134674072265625"), new leftCheat.ptr(11, "2910383045673370361328125"), new leftCheat.ptr(11, "14551915228366851806640625"), new leftCheat.ptr(12, "72759576141834259033203125"), new leftCheat.ptr(12, "363797880709171295166015625"), new leftCheat.ptr(12, "1818989403545856475830078125"), new leftCheat.ptr(13, "9094947017729282379150390625"), new leftCheat.ptr(13, "45474735088646411895751953125"), new leftCheat.ptr(13, "227373675443232059478759765625"), new leftCheat.ptr(13, "1136868377216160297393798828125"), new leftCheat.ptr(14, "5684341886080801486968994140625"), new leftCheat.ptr(14, "28421709430404007434844970703125"), new leftCheat.ptr(14, "142108547152020037174224853515625"), new leftCheat.ptr(15, "710542735760100185871124267578125"), new leftCheat.ptr(15, "3552713678800500929355621337890625"), new leftCheat.ptr(15, "17763568394002504646778106689453125"), new leftCheat.ptr(16, "88817841970012523233890533447265625"), new leftCheat.ptr(16, "444089209850062616169452667236328125"), new leftCheat.ptr(16, "2220446049250313080847263336181640625"), new leftCheat.ptr(16, "11102230246251565404236316680908203125"), new leftCheat.ptr(17, "55511151231257827021181583404541015625"), new leftCheat.ptr(17, "277555756156289135105907917022705078125"), new leftCheat.ptr(17, "1387778780781445675529539585113525390625"), new leftCheat.ptr(18, "6938893903907228377647697925567626953125"), new leftCheat.ptr(18, "34694469519536141888238489627838134765625"), new leftCheat.ptr(18, "173472347597680709441192448139190673828125"), new leftCheat.ptr(19, "867361737988403547205962240695953369140625")]); + smallPowersOfTen = $toNativeArray($kindStruct, [new extFloat.ptr(new $Uint64(2147483648, 0), -63, false), new extFloat.ptr(new $Uint64(2684354560, 0), -60, false), new extFloat.ptr(new $Uint64(3355443200, 0), -57, false), new extFloat.ptr(new $Uint64(4194304000, 0), -54, false), new extFloat.ptr(new $Uint64(2621440000, 0), -50, false), new extFloat.ptr(new $Uint64(3276800000, 0), -47, false), new extFloat.ptr(new $Uint64(4096000000, 0), -44, false), new extFloat.ptr(new $Uint64(2560000000, 0), -40, false)]); + powersOfTen = $toNativeArray($kindStruct, [new extFloat.ptr(new $Uint64(4203730336, 136053384), -1220, false), new extFloat.ptr(new $Uint64(3132023167, 2722021238), -1193, false), new extFloat.ptr(new $Uint64(2333539104, 810921078), -1166, false), new extFloat.ptr(new $Uint64(3477244234, 1573795306), -1140, false), new extFloat.ptr(new $Uint64(2590748842, 1432697645), -1113, false), new extFloat.ptr(new $Uint64(3860516611, 1025131999), -1087, false), new extFloat.ptr(new $Uint64(2876309015, 3348809418), -1060, false), new extFloat.ptr(new $Uint64(4286034428, 3200048207), -1034, false), new extFloat.ptr(new $Uint64(3193344495, 1097586188), -1007, false), new extFloat.ptr(new $Uint64(2379227053, 2424306748), -980, false), new extFloat.ptr(new $Uint64(3545324584, 827693699), -954, false), new extFloat.ptr(new $Uint64(2641472655, 2913388981), -927, false), new extFloat.ptr(new $Uint64(3936100983, 602835915), -901, false), new extFloat.ptr(new $Uint64(2932623761, 1081627501), -874, false), new extFloat.ptr(new $Uint64(2184974969, 1572261463), -847, false), new extFloat.ptr(new $Uint64(3255866422, 1308317239), -821, false), new extFloat.ptr(new $Uint64(2425809519, 944281679), -794, false), new extFloat.ptr(new $Uint64(3614737867, 629291719), -768, false), new extFloat.ptr(new $Uint64(2693189581, 2545915892), -741, false), new extFloat.ptr(new $Uint64(4013165208, 388672741), -715, false), new extFloat.ptr(new $Uint64(2990041083, 708162190), -688, false), new extFloat.ptr(new $Uint64(2227754207, 3536207675), -661, false), new extFloat.ptr(new $Uint64(3319612455, 450088378), -635, false), new extFloat.ptr(new $Uint64(2473304014, 3139815830), -608, false), new extFloat.ptr(new $Uint64(3685510180, 2103616900), -582, false), new extFloat.ptr(new $Uint64(2745919064, 224385782), -555, false), new extFloat.ptr(new $Uint64(4091738259, 3737383206), -529, false), new extFloat.ptr(new $Uint64(3048582568, 2868871352), -502, false), new extFloat.ptr(new $Uint64(2271371013, 1820084875), -475, false), new extFloat.ptr(new $Uint64(3384606560, 885076051), -449, false), new extFloat.ptr(new $Uint64(2521728396, 2444895829), -422, false), new extFloat.ptr(new $Uint64(3757668132, 1881767613), -396, false), new extFloat.ptr(new $Uint64(2799680927, 3102062735), -369, false), new extFloat.ptr(new $Uint64(4171849679, 2289335700), -343, false), new extFloat.ptr(new $Uint64(3108270227, 2410191823), -316, false), new extFloat.ptr(new $Uint64(2315841784, 3205436779), -289, false), new extFloat.ptr(new $Uint64(3450873173, 1697722806), -263, false), new extFloat.ptr(new $Uint64(2571100870, 3497754540), -236, false), new extFloat.ptr(new $Uint64(3831238852, 707476230), -210, false), new extFloat.ptr(new $Uint64(2854495385, 1769181907), -183, false), new extFloat.ptr(new $Uint64(4253529586, 2197867022), -157, false), new extFloat.ptr(new $Uint64(3169126500, 2450594539), -130, false), new extFloat.ptr(new $Uint64(2361183241, 1867548876), -103, false), new extFloat.ptr(new $Uint64(3518437208, 3793315116), -77, false), new extFloat.ptr(new $Uint64(2621440000, 0), -50, false), new extFloat.ptr(new $Uint64(3906250000, 0), -24, false), new extFloat.ptr(new $Uint64(2910383045, 2892103680), 3, false), new extFloat.ptr(new $Uint64(2168404344, 4170451332), 30, false), new extFloat.ptr(new $Uint64(3231174267, 3372684723), 56, false), new extFloat.ptr(new $Uint64(2407412430, 2078956656), 83, false), new extFloat.ptr(new $Uint64(3587324068, 2884206696), 109, false), new extFloat.ptr(new $Uint64(2672764710, 395977285), 136, false), new extFloat.ptr(new $Uint64(3982729777, 3569679143), 162, false), new extFloat.ptr(new $Uint64(2967364920, 2361961896), 189, false), new extFloat.ptr(new $Uint64(2210859150, 447440347), 216, false), new extFloat.ptr(new $Uint64(3294436857, 1114709402), 242, false), new extFloat.ptr(new $Uint64(2454546732, 2786846552), 269, false), new extFloat.ptr(new $Uint64(3657559652, 443583978), 295, false), new extFloat.ptr(new $Uint64(2725094297, 2599384906), 322, false), new extFloat.ptr(new $Uint64(4060706939, 3028118405), 348, false), new extFloat.ptr(new $Uint64(3025462433, 2044532855), 375, false), new extFloat.ptr(new $Uint64(2254145170, 1536935362), 402, false), new extFloat.ptr(new $Uint64(3358938053, 3365297469), 428, false), new extFloat.ptr(new $Uint64(2502603868, 4204241075), 455, false), new extFloat.ptr(new $Uint64(3729170365, 2577424355), 481, false), new extFloat.ptr(new $Uint64(2778448436, 3677981733), 508, false), new extFloat.ptr(new $Uint64(4140210802, 2744688476), 534, false), new extFloat.ptr(new $Uint64(3084697427, 1424604878), 561, false), new extFloat.ptr(new $Uint64(2298278679, 4062331362), 588, false), new extFloat.ptr(new $Uint64(3424702107, 3546052773), 614, false), new extFloat.ptr(new $Uint64(2551601907, 2065781727), 641, false), new extFloat.ptr(new $Uint64(3802183132, 2535403578), 667, false), new extFloat.ptr(new $Uint64(2832847187, 1558426518), 694, false), new extFloat.ptr(new $Uint64(4221271257, 2762425404), 720, false), new extFloat.ptr(new $Uint64(3145092172, 2812560400), 747, false), new extFloat.ptr(new $Uint64(2343276271, 3057687578), 774, false), new extFloat.ptr(new $Uint64(3491753744, 2790753324), 800, false), new extFloat.ptr(new $Uint64(2601559269, 3918606633), 827, false), new extFloat.ptr(new $Uint64(3876625403, 2711358621), 853, false), new extFloat.ptr(new $Uint64(2888311001, 1648096297), 880, false), new extFloat.ptr(new $Uint64(2151959390, 2057817989), 907, false), new extFloat.ptr(new $Uint64(3206669376, 61660461), 933, false), new extFloat.ptr(new $Uint64(2389154863, 1581580175), 960, false), new extFloat.ptr(new $Uint64(3560118173, 2626467905), 986, false), new extFloat.ptr(new $Uint64(2652494738, 3034782633), 1013, false), new extFloat.ptr(new $Uint64(3952525166, 3135207385), 1039, false), new extFloat.ptr(new $Uint64(2944860731, 2616258155), 1066, false)]); + uint64pow10 = $toNativeArray($kindUint64, [new $Uint64(0, 1), new $Uint64(0, 10), new $Uint64(0, 100), new $Uint64(0, 1000), new $Uint64(0, 10000), new $Uint64(0, 100000), new $Uint64(0, 1000000), new $Uint64(0, 10000000), new $Uint64(0, 100000000), new $Uint64(0, 1000000000), new $Uint64(2, 1410065408), new $Uint64(23, 1215752192), new $Uint64(232, 3567587328), new $Uint64(2328, 1316134912), new $Uint64(23283, 276447232), new $Uint64(232830, 2764472320), new $Uint64(2328306, 1874919424), new $Uint64(23283064, 1569325056), new $Uint64(232830643, 2808348672), new $Uint64(2328306436, 2313682944)]); + float32info = new floatInfo.ptr(23, 8, -127); + float64info = new floatInfo.ptr(52, 11, -1023); + isPrint16 = new sliceType$4([32, 126, 161, 887, 890, 895, 900, 1366, 1369, 1418, 1421, 1479, 1488, 1514, 1520, 1524, 1542, 1563, 1566, 1805, 1808, 1866, 1869, 1969, 1984, 2042, 2048, 2093, 2096, 2139, 2142, 2142, 2208, 2228, 2275, 2444, 2447, 2448, 2451, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2531, 2534, 2555, 2561, 2570, 2575, 2576, 2579, 2617, 2620, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2654, 2662, 2677, 2689, 2745, 2748, 2765, 2768, 2768, 2784, 2787, 2790, 2801, 2809, 2809, 2817, 2828, 2831, 2832, 2835, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2915, 2918, 2935, 2946, 2954, 2958, 2965, 2969, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3021, 3024, 3024, 3031, 3031, 3046, 3066, 3072, 3129, 3133, 3149, 3157, 3162, 3168, 3171, 3174, 3183, 3192, 3257, 3260, 3277, 3285, 3286, 3294, 3299, 3302, 3314, 3329, 3386, 3389, 3406, 3415, 3415, 3423, 3427, 3430, 3445, 3449, 3455, 3458, 3478, 3482, 3517, 3520, 3526, 3530, 3530, 3535, 3551, 3558, 3567, 3570, 3572, 3585, 3642, 3647, 3675, 3713, 3716, 3719, 3722, 3725, 3725, 3732, 3751, 3754, 3773, 3776, 3789, 3792, 3801, 3804, 3807, 3840, 3948, 3953, 4058, 4096, 4295, 4301, 4301, 4304, 4685, 4688, 4701, 4704, 4749, 4752, 4789, 4792, 4805, 4808, 4885, 4888, 4954, 4957, 4988, 4992, 5017, 5024, 5109, 5112, 5117, 5120, 5788, 5792, 5880, 5888, 5908, 5920, 5942, 5952, 5971, 5984, 6003, 6016, 6109, 6112, 6121, 6128, 6137, 6144, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6443, 6448, 6459, 6464, 6464, 6468, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6622, 6683, 6686, 6780, 6783, 6793, 6800, 6809, 6816, 6829, 6832, 6846, 6912, 6987, 6992, 7036, 7040, 7155, 7164, 7223, 7227, 7241, 7245, 7295, 7360, 7367, 7376, 7417, 7424, 7669, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8061, 8064, 8147, 8150, 8175, 8178, 8190, 8208, 8231, 8240, 8286, 8304, 8305, 8308, 8348, 8352, 8382, 8400, 8432, 8448, 8587, 8592, 9210, 9216, 9254, 9280, 9290, 9312, 11123, 11126, 11157, 11160, 11193, 11197, 11217, 11244, 11247, 11264, 11507, 11513, 11559, 11565, 11565, 11568, 11623, 11631, 11632, 11647, 11670, 11680, 11842, 11904, 12019, 12032, 12245, 12272, 12283, 12289, 12438, 12441, 12543, 12549, 12589, 12593, 12730, 12736, 12771, 12784, 19893, 19904, 40917, 40960, 42124, 42128, 42182, 42192, 42539, 42560, 42743, 42752, 42925, 42928, 42935, 42999, 43051, 43056, 43065, 43072, 43127, 43136, 43204, 43214, 43225, 43232, 43261, 43264, 43347, 43359, 43388, 43392, 43481, 43486, 43574, 43584, 43597, 43600, 43609, 43612, 43714, 43739, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43877, 43888, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64449, 64467, 64831, 64848, 64911, 64914, 64967, 65008, 65021, 65024, 65049, 65056, 65131, 65136, 65276, 65281, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65504, 65518, 65532, 65533]); + isNotPrint16 = new sliceType$4([173, 907, 909, 930, 1328, 1376, 1416, 1424, 1757, 2111, 2436, 2473, 2481, 2526, 2564, 2601, 2609, 2612, 2615, 2621, 2653, 2692, 2702, 2706, 2729, 2737, 2740, 2758, 2762, 2820, 2857, 2865, 2868, 2910, 2948, 2961, 2971, 2973, 3017, 3076, 3085, 3089, 3113, 3141, 3145, 3159, 3200, 3204, 3213, 3217, 3241, 3252, 3269, 3273, 3295, 3312, 3332, 3341, 3345, 3397, 3401, 3460, 3506, 3516, 3541, 3543, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3770, 3781, 3783, 3912, 3992, 4029, 4045, 4294, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 4881, 5760, 5901, 5997, 6001, 6431, 6751, 7415, 8024, 8026, 8028, 8030, 8117, 8133, 8156, 8181, 8335, 11209, 11311, 11359, 11558, 11687, 11695, 11703, 11711, 11719, 11727, 11735, 11743, 11930, 12352, 12687, 12831, 13055, 43470, 43519, 43815, 43823, 64311, 64317, 64319, 64322, 64325, 65107, 65127, 65141, 65511]); + isPrint32 = new sliceType$5([65536, 65613, 65616, 65629, 65664, 65786, 65792, 65794, 65799, 65843, 65847, 65932, 65936, 65947, 65952, 65952, 66000, 66045, 66176, 66204, 66208, 66256, 66272, 66299, 66304, 66339, 66352, 66378, 66384, 66426, 66432, 66499, 66504, 66517, 66560, 66717, 66720, 66729, 66816, 66855, 66864, 66915, 66927, 66927, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67640, 67644, 67644, 67647, 67742, 67751, 67759, 67808, 67829, 67835, 67867, 67871, 67897, 67903, 67903, 67968, 68023, 68028, 68047, 68050, 68102, 68108, 68147, 68152, 68154, 68159, 68167, 68176, 68184, 68192, 68255, 68288, 68326, 68331, 68342, 68352, 68405, 68409, 68437, 68440, 68466, 68472, 68497, 68505, 68508, 68521, 68527, 68608, 68680, 68736, 68786, 68800, 68850, 68858, 68863, 69216, 69246, 69632, 69709, 69714, 69743, 69759, 69825, 69840, 69864, 69872, 69881, 69888, 69955, 69968, 70006, 70016, 70093, 70096, 70132, 70144, 70205, 70272, 70313, 70320, 70378, 70384, 70393, 70400, 70412, 70415, 70416, 70419, 70457, 70460, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70784, 70855, 70864, 70873, 71040, 71093, 71096, 71133, 71168, 71236, 71248, 71257, 71296, 71351, 71360, 71369, 71424, 71449, 71453, 71467, 71472, 71487, 71840, 71922, 71935, 71935, 72384, 72440, 73728, 74649, 74752, 74868, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92777, 92782, 92783, 92880, 92909, 92912, 92917, 92928, 92997, 93008, 93047, 93053, 93071, 93952, 94020, 94032, 94078, 94095, 94111, 110592, 110593, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113820, 113823, 118784, 119029, 119040, 119078, 119081, 119154, 119163, 119272, 119296, 119365, 119552, 119638, 119648, 119665, 119808, 119967, 119970, 119970, 119973, 119974, 119977, 120074, 120077, 120134, 120138, 120485, 120488, 120779, 120782, 121483, 121499, 121519, 124928, 125124, 125127, 125142, 126464, 126500, 126503, 126523, 126530, 126530, 126535, 126548, 126551, 126564, 126567, 126619, 126625, 126651, 126704, 126705, 126976, 127019, 127024, 127123, 127136, 127150, 127153, 127221, 127232, 127244, 127248, 127339, 127344, 127386, 127462, 127490, 127504, 127546, 127552, 127560, 127568, 127569, 127744, 128720, 128736, 128748, 128752, 128755, 128768, 128883, 128896, 128980, 129024, 129035, 129040, 129095, 129104, 129113, 129120, 129159, 129168, 129197, 129296, 129304, 129408, 129412, 129472, 129472, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 194560, 195101, 917760, 917999]); + isNotPrint32 = new sliceType$4([12, 39, 59, 62, 926, 2057, 2102, 2134, 2291, 2564, 2580, 2584, 4285, 4405, 4576, 4626, 4743, 4745, 4750, 4766, 4868, 4905, 4913, 4916, 9327, 27231, 27482, 27490, 54357, 54429, 54445, 54458, 54460, 54468, 54534, 54549, 54557, 54586, 54591, 54597, 54609, 55968, 60932, 60960, 60963, 60968, 60979, 60984, 60986, 61000, 61002, 61004, 61008, 61011, 61016, 61018, 61020, 61022, 61024, 61027, 61035, 61043, 61048, 61053, 61055, 61066, 61092, 61098, 61632, 61648, 61743, 62842, 62884]); + isGraphic = new sliceType$4([160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288]); + shifts = $toNativeArray($kindUint, [0, 0, 1, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0]); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["reflect"] = (function() { + var $pkg = {}, $init, errors, js, math, runtime, strconv, sync, mapIter, Type, Kind, rtype, typeAlg, method, uncommonType, ChanDir, arrayType, chanType, funcType, imethod, interfaceType, mapType, ptrType, sliceType, structField, structType, Method, StructField, StructTag, fieldScan, Value, flag, ValueError, nonEmptyInterface, ptrType$1, sliceType$1, sliceType$2, ptrType$3, funcType$1, sliceType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, sliceType$4, sliceType$5, sliceType$6, structType$6, sliceType$7, sliceType$8, ptrType$8, arrayType$1, structType$7, ptrType$9, sliceType$9, ptrType$10, ptrType$11, ptrType$12, sliceType$11, sliceType$12, ptrType$13, sliceType$13, ptrType$18, sliceType$15, funcType$3, funcType$4, funcType$5, arrayType$3, ptrType$20, initialized, stringPtrMap, callHelper, jsObjectPtr, selectHelper, kindNames, uint8Type, init, jsType, reflectType, setKindType, newStringPtr, isWrapped, copyStruct, makeValue, MakeSlice, TypeOf, ValueOf, SliceOf, Zero, unsafe_New, makeInt, typedmemmove, keyFor, mapaccess, mapassign, mapdelete, mapiterinit, mapiterkey, mapiternext, maplen, cvtDirect, methodReceiver, valueInterface, ifaceE2I, methodName, makeMethodValue, wrapJsObject, unwrapJsObject, getJsTag, chanrecv, chansend, PtrTo, implements$1, directlyAssignable, haveIdenticalUnderlyingType, toType, ifaceIndir, overflowFloat32, New, convertOp, makeFloat, makeComplex, makeString, makeBytes, makeRunes, cvtInt, cvtUint, cvtFloatInt, cvtFloatUint, cvtIntFloat, cvtUintFloat, cvtFloat, cvtComplex, cvtIntString, cvtUintString, cvtBytesString, cvtStringBytes, cvtRunesString, cvtStringRunes, cvtT2I, cvtI2I; + errors = $packages["errors"]; + js = $packages["github.com/gopherjs/gopherjs/js"]; + math = $packages["math"]; + runtime = $packages["runtime"]; + strconv = $packages["strconv"]; + sync = $packages["sync"]; + mapIter = $pkg.mapIter = $newType(0, $kindStruct, "reflect.mapIter", "mapIter", "reflect", function(t_, m_, keys_, i_) { + this.$val = this; + if (arguments.length === 0) { + this.t = $ifaceNil; + this.m = null; + this.keys = null; + this.i = 0; + return; + } + this.t = t_; + this.m = m_; + this.keys = keys_; + this.i = i_; + }); + Type = $pkg.Type = $newType(8, $kindInterface, "reflect.Type", "Type", "reflect", null); + Kind = $pkg.Kind = $newType(4, $kindUint, "reflect.Kind", "Kind", "reflect", null); + rtype = $pkg.rtype = $newType(0, $kindStruct, "reflect.rtype", "rtype", "reflect", function(size_, ptrdata_, hash_, _$3_, align_, fieldAlign_, kind_, alg_, gcdata_, string_, uncommonType_, ptrToThis_) { + this.$val = this; + if (arguments.length === 0) { + this.size = 0; + this.ptrdata = 0; + this.hash = 0; + this._$3 = 0; + this.align = 0; + this.fieldAlign = 0; + this.kind = 0; + this.alg = ptrType$4.nil; + this.gcdata = ptrType$5.nil; + this.string = ptrType$6.nil; + this.uncommonType = ptrType$7.nil; + this.ptrToThis = ptrType$1.nil; + return; + } + this.size = size_; + this.ptrdata = ptrdata_; + this.hash = hash_; + this._$3 = _$3_; + this.align = align_; + this.fieldAlign = fieldAlign_; + this.kind = kind_; + this.alg = alg_; + this.gcdata = gcdata_; + this.string = string_; + this.uncommonType = uncommonType_; + this.ptrToThis = ptrToThis_; + }); + typeAlg = $pkg.typeAlg = $newType(0, $kindStruct, "reflect.typeAlg", "typeAlg", "reflect", function(hash_, equal_) { + this.$val = this; + if (arguments.length === 0) { + this.hash = $throwNilPointerError; + this.equal = $throwNilPointerError; + return; + } + this.hash = hash_; + this.equal = equal_; + }); + method = $pkg.method = $newType(0, $kindStruct, "reflect.method", "method", "reflect", function(name_, pkgPath_, mtyp_, typ_, ifn_, tfn_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ptrType$6.nil; + this.pkgPath = ptrType$6.nil; + this.mtyp = ptrType$1.nil; + this.typ = ptrType$1.nil; + this.ifn = 0; + this.tfn = 0; + return; + } + this.name = name_; + this.pkgPath = pkgPath_; + this.mtyp = mtyp_; + this.typ = typ_; + this.ifn = ifn_; + this.tfn = tfn_; + }); + uncommonType = $pkg.uncommonType = $newType(0, $kindStruct, "reflect.uncommonType", "uncommonType", "reflect", function(name_, pkgPath_, methods_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ptrType$6.nil; + this.pkgPath = ptrType$6.nil; + this.methods = sliceType$4.nil; + return; + } + this.name = name_; + this.pkgPath = pkgPath_; + this.methods = methods_; + }); + ChanDir = $pkg.ChanDir = $newType(4, $kindInt, "reflect.ChanDir", "ChanDir", "reflect", null); + arrayType = $pkg.arrayType = $newType(0, $kindStruct, "reflect.arrayType", "arrayType", "reflect", function(rtype_, elem_, slice_, len_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); + this.elem = ptrType$1.nil; + this.slice = ptrType$1.nil; + this.len = 0; + return; + } + this.rtype = rtype_; + this.elem = elem_; + this.slice = slice_; + this.len = len_; + }); + chanType = $pkg.chanType = $newType(0, $kindStruct, "reflect.chanType", "chanType", "reflect", function(rtype_, elem_, dir_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); + this.elem = ptrType$1.nil; + this.dir = 0; + return; + } + this.rtype = rtype_; + this.elem = elem_; + this.dir = dir_; + }); + funcType = $pkg.funcType = $newType(0, $kindStruct, "reflect.funcType", "funcType", "reflect", function(rtype_, dotdotdot_, in$2_, out_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); + this.dotdotdot = false; + this.in$2 = sliceType$1.nil; + this.out = sliceType$1.nil; + return; + } + this.rtype = rtype_; + this.dotdotdot = dotdotdot_; + this.in$2 = in$2_; + this.out = out_; + }); + imethod = $pkg.imethod = $newType(0, $kindStruct, "reflect.imethod", "imethod", "reflect", function(name_, pkgPath_, typ_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ptrType$6.nil; + this.pkgPath = ptrType$6.nil; + this.typ = ptrType$1.nil; + return; + } + this.name = name_; + this.pkgPath = pkgPath_; + this.typ = typ_; + }); + interfaceType = $pkg.interfaceType = $newType(0, $kindStruct, "reflect.interfaceType", "interfaceType", "reflect", function(rtype_, methods_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); + this.methods = sliceType$5.nil; + return; + } + this.rtype = rtype_; + this.methods = methods_; + }); + mapType = $pkg.mapType = $newType(0, $kindStruct, "reflect.mapType", "mapType", "reflect", function(rtype_, key_, elem_, bucket_, hmap_, keysize_, indirectkey_, valuesize_, indirectvalue_, bucketsize_, reflexivekey_, needkeyupdate_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); + this.key = ptrType$1.nil; + this.elem = ptrType$1.nil; + this.bucket = ptrType$1.nil; + this.hmap = ptrType$1.nil; + this.keysize = 0; + this.indirectkey = 0; + this.valuesize = 0; + this.indirectvalue = 0; + this.bucketsize = 0; + this.reflexivekey = false; + this.needkeyupdate = false; + return; + } + this.rtype = rtype_; + this.key = key_; + this.elem = elem_; + this.bucket = bucket_; + this.hmap = hmap_; + this.keysize = keysize_; + this.indirectkey = indirectkey_; + this.valuesize = valuesize_; + this.indirectvalue = indirectvalue_; + this.bucketsize = bucketsize_; + this.reflexivekey = reflexivekey_; + this.needkeyupdate = needkeyupdate_; + }); + ptrType = $pkg.ptrType = $newType(0, $kindStruct, "reflect.ptrType", "ptrType", "reflect", function(rtype_, elem_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); + this.elem = ptrType$1.nil; + return; + } + this.rtype = rtype_; + this.elem = elem_; + }); + sliceType = $pkg.sliceType = $newType(0, $kindStruct, "reflect.sliceType", "sliceType", "reflect", function(rtype_, elem_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); + this.elem = ptrType$1.nil; + return; + } + this.rtype = rtype_; + this.elem = elem_; + }); + structField = $pkg.structField = $newType(0, $kindStruct, "reflect.structField", "structField", "reflect", function(name_, pkgPath_, typ_, tag_, offset_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ptrType$6.nil; + this.pkgPath = ptrType$6.nil; + this.typ = ptrType$1.nil; + this.tag = ptrType$6.nil; + this.offset = 0; + return; + } + this.name = name_; + this.pkgPath = pkgPath_; + this.typ = typ_; + this.tag = tag_; + this.offset = offset_; + }); + structType = $pkg.structType = $newType(0, $kindStruct, "reflect.structType", "structType", "reflect", function(rtype_, fields_) { + this.$val = this; + if (arguments.length === 0) { + this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); + this.fields = sliceType$6.nil; + return; + } + this.rtype = rtype_; + this.fields = fields_; + }); + Method = $pkg.Method = $newType(0, $kindStruct, "reflect.Method", "Method", "reflect", function(Name_, PkgPath_, Type_, Func_, Index_) { + this.$val = this; + if (arguments.length === 0) { + this.Name = ""; + this.PkgPath = ""; + this.Type = $ifaceNil; + this.Func = new Value.ptr(ptrType$1.nil, 0, 0); + this.Index = 0; + return; + } + this.Name = Name_; + this.PkgPath = PkgPath_; + this.Type = Type_; + this.Func = Func_; + this.Index = Index_; + }); + StructField = $pkg.StructField = $newType(0, $kindStruct, "reflect.StructField", "StructField", "reflect", function(Name_, PkgPath_, Type_, Tag_, Offset_, Index_, Anonymous_) { + this.$val = this; + if (arguments.length === 0) { + this.Name = ""; + this.PkgPath = ""; + this.Type = $ifaceNil; + this.Tag = ""; + this.Offset = 0; + this.Index = sliceType$11.nil; + this.Anonymous = false; + return; + } + this.Name = Name_; + this.PkgPath = PkgPath_; + this.Type = Type_; + this.Tag = Tag_; + this.Offset = Offset_; + this.Index = Index_; + this.Anonymous = Anonymous_; + }); + StructTag = $pkg.StructTag = $newType(8, $kindString, "reflect.StructTag", "StructTag", "reflect", null); + fieldScan = $pkg.fieldScan = $newType(0, $kindStruct, "reflect.fieldScan", "fieldScan", "reflect", function(typ_, index_) { + this.$val = this; + if (arguments.length === 0) { + this.typ = ptrType$13.nil; + this.index = sliceType$11.nil; + return; + } + this.typ = typ_; + this.index = index_; + }); + Value = $pkg.Value = $newType(0, $kindStruct, "reflect.Value", "Value", "reflect", function(typ_, ptr_, flag_) { + this.$val = this; + if (arguments.length === 0) { + this.typ = ptrType$1.nil; + this.ptr = 0; + this.flag = 0; + return; + } + this.typ = typ_; + this.ptr = ptr_; + this.flag = flag_; + }); + flag = $pkg.flag = $newType(4, $kindUintptr, "reflect.flag", "flag", "reflect", null); + ValueError = $pkg.ValueError = $newType(0, $kindStruct, "reflect.ValueError", "ValueError", "reflect", function(Method_, Kind_) { + this.$val = this; + if (arguments.length === 0) { + this.Method = ""; + this.Kind = 0; + return; + } + this.Method = Method_; + this.Kind = Kind_; + }); + nonEmptyInterface = $pkg.nonEmptyInterface = $newType(0, $kindStruct, "reflect.nonEmptyInterface", "nonEmptyInterface", "reflect", function(itab_, word_) { + this.$val = this; + if (arguments.length === 0) { + this.itab = ptrType$9.nil; + this.word = 0; + return; + } + this.itab = itab_; + this.word = word_; + }); + ptrType$1 = $ptrType(rtype); + sliceType$1 = $sliceType(ptrType$1); + sliceType$2 = $sliceType($emptyInterface); + ptrType$3 = $ptrType(js.Object); + funcType$1 = $funcType([sliceType$2], [ptrType$3], true); + sliceType$3 = $sliceType($String); + ptrType$4 = $ptrType(typeAlg); + ptrType$5 = $ptrType($Uint8); + ptrType$6 = $ptrType($String); + ptrType$7 = $ptrType(uncommonType); + sliceType$4 = $sliceType(method); + sliceType$5 = $sliceType(imethod); + sliceType$6 = $sliceType(structField); + structType$6 = $structType([{prop: "str", name: "str", pkg: "reflect", typ: $String, tag: ""}]); + sliceType$7 = $sliceType(ptrType$3); + sliceType$8 = $sliceType(Value); + ptrType$8 = $ptrType(nonEmptyInterface); + arrayType$1 = $arrayType($UnsafePointer, 100000); + structType$7 = $structType([{prop: "ityp", name: "ityp", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "link", name: "link", pkg: "reflect", typ: $UnsafePointer, tag: ""}, {prop: "bad", name: "bad", pkg: "reflect", typ: $Int32, tag: ""}, {prop: "unused", name: "unused", pkg: "reflect", typ: $Int32, tag: ""}, {prop: "fun", name: "fun", pkg: "reflect", typ: arrayType$1, tag: ""}]); + ptrType$9 = $ptrType(structType$7); + sliceType$9 = $sliceType(sliceType$7); + ptrType$10 = $ptrType(method); + ptrType$11 = $ptrType(interfaceType); + ptrType$12 = $ptrType(imethod); + sliceType$11 = $sliceType($Int); + sliceType$12 = $sliceType(fieldScan); + ptrType$13 = $ptrType(structType); + sliceType$13 = $sliceType($Uint8); + ptrType$18 = $ptrType($UnsafePointer); + sliceType$15 = $sliceType($Int32); + funcType$3 = $funcType([$String], [$Bool], false); + funcType$4 = $funcType([$UnsafePointer, $Uintptr], [$Uintptr], false); + funcType$5 = $funcType([$UnsafePointer, $UnsafePointer], [$Bool], false); + arrayType$3 = $arrayType($Uintptr, 2); + ptrType$20 = $ptrType(ValueError); + init = function() { + var $ptr, used, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; used = $f.used; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + used = (function(i) { + var $ptr, i; + }); + $r = used((x = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), new x.constructor.elem(x))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$1 = new uncommonType.ptr(ptrType$6.nil, ptrType$6.nil, sliceType$4.nil), new x$1.constructor.elem(x$1))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$2 = new method.ptr(ptrType$6.nil, ptrType$6.nil, ptrType$1.nil, ptrType$1.nil, 0, 0), new x$2.constructor.elem(x$2))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$3 = new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), ptrType$1.nil, ptrType$1.nil, 0), new x$3.constructor.elem(x$3))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$4 = new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), ptrType$1.nil, 0), new x$4.constructor.elem(x$4))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$5 = new funcType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), false, sliceType$1.nil, sliceType$1.nil), new x$5.constructor.elem(x$5))); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$6 = new interfaceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), sliceType$5.nil), new x$6.constructor.elem(x$6))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$7 = new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, 0, 0, 0, 0, 0, false, false), new x$7.constructor.elem(x$7))); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$8 = new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), ptrType$1.nil), new x$8.constructor.elem(x$8))); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$9 = new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), ptrType$1.nil), new x$9.constructor.elem(x$9))); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$10 = new structType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), sliceType$6.nil), new x$10.constructor.elem(x$10))); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$11 = new imethod.ptr(ptrType$6.nil, ptrType$6.nil, ptrType$1.nil), new x$11.constructor.elem(x$11))); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = used((x$12 = new structField.ptr(ptrType$6.nil, ptrType$6.nil, ptrType$1.nil, ptrType$6.nil, 0), new x$12.constructor.elem(x$12))); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + initialized = true; + uint8Type = $assertType(TypeOf(new $Uint8(0)), ptrType$1); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: init }; } $f.$ptr = $ptr; $f.used = used; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; + }; + jsType = function(typ) { + var $ptr, typ; + return typ.jsType; + }; + reflectType = function(typ) { + var $ptr, _1, _i, _i$1, _i$2, _i$3, _i$4, _ref, _ref$1, _ref$2, _ref$3, _ref$4, dir, f, fields, i, i$1, i$2, i$3, i$4, imethods, in$1, m, m$1, methodSet, methods, out, params, reflectFields, reflectMethods, results, rt, t, typ; + if (typ.reflectType === undefined) { + rt = new rtype.ptr((($parseInt(typ.size) >> 0) >>> 0), 0, 0, 0, 0, 0, (($parseInt(typ.kind) >> 0) << 24 >>> 24), ptrType$4.nil, ptrType$5.nil, newStringPtr(typ.string), ptrType$7.nil, ptrType$1.nil); + rt.jsType = typ; + typ.reflectType = rt; + methodSet = $methodSet(typ); + if (!($internalize(typ.typeName, $String) === "") || !(($parseInt(methodSet.length) === 0))) { + reflectMethods = $makeSlice(sliceType$4, $parseInt(methodSet.length)); + _ref = reflectMethods; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + m = methodSet[i]; + t = m.typ; + method.copy(((i < 0 || i >= reflectMethods.$length) ? $throwRuntimeError("index out of range") : reflectMethods.$array[reflectMethods.$offset + i]), new method.ptr(newStringPtr(m.name), newStringPtr(m.pkg), reflectType(t), reflectType($funcType(new ($global.Array)(typ).concat(t.params), t.results, t.variadic)), 0, 0)); + _i++; + } + rt.uncommonType = new uncommonType.ptr(newStringPtr(typ.typeName), newStringPtr(typ.pkg), reflectMethods); + rt.uncommonType.jsType = typ; + } + _1 = rt.Kind(); + if (_1 === (17)) { + setKindType(rt, new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), reflectType(typ.elem), ptrType$1.nil, (($parseInt(typ.len) >> 0) >>> 0))); + } else if (_1 === (18)) { + dir = 3; + if (!!(typ.sendOnly)) { + dir = 2; + } + if (!!(typ.recvOnly)) { + dir = 1; + } + setKindType(rt, new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), reflectType(typ.elem), (dir >>> 0))); + } else if (_1 === (19)) { + params = typ.params; + in$1 = $makeSlice(sliceType$1, $parseInt(params.length)); + _ref$1 = in$1; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$1 = _i$1; + ((i$1 < 0 || i$1 >= in$1.$length) ? $throwRuntimeError("index out of range") : in$1.$array[in$1.$offset + i$1] = reflectType(params[i$1])); + _i$1++; + } + results = typ.results; + out = $makeSlice(sliceType$1, $parseInt(results.length)); + _ref$2 = out; + _i$2 = 0; + while (true) { + if (!(_i$2 < _ref$2.$length)) { break; } + i$2 = _i$2; + ((i$2 < 0 || i$2 >= out.$length) ? $throwRuntimeError("index out of range") : out.$array[out.$offset + i$2] = reflectType(results[i$2])); + _i$2++; + } + setKindType(rt, new funcType.ptr($clone(rt, rtype), !!(typ.variadic), in$1, out)); + } else if (_1 === (20)) { + methods = typ.methods; + imethods = $makeSlice(sliceType$5, $parseInt(methods.length)); + _ref$3 = imethods; + _i$3 = 0; + while (true) { + if (!(_i$3 < _ref$3.$length)) { break; } + i$3 = _i$3; + m$1 = methods[i$3]; + imethod.copy(((i$3 < 0 || i$3 >= imethods.$length) ? $throwRuntimeError("index out of range") : imethods.$array[imethods.$offset + i$3]), new imethod.ptr(newStringPtr(m$1.name), newStringPtr(m$1.pkg), reflectType(m$1.typ))); + _i$3++; + } + setKindType(rt, new interfaceType.ptr($clone(rt, rtype), imethods)); + } else if (_1 === (21)) { + setKindType(rt, new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), reflectType(typ.key), reflectType(typ.elem), ptrType$1.nil, ptrType$1.nil, 0, 0, 0, 0, 0, false, false)); + } else if (_1 === (22)) { + setKindType(rt, new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), reflectType(typ.elem))); + } else if (_1 === (23)) { + setKindType(rt, new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), reflectType(typ.elem))); + } else if (_1 === (25)) { + fields = typ.fields; + reflectFields = $makeSlice(sliceType$6, $parseInt(fields.length)); + _ref$4 = reflectFields; + _i$4 = 0; + while (true) { + if (!(_i$4 < _ref$4.$length)) { break; } + i$4 = _i$4; + f = fields[i$4]; + structField.copy(((i$4 < 0 || i$4 >= reflectFields.$length) ? $throwRuntimeError("index out of range") : reflectFields.$array[reflectFields.$offset + i$4]), new structField.ptr(newStringPtr(f.name), newStringPtr(f.pkg), reflectType(f.typ), newStringPtr(f.tag), (i$4 >>> 0))); + _i$4++; + } + setKindType(rt, new structType.ptr($clone(rt, rtype), reflectFields)); + } + } + return typ.reflectType; + }; + setKindType = function(rt, kindType) { + var $ptr, kindType, rt; + rt.kindType = kindType; + kindType.rtype = rt; + }; + newStringPtr = function(strObj) { + var $ptr, _entry, _key, _tuple, c, ok, ptr, str, str$24ptr, strObj; + c = new structType$6.ptr(""); + c.str = strObj; + str = c.str; + if (str === "") { + return ptrType$6.nil; + } + _tuple = (_entry = stringPtrMap[$String.keyFor(str)], _entry !== undefined ? [_entry.v, true] : [ptrType$6.nil, false]); + ptr = _tuple[0]; + ok = _tuple[1]; + if (!ok) { + ptr = (str$24ptr || (str$24ptr = new ptrType$6(function() { return str; }, function($v) { str = $v; }))); + _key = str; (stringPtrMap || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: ptr }; + } + return ptr; + }; + isWrapped = function(typ) { + var $ptr, typ; + return !!(jsType(typ).wrapped); + }; + copyStruct = function(dst, src, typ) { + var $ptr, dst, fields, i, prop, src, typ; + fields = jsType(typ).fields; + i = 0; + while (true) { + if (!(i < $parseInt(fields.length))) { break; } + prop = $internalize(fields[i].prop, $String); + dst[$externalize(prop, $String)] = src[$externalize(prop, $String)]; + i = i + (1) >> 0; + } + }; + makeValue = function(t, v, fl) { + var $ptr, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _v, _v$1, fl, rt, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _v = $f._v; _v$1 = $f._v$1; fl = $f.fl; rt = $f.rt; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + rt = _r; + _r$1 = t.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + if (_r$1 === 17) { _v$1 = true; $s = 5; continue s; } + _r$2 = t.Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v$1 = _r$2 === 25; case 5: + if (_v$1) { _v = true; $s = 4; continue s; } + _r$3 = t.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _v = _r$3 === 22; case 4: + /* */ if (_v) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (_v) { */ case 2: + _r$4 = t.Kind(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + /* */ $s = 10; case 10: + return new Value.ptr(rt, v, (fl | (_r$4 >>> 0)) >>> 0); + /* } */ case 3: + _r$5 = t.Kind(); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + /* */ $s = 12; case 12: + return new Value.ptr(rt, $newDataPointer(v, jsType(rt.ptrTo())), (((fl | (_r$5 >>> 0)) >>> 0) | 128) >>> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: makeValue }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._v = _v; $f._v$1 = _v$1; $f.fl = fl; $f.rt = rt; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + MakeSlice = function(typ, len, cap) { + var $ptr, _r, _r$1, cap, len, typ, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; cap = $f.cap; len = $f.len; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + typ = [typ]; + _r = typ[0].Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 23))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 23))) { */ case 1: + $panic(new $String("reflect.MakeSlice of non-slice type")); + /* } */ case 2: + if (len < 0) { + $panic(new $String("reflect.MakeSlice: negative len")); + } + if (cap < 0) { + $panic(new $String("reflect.MakeSlice: negative cap")); + } + if (len > cap) { + $panic(new $String("reflect.MakeSlice: len > cap")); + } + _r$1 = makeValue(typ[0], $makeSlice(jsType(typ[0]), len, cap, (function(typ) { return function $b() { + var $ptr, _r$1, _r$2, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r$1 = typ[0].Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = jsType(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ $s = 3; case 3: + return _r$2.zero(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.$s = $s; $f.$r = $r; return $f; + }; })(typ)), 0); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 5; case 5: + return _r$1; + /* */ } return; } if ($f === undefined) { $f = { $blk: MakeSlice }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.cap = cap; $f.len = len; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.MakeSlice = MakeSlice; + TypeOf = function(i) { + var $ptr, i; + if (!initialized) { + return new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); + } + if ($interfaceIsEqual(i, $ifaceNil)) { + return $ifaceNil; + } + return reflectType(i.constructor); + }; + $pkg.TypeOf = TypeOf; + ValueOf = function(i) { + var $ptr, _r, i, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + if ($interfaceIsEqual(i, $ifaceNil)) { + return new Value.ptr(ptrType$1.nil, 0, 0); + } + _r = makeValue(reflectType(i.constructor), i.$val, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: ValueOf }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.ValueOf = ValueOf; + rtype.ptr.prototype.ptrTo = function() { + var $ptr, t; + t = this; + return reflectType($ptrType(jsType(t))); + }; + rtype.prototype.ptrTo = function() { return this.$val.ptrTo(); }; + SliceOf = function(t) { + var $ptr, t; + return reflectType($sliceType(jsType(t))); + }; + $pkg.SliceOf = SliceOf; + Zero = function(typ) { + var $ptr, _r, typ, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = makeValue(typ, jsType(typ).zero(), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: Zero }; } $f.$ptr = $ptr; $f._r = _r; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Zero = Zero; + unsafe_New = function(typ) { + var $ptr, _3, typ; + _3 = typ.Kind(); + if (_3 === (25)) { + return new (jsType(typ).ptr)(); + } else if (_3 === (17)) { + return jsType(typ).zero(); + } else { + return $newDataPointer(jsType(typ).zero(), jsType(typ.ptrTo())); + } + }; + makeInt = function(f, bits, t) { + var $ptr, _4, _r, bits, f, ptr, t, typ, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _4 = $f._4; _r = $f._r; bits = $f.bits; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + typ = _r; + ptr = unsafe_New(typ); + _4 = typ.Kind(); + if (_4 === (3)) { + ptr.$set((bits.$low << 24 >> 24)); + } else if (_4 === (4)) { + ptr.$set((bits.$low << 16 >> 16)); + } else if ((_4 === (2)) || (_4 === (5))) { + ptr.$set((bits.$low >> 0)); + } else if (_4 === (6)) { + ptr.$set(new $Int64(bits.$high, bits.$low)); + } else if (_4 === (8)) { + ptr.$set((bits.$low << 24 >>> 24)); + } else if (_4 === (9)) { + ptr.$set((bits.$low << 16 >>> 16)); + } else if ((_4 === (7)) || (_4 === (10)) || (_4 === (12))) { + ptr.$set((bits.$low >>> 0)); + } else if (_4 === (11)) { + ptr.$set(bits); + } + return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | (typ.Kind() >>> 0)) >>> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: makeInt }; } $f.$ptr = $ptr; $f._4 = _4; $f._r = _r; $f.bits = bits; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; + }; + typedmemmove = function(t, dst, src) { + var $ptr, dst, src, t; + dst.$set(src.$get()); + }; + keyFor = function(t, key) { + var $ptr, k, key, kv, t; + kv = key; + if (!(kv.$get === undefined)) { + kv = kv.$get(); + } + k = $internalize(jsType(t.Key()).keyFor(kv), $String); + return [kv, k]; + }; + mapaccess = function(t, m, key) { + var $ptr, _tuple, entry, k, key, m, t; + _tuple = keyFor(t, key); + k = _tuple[1]; + entry = m[$externalize(k, $String)]; + if (entry === undefined) { + return 0; + } + return $newDataPointer(entry.v, jsType(PtrTo(t.Elem()))); + }; + mapassign = function(t, m, key, val) { + var $ptr, _r, _tuple, entry, et, jsVal, k, key, kv, m, newVal, t, val, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; entry = $f.entry; et = $f.et; jsVal = $f.jsVal; k = $f.k; key = $f.key; kv = $f.kv; m = $f.m; newVal = $f.newVal; t = $f.t; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _tuple = keyFor(t, key); + kv = _tuple[0]; + k = _tuple[1]; + jsVal = val.$get(); + et = t.Elem(); + _r = et.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (_r === 25) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_r === 25) { */ case 1: + newVal = jsType(et).zero(); + copyStruct(newVal, jsVal, et); + jsVal = newVal; + /* } */ case 2: + entry = new ($global.Object)(); + entry.k = kv; + entry.v = jsVal; + m[$externalize(k, $String)] = entry; + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: mapassign }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.entry = entry; $f.et = et; $f.jsVal = jsVal; $f.k = k; $f.key = key; $f.kv = kv; $f.m = m; $f.newVal = newVal; $f.t = t; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; + }; + mapdelete = function(t, m, key) { + var $ptr, _tuple, k, key, m, t; + _tuple = keyFor(t, key); + k = _tuple[1]; + delete m[$externalize(k, $String)]; + }; + mapiterinit = function(t, m) { + var $ptr, m, t; + return new mapIter.ptr(t, m, $keys(m), 0); + }; + mapiterkey = function(it) { + var $ptr, _r, _r$1, _r$2, it, iter, k, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; it = $f.it; iter = $f.iter; k = $f.k; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + iter = it; + k = iter.keys[iter.i]; + _r = iter.t.Key(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = PtrTo(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = jsType(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return $newDataPointer(iter.m[$externalize($internalize(k, $String), $String)].k, _r$2); + /* */ } return; } if ($f === undefined) { $f = { $blk: mapiterkey }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.it = it; $f.iter = iter; $f.k = k; $f.$s = $s; $f.$r = $r; return $f; + }; + mapiternext = function(it) { + var $ptr, it, iter; + iter = it; + iter.i = iter.i + (1) >> 0; + }; + maplen = function(m) { + var $ptr, m; + return $parseInt($keys(m).length); + }; + cvtDirect = function(v, typ) { + var $ptr, _6, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, k, slice, srcVal, typ, v, val, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _6 = $f._6; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; k = $f.k; slice = $f.slice; srcVal = $f.srcVal; typ = $f.typ; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + srcVal = v.object(); + /* */ if (srcVal === jsType(v.typ).nil) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (srcVal === jsType(v.typ).nil) { */ case 1: + _r = makeValue(typ, jsType(typ).nil, v.flag); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return _r; + /* } */ case 2: + val = null; + _r$1 = typ.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + k = _r$1; + _6 = k; + /* */ if (_6 === (23)) { $s = 7; continue; } + /* */ if (_6 === (22)) { $s = 8; continue; } + /* */ if (_6 === (25)) { $s = 9; continue; } + /* */ if ((_6 === (17)) || (_6 === (1)) || (_6 === (18)) || (_6 === (19)) || (_6 === (20)) || (_6 === (21)) || (_6 === (24))) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (_6 === (23)) { */ case 7: + slice = new (jsType(typ))(srcVal.$array); + slice.$offset = srcVal.$offset; + slice.$length = srcVal.$length; + slice.$capacity = srcVal.$capacity; + val = $newDataPointer(slice, jsType(PtrTo(typ))); + $s = 12; continue; + /* } else if (_6 === (22)) { */ case 8: + _r$2 = typ.Elem(); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = _r$2.Kind(); /* */ $s = 16; case 16: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (_r$3 === 25) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if (_r$3 === 25) { */ case 13: + _r$4 = typ.Elem(); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + /* */ if ($interfaceIsEqual(_r$4, v.typ.Elem())) { $s = 17; continue; } + /* */ $s = 18; continue; + /* if ($interfaceIsEqual(_r$4, v.typ.Elem())) { */ case 17: + val = srcVal; + /* break; */ $s = 5; continue; + /* } */ case 18: + val = new (jsType(typ))(); + _arg = val; + _arg$1 = srcVal; + _r$5 = typ.Elem(); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _arg$2 = _r$5; + $r = copyStruct(_arg, _arg$1, _arg$2); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* break; */ $s = 5; continue; + /* } */ case 14: + val = new (jsType(typ))(srcVal.$get, srcVal.$set); + $s = 12; continue; + /* } else if (_6 === (25)) { */ case 9: + val = new (jsType(typ).ptr)(); + copyStruct(val, srcVal, typ); + $s = 12; continue; + /* } else if ((_6 === (17)) || (_6 === (1)) || (_6 === (18)) || (_6 === (19)) || (_6 === (20)) || (_6 === (21)) || (_6 === (24))) { */ case 10: + val = v.ptr; + $s = 12; continue; + /* } else { */ case 11: + $panic(new ValueError.ptr("reflect.Convert", k)); + /* } */ case 12: + case 5: + _r$6 = typ.common(); /* */ $s = 22; case 22: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _r$7 = typ.Kind(); /* */ $s = 23; case 23: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + /* */ $s = 24; case 24: + return new Value.ptr(_r$6, val, (((v.flag & 224) >>> 0) | (_r$7 >>> 0)) >>> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtDirect }; } $f.$ptr = $ptr; $f._6 = _6; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f.k = k; $f.slice = slice; $f.srcVal = srcVal; $f.typ = typ; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; + }; + methodReceiver = function(op, v, i) { + var $ptr, fn, i, iface, m, m$1, op, prop, rcvr, rcvrtype, t, tt, ut, v, x, x$1; + rcvrtype = ptrType$1.nil; + t = ptrType$1.nil; + fn = 0; + v = v; + prop = ""; + if (v.typ.Kind() === 20) { + tt = v.typ.kindType; + if (i < 0 || i >= tt.methods.$length) { + $panic(new $String("reflect: internal error: invalid method index")); + } + m = (x = tt.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + if (!(m.pkgPath === ptrType$6.nil)) { + $panic(new $String("reflect: " + op + " of unexported method")); + } + iface = $pointerOfStructConversion(v.ptr, ptrType$8); + if (iface.itab === ptrType$9.nil) { + $panic(new $String("reflect: " + op + " of method on nil interface value")); + } + t = m.typ; + prop = m.name.$get(); + } else { + ut = v.typ.uncommonType.uncommon(); + if (ut === ptrType$7.nil || i < 0 || i >= ut.methods.$length) { + $panic(new $String("reflect: internal error: invalid method index")); + } + m$1 = (x$1 = ut.methods, ((i < 0 || i >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + i])); + if (!(m$1.pkgPath === ptrType$6.nil)) { + $panic(new $String("reflect: " + op + " of unexported method")); + } + t = m$1.mtyp; + prop = $internalize($methodSet(jsType(v.typ))[i].prop, $String); + } + rcvr = v.object(); + if (isWrapped(v.typ)) { + rcvr = new (jsType(v.typ))(rcvr); + } + fn = rcvr[$externalize(prop, $String)]; + return [rcvrtype, t, fn]; + }; + valueInterface = function(v, safe) { + var $ptr, _r, safe, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; safe = $f.safe; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + if (v.flag === 0) { + $panic(new ValueError.ptr("reflect.Value.Interface", 0)); + } + if (safe && !((((v.flag & 96) >>> 0) === 0))) { + $panic(new $String("reflect.Value.Interface: cannot return value obtained from unexported field or method")); + } + /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: + _r = makeMethodValue("Interface", v); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + v = _r; + /* } */ case 2: + if (isWrapped(v.typ)) { + return new (jsType(v.typ))(v.object()); + } + return v.object(); + /* */ } return; } if ($f === undefined) { $f = { $blk: valueInterface }; } $f.$ptr = $ptr; $f._r = _r; $f.safe = safe; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + ifaceE2I = function(t, src, dst) { + var $ptr, dst, src, t; + dst.$set(src); + }; + methodName = function() { + var $ptr; + return "?FIXME?"; + }; + makeMethodValue = function(op, v) { + var $ptr, _r, _tuple, fn, fv, op, rcvr, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; fn = $f.fn; fv = $f.fv; op = $f.op; rcvr = $f.rcvr; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + fn = [fn]; + rcvr = [rcvr]; + v = v; + if (((v.flag & 512) >>> 0) === 0) { + $panic(new $String("reflect: internal error: invalid use of makePartialFunc")); + } + _tuple = methodReceiver(op, v, (v.flag >> 0) >> 10 >> 0); + fn[0] = _tuple[2]; + rcvr[0] = v.object(); + if (isWrapped(v.typ)) { + rcvr[0] = new (jsType(v.typ))(rcvr[0]); + } + fv = $makeFunc((function(fn, rcvr) { return function(arguments$1) { + var $ptr, arguments$1; + return fn[0].apply(rcvr[0], $externalize(arguments$1, sliceType$7)); + }; })(fn, rcvr)); + _r = v.Type().common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return new Value.ptr(_r, fv, (((v.flag & 96) >>> 0) | 19) >>> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: makeMethodValue }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.fn = fn; $f.fv = fv; $f.op = op; $f.rcvr = rcvr; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + rtype.ptr.prototype.pointers = function() { + var $ptr, _7, t; + t = this; + _7 = t.Kind(); + if ((_7 === (22)) || (_7 === (21)) || (_7 === (18)) || (_7 === (19)) || (_7 === (25)) || (_7 === (17))) { + return true; + } else { + return false; + } + }; + rtype.prototype.pointers = function() { return this.$val.pointers(); }; + rtype.ptr.prototype.Comparable = function() { + var $ptr, _8, _r, _r$1, _r$2, i, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _8 = $f._8; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; i = $f.i; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = this; + _8 = t.Kind(); + /* */ if ((_8 === (19)) || (_8 === (23)) || (_8 === (21))) { $s = 2; continue; } + /* */ if (_8 === (17)) { $s = 3; continue; } + /* */ if (_8 === (25)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if ((_8 === (19)) || (_8 === (23)) || (_8 === (21))) { */ case 2: + return false; + /* } else if (_8 === (17)) { */ case 3: + _r = t.Elem().Comparable(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 7; case 7: + return _r; + /* } else if (_8 === (25)) { */ case 4: + i = 0; + /* while (true) { */ case 8: + /* if (!(i < t.NumField())) { break; } */ if(!(i < t.NumField())) { $s = 9; continue; } + _r$1 = t.Field(i); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = _r$1.Type.Comparable(); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ if (!_r$2) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (!_r$2) { */ case 10: + return false; + /* } */ case 11: + i = i + (1) >> 0; + /* } */ $s = 8; continue; case 9: + /* } */ case 5: + case 1: + return true; + /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Comparable }; } $f.$ptr = $ptr; $f._8 = _8; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.i = i; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + rtype.prototype.Comparable = function() { return this.$val.Comparable(); }; + uncommonType.ptr.prototype.Method = function(i) { + var $ptr, fl, fn, i, m, mt, p, prop, t, x; + m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + t = this; + if (t === ptrType$7.nil || i < 0 || i >= t.methods.$length) { + $panic(new $String("reflect: Method index out of range")); + } + p = (x = t.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + if (!(p.name === ptrType$6.nil)) { + m.Name = p.name.$get(); + } + fl = 19; + if (!(p.pkgPath === ptrType$6.nil)) { + m.PkgPath = p.pkgPath.$get(); + fl = (fl | (32)) >>> 0; + } + mt = p.typ; + m.Type = mt; + prop = $internalize($methodSet(t.jsType)[i].prop, $String); + fn = $makeFunc((function(arguments$1) { + var $ptr, arguments$1, rcvr; + rcvr = (0 >= arguments$1.$length ? $throwRuntimeError("index out of range") : arguments$1.$array[arguments$1.$offset + 0]); + return rcvr[$externalize(prop, $String)].apply(rcvr, $externalize($subslice(arguments$1, 1), sliceType$7)); + })); + m.Func = new Value.ptr(mt, fn, fl); + m.Index = i; + return m; + }; + uncommonType.prototype.Method = function(i) { return this.$val.Method(i); }; + Value.ptr.prototype.object = function() { + var $ptr, _9, newVal, v, val; + v = this; + if ((v.typ.Kind() === 17) || (v.typ.Kind() === 25)) { + return v.ptr; + } + if (!((((v.flag & 128) >>> 0) === 0))) { + val = v.ptr.$get(); + if (!(val === $ifaceNil) && !(val.constructor === jsType(v.typ))) { + switch (0) { default: + _9 = v.typ.Kind(); + if ((_9 === (11)) || (_9 === (6))) { + val = new (jsType(v.typ))(val.$high, val.$low); + } else if ((_9 === (15)) || (_9 === (16))) { + val = new (jsType(v.typ))(val.$real, val.$imag); + } else if (_9 === (23)) { + if (val === val.constructor.nil) { + val = jsType(v.typ).nil; + break; + } + newVal = new (jsType(v.typ))(val.$array); + newVal.$offset = val.$offset; + newVal.$length = val.$length; + newVal.$capacity = val.$capacity; + val = newVal; + } + } + } + return val; + } + return v.ptr; + }; + Value.prototype.object = function() { return this.$val.object(); }; + Value.ptr.prototype.call = function(op, in$1) { + var $ptr, _10, _arg, _arg$1, _arg$2, _arg$3, _i, _i$1, _i$2, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _tmp, _tmp$1, _tuple, arg, argsArray, elem, fn, i, i$1, i$2, i$3, in$1, isSlice, m, n, nin, nout, op, origIn, rcvr, results, ret, slice, t, targ, v, x, x$1, x$2, xt, xt$1, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _10 = $f._10; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; arg = $f.arg; argsArray = $f.argsArray; elem = $f.elem; fn = $f.fn; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; in$1 = $f.in$1; isSlice = $f.isSlice; m = $f.m; n = $f.n; nin = $f.nin; nout = $f.nout; op = $f.op; origIn = $f.origIn; rcvr = $f.rcvr; results = $f.results; ret = $f.ret; slice = $f.slice; t = $f.t; targ = $f.targ; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; xt = $f.xt; xt$1 = $f.xt$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + t = v.typ; + fn = 0; + rcvr = null; + if (!((((v.flag & 512) >>> 0) === 0))) { + _tuple = methodReceiver(op, v, (v.flag >> 0) >> 10 >> 0); + t = _tuple[1]; + fn = _tuple[2]; + rcvr = v.object(); + if (isWrapped(v.typ)) { + rcvr = new (jsType(v.typ))(rcvr); + } + } else { + fn = v.object(); + rcvr = undefined; + } + if (fn === 0) { + $panic(new $String("reflect.Value.Call: call of nil function")); + } + isSlice = op === "CallSlice"; + n = t.NumIn(); + if (isSlice) { + if (!t.IsVariadic()) { + $panic(new $String("reflect: CallSlice of non-variadic function")); + } + if (in$1.$length < n) { + $panic(new $String("reflect: CallSlice with too few input arguments")); + } + if (in$1.$length > n) { + $panic(new $String("reflect: CallSlice with too many input arguments")); + } + } else { + if (t.IsVariadic()) { + n = n - (1) >> 0; + } + if (in$1.$length < n) { + $panic(new $String("reflect: Call with too few input arguments")); + } + if (!t.IsVariadic() && in$1.$length > n) { + $panic(new $String("reflect: Call with too many input arguments")); + } + } + _ref = in$1; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + x = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (x.Kind() === 0) { + $panic(new $String("reflect: " + op + " using zero Value argument")); + } + _i++; + } + i = 0; + /* while (true) { */ case 1: + /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } + _tmp = ((i < 0 || i >= in$1.$length) ? $throwRuntimeError("index out of range") : in$1.$array[in$1.$offset + i]).Type(); + _tmp$1 = t.In(i); + xt = _tmp; + targ = _tmp$1; + _r = xt.AssignableTo(targ); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!_r) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (!_r) { */ case 3: + _r$1 = xt.String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = targ.String(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $panic(new $String("reflect: " + op + " using " + _r$1 + " as type " + _r$2)); + /* } */ case 4: + i = i + (1) >> 0; + /* } */ $s = 1; continue; case 2: + /* */ if (!isSlice && t.IsVariadic()) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (!isSlice && t.IsVariadic()) { */ case 8: + m = in$1.$length - n >> 0; + _r$3 = MakeSlice(t.In(n), m, m); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + slice = _r$3; + _r$4 = t.In(n).Elem(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + elem = _r$4; + i$1 = 0; + /* while (true) { */ case 12: + /* if (!(i$1 < m)) { break; } */ if(!(i$1 < m)) { $s = 13; continue; } + x$2 = (x$1 = n + i$1 >> 0, ((x$1 < 0 || x$1 >= in$1.$length) ? $throwRuntimeError("index out of range") : in$1.$array[in$1.$offset + x$1])); + xt$1 = x$2.Type(); + _r$5 = xt$1.AssignableTo(elem); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + /* */ if (!_r$5) { $s = 14; continue; } + /* */ $s = 15; continue; + /* if (!_r$5) { */ case 14: + _r$6 = xt$1.String(); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _r$7 = elem.String(); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + $panic(new $String("reflect: cannot use " + _r$6 + " as type " + _r$7 + " in " + op)); + /* } */ case 15: + _r$8 = slice.Index(i$1); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + $r = _r$8.Set(x$2); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + i$1 = i$1 + (1) >> 0; + /* } */ $s = 12; continue; case 13: + origIn = in$1; + in$1 = $makeSlice(sliceType$8, (n + 1 >> 0)); + $copySlice($subslice(in$1, 0, n), origIn); + ((n < 0 || n >= in$1.$length) ? $throwRuntimeError("index out of range") : in$1.$array[in$1.$offset + n] = slice); + /* } */ case 9: + nin = in$1.$length; + if (!((nin === t.NumIn()))) { + $panic(new $String("reflect.Value.Call: wrong argument count")); + } + nout = t.NumOut(); + argsArray = new ($global.Array)(t.NumIn()); + _ref$1 = in$1; + _i$1 = 0; + /* while (true) { */ case 21: + /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 22; continue; } + i$2 = _i$1; + arg = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); + _arg = t.In(i$2); + _r$9 = t.In(i$2).common(); /* */ $s = 23; case 23: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + _arg$1 = _r$9; + _arg$2 = 0; + _r$10 = arg.assignTo("reflect.Value.Call", _arg$1, _arg$2); /* */ $s = 24; case 24: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } + _r$11 = _r$10.object(); /* */ $s = 25; case 25: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } + _arg$3 = _r$11; + _r$12 = unwrapJsObject(_arg, _arg$3); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } + argsArray[i$2] = _r$12; + _i$1++; + /* } */ $s = 21; continue; case 22: + _r$13 = callHelper(new sliceType$2([new $jsObjectPtr(fn), new $jsObjectPtr(rcvr), new $jsObjectPtr(argsArray)])); /* */ $s = 27; case 27: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } + results = _r$13; + _10 = nout; + /* */ if (_10 === (0)) { $s = 29; continue; } + /* */ if (_10 === (1)) { $s = 30; continue; } + /* */ $s = 31; continue; + /* if (_10 === (0)) { */ case 29: + return sliceType$8.nil; + /* } else if (_10 === (1)) { */ case 30: + _r$14 = makeValue(t.Out(0), wrapJsObject(t.Out(0), results), 0); /* */ $s = 33; case 33: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } + /* */ $s = 34; case 34: + return new sliceType$8([$clone(_r$14, Value)]); + /* } else { */ case 31: + ret = $makeSlice(sliceType$8, nout); + _ref$2 = ret; + _i$2 = 0; + /* while (true) { */ case 35: + /* if (!(_i$2 < _ref$2.$length)) { break; } */ if(!(_i$2 < _ref$2.$length)) { $s = 36; continue; } + i$3 = _i$2; + _r$15 = makeValue(t.Out(i$3), wrapJsObject(t.Out(i$3), results[i$3]), 0); /* */ $s = 37; case 37: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } + ((i$3 < 0 || i$3 >= ret.$length) ? $throwRuntimeError("index out of range") : ret.$array[ret.$offset + i$3] = _r$15); + _i$2++; + /* } */ $s = 35; continue; case 36: + return ret; + /* } */ case 32: + case 28: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.call }; } $f.$ptr = $ptr; $f._10 = _10; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.arg = arg; $f.argsArray = argsArray; $f.elem = elem; $f.fn = fn; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.in$1 = in$1; $f.isSlice = isSlice; $f.m = m; $f.n = n; $f.nin = nin; $f.nout = nout; $f.op = op; $f.origIn = origIn; $f.rcvr = rcvr; $f.results = results; $f.ret = ret; $f.slice = slice; $f.t = t; $f.targ = targ; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.xt = xt; $f.xt$1 = xt$1; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.call = function(op, in$1) { return this.$val.call(op, in$1); }; + Value.ptr.prototype.Cap = function() { + var $ptr, _11, k, v; + v = this; + k = new flag(v.flag).kind(); + _11 = k; + if (_11 === (17)) { + return v.typ.Len(); + } else if ((_11 === (18)) || (_11 === (23))) { + return $parseInt(v.object().$capacity) >> 0; + } + $panic(new ValueError.ptr("reflect.Value.Cap", k)); + }; + Value.prototype.Cap = function() { return this.$val.Cap(); }; + wrapJsObject = function(typ, val) { + var $ptr, typ, val; + if ($interfaceIsEqual(typ, jsObjectPtr)) { + return new (jsType(jsObjectPtr))(val); + } + return val; + }; + unwrapJsObject = function(typ, val) { + var $ptr, typ, val; + if ($interfaceIsEqual(typ, jsObjectPtr)) { + return val.object; + } + return val; + }; + Value.ptr.prototype.Elem = function() { + var $ptr, _12, _r, fl, k, tt, typ, v, val, val$1, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _12 = $f._12; _r = $f._r; fl = $f.fl; k = $f.k; tt = $f.tt; typ = $f.typ; v = $f.v; val = $f.val; val$1 = $f.val$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + k = new flag(v.flag).kind(); + _12 = k; + /* */ if (_12 === (20)) { $s = 2; continue; } + /* */ if (_12 === (22)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (_12 === (20)) { */ case 2: + val = v.object(); + if (val === $ifaceNil) { + return new Value.ptr(ptrType$1.nil, 0, 0); + } + typ = reflectType(val.constructor); + _r = makeValue(typ, val.$val, (v.flag & 96) >>> 0); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 7; case 7: + return _r; + /* } else if (_12 === (22)) { */ case 3: + if (v.IsNil()) { + return new Value.ptr(ptrType$1.nil, 0, 0); + } + val$1 = v.object(); + tt = v.typ.kindType; + fl = (((((v.flag & 96) >>> 0) | 128) >>> 0) | 256) >>> 0; + fl = (fl | ((tt.elem.Kind() >>> 0))) >>> 0; + return new Value.ptr(tt.elem, wrapJsObject(tt.elem, val$1), fl); + /* } else { */ case 4: + $panic(new ValueError.ptr("reflect.Value.Elem", k)); + /* } */ case 5: + case 1: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Elem }; } $f.$ptr = $ptr; $f._12 = _12; $f._r = _r; $f.fl = fl; $f.k = k; $f.tt = tt; $f.typ = typ; $f.v = v; $f.val = val; $f.val$1 = val$1; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Elem = function() { return this.$val.Elem(); }; + Value.ptr.prototype.Field = function(i) { + var $ptr, _r, _r$1, _r$2, field, fl, i, jsTag, o, prop, s, tag, tt, typ, v, x, x$1, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; field = $f.field; fl = $f.fl; i = $f.i; jsTag = $f.jsTag; o = $f.o; prop = $f.prop; s = $f.s; tag = $f.tag; tt = $f.tt; typ = $f.typ; v = $f.v; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + jsTag = [jsTag]; + prop = [prop]; + s = [s]; + typ = [typ]; + v = this; + new flag(v.flag).mustBe(25); + tt = v.typ.kindType; + if (i < 0 || i >= tt.fields.$length) { + $panic(new $String("reflect: Field index out of range")); + } + prop[0] = $internalize(jsType(v.typ).fields[i].prop, $String); + field = (x = tt.fields, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + typ[0] = field.typ; + fl = (((v.flag & 416) >>> 0) | (typ[0].Kind() >>> 0)) >>> 0; + if (!(field.pkgPath === ptrType$6.nil)) { + if (field.name === ptrType$6.nil) { + fl = (fl | (64)) >>> 0; + } else { + fl = (fl | (32)) >>> 0; + } + } + tag = (x$1 = tt.fields, ((i < 0 || i >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + i])).tag; + /* */ if (!(tag === ptrType$6.nil) && !((i === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!(tag === ptrType$6.nil) && !((i === 0))) { */ case 1: + jsTag[0] = getJsTag(tag.$get()); + /* */ if (!(jsTag[0] === "")) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (!(jsTag[0] === "")) { */ case 3: + /* while (true) { */ case 5: + o = [o]; + _r = v.Field(0); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + v = _r; + /* */ if (v.typ === jsObjectPtr) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (v.typ === jsObjectPtr) { */ case 8: + o[0] = v.object().object; + return new Value.ptr(typ[0], new (jsType(PtrTo(typ[0])))((function(jsTag, o, prop, s, typ) { return function() { + var $ptr; + return $internalize(o[0][$externalize(jsTag[0], $String)], jsType(typ[0])); + }; })(jsTag, o, prop, s, typ), (function(jsTag, o, prop, s, typ) { return function(x$2) { + var $ptr, x$2; + o[0][$externalize(jsTag[0], $String)] = $externalize(x$2, jsType(typ[0])); + }; })(jsTag, o, prop, s, typ)), fl); + /* } */ case 9: + /* */ if (v.typ.Kind() === 22) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (v.typ.Kind() === 22) { */ case 10: + _r$1 = v.Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + v = _r$1; + /* } */ case 11: + /* } */ $s = 5; continue; case 6: + /* } */ case 4: + /* } */ case 2: + s[0] = v.ptr; + /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 13: + return new Value.ptr(typ[0], new (jsType(PtrTo(typ[0])))((function(jsTag, prop, s, typ) { return function() { + var $ptr; + return wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]); + }; })(jsTag, prop, s, typ), (function(jsTag, prop, s, typ) { return function(x$2) { + var $ptr, x$2; + s[0][$externalize(prop[0], $String)] = unwrapJsObject(typ[0], x$2); + }; })(jsTag, prop, s, typ)), fl); + /* } */ case 14: + _r$2 = makeValue(typ[0], wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]), fl); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ $s = 16; case 16: + return _r$2; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Field }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.field = field; $f.fl = fl; $f.i = i; $f.jsTag = jsTag; $f.o = o; $f.prop = prop; $f.s = s; $f.tag = tag; $f.tt = tt; $f.typ = typ; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Field = function(i) { return this.$val.Field(i); }; + getJsTag = function(tag) { + var $ptr, _tuple, i, name, qvalue, tag, value; + while (true) { + if (!(!(tag === ""))) { break; } + i = 0; + while (true) { + if (!(i < tag.length && (tag.charCodeAt(i) === 32))) { break; } + i = i + (1) >> 0; + } + tag = tag.substring(i); + if (tag === "") { + break; + } + i = 0; + while (true) { + if (!(i < tag.length && !((tag.charCodeAt(i) === 32)) && !((tag.charCodeAt(i) === 58)) && !((tag.charCodeAt(i) === 34)))) { break; } + i = i + (1) >> 0; + } + if ((i + 1 >> 0) >= tag.length || !((tag.charCodeAt(i) === 58)) || !((tag.charCodeAt((i + 1 >> 0)) === 34))) { + break; + } + name = tag.substring(0, i); + tag = tag.substring((i + 1 >> 0)); + i = 1; + while (true) { + if (!(i < tag.length && !((tag.charCodeAt(i) === 34)))) { break; } + if (tag.charCodeAt(i) === 92) { + i = i + (1) >> 0; + } + i = i + (1) >> 0; + } + if (i >= tag.length) { + break; + } + qvalue = tag.substring(0, (i + 1 >> 0)); + tag = tag.substring((i + 1 >> 0)); + if (name === "js") { + _tuple = strconv.Unquote(qvalue); + value = _tuple[0]; + return value; + } + } + return ""; + }; + Value.ptr.prototype.Index = function(i) { + var $ptr, _13, _r, _r$1, a, a$1, c, fl, fl$1, fl$2, i, k, s, str, tt, tt$1, typ, typ$1, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _13 = $f._13; _r = $f._r; _r$1 = $f._r$1; a = $f.a; a$1 = $f.a$1; c = $f.c; fl = $f.fl; fl$1 = $f.fl$1; fl$2 = $f.fl$2; i = $f.i; k = $f.k; s = $f.s; str = $f.str; tt = $f.tt; tt$1 = $f.tt$1; typ = $f.typ; typ$1 = $f.typ$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + a = [a]; + a$1 = [a$1]; + c = [c]; + i = [i]; + typ = [typ]; + typ$1 = [typ$1]; + v = this; + k = new flag(v.flag).kind(); + _13 = k; + /* */ if (_13 === (17)) { $s = 2; continue; } + /* */ if (_13 === (23)) { $s = 3; continue; } + /* */ if (_13 === (24)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_13 === (17)) { */ case 2: + tt = v.typ.kindType; + if (i[0] < 0 || i[0] > (tt.len >> 0)) { + $panic(new $String("reflect: array index out of range")); + } + typ$1[0] = tt.elem; + fl = (v.flag & 480) >>> 0; + fl = (fl | ((typ$1[0].Kind() >>> 0))) >>> 0; + a$1[0] = v.ptr; + /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (!((((fl & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { */ case 7: + return new Value.ptr(typ$1[0], new (jsType(PtrTo(typ$1[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { + var $ptr; + return wrapJsObject(typ$1[0], a$1[0][i[0]]); + }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { + var $ptr, x; + a$1[0][i[0]] = unwrapJsObject(typ$1[0], x); + }; })(a, a$1, c, i, typ, typ$1)), fl); + /* } */ case 8: + _r = makeValue(typ$1[0], wrapJsObject(typ$1[0], a$1[0][i[0]]), fl); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 10; case 10: + return _r; + /* } else if (_13 === (23)) { */ case 3: + s = v.object(); + if (i[0] < 0 || i[0] >= ($parseInt(s.$length) >> 0)) { + $panic(new $String("reflect: slice index out of range")); + } + tt$1 = v.typ.kindType; + typ[0] = tt$1.elem; + fl$1 = (384 | ((v.flag & 96) >>> 0)) >>> 0; + fl$1 = (fl$1 | ((typ[0].Kind() >>> 0))) >>> 0; + i[0] = i[0] + (($parseInt(s.$offset) >> 0)) >> 0; + a[0] = s.$array; + /* */ if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 11; continue; } + /* */ $s = 12; continue; + /* if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 11: + return new Value.ptr(typ[0], new (jsType(PtrTo(typ[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { + var $ptr; + return wrapJsObject(typ[0], a[0][i[0]]); + }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { + var $ptr, x; + a[0][i[0]] = unwrapJsObject(typ[0], x); + }; })(a, a$1, c, i, typ, typ$1)), fl$1); + /* } */ case 12: + _r$1 = makeValue(typ[0], wrapJsObject(typ[0], a[0][i[0]]), fl$1); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 14; case 14: + return _r$1; + /* } else if (_13 === (24)) { */ case 4: + str = v.ptr.$get(); + if (i[0] < 0 || i[0] >= str.length) { + $panic(new $String("reflect: string index out of range")); + } + fl$2 = (((v.flag & 96) >>> 0) | 8) >>> 0; + c[0] = str.charCodeAt(i[0]); + return new Value.ptr(uint8Type, (c.$ptr || (c.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c))), (fl$2 | 128) >>> 0); + /* } else { */ case 5: + $panic(new ValueError.ptr("reflect.Value.Index", k)); + /* } */ case 6: + case 1: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Index }; } $f.$ptr = $ptr; $f._13 = _13; $f._r = _r; $f._r$1 = _r$1; $f.a = a; $f.a$1 = a$1; $f.c = c; $f.fl = fl; $f.fl$1 = fl$1; $f.fl$2 = fl$2; $f.i = i; $f.k = k; $f.s = s; $f.str = str; $f.tt = tt; $f.tt$1 = tt$1; $f.typ = typ; $f.typ$1 = typ$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Index = function(i) { return this.$val.Index(i); }; + Value.ptr.prototype.InterfaceData = function() { + var $ptr, v; + v = this; + $panic(errors.New("InterfaceData is not supported by GopherJS")); + }; + Value.prototype.InterfaceData = function() { return this.$val.InterfaceData(); }; + Value.ptr.prototype.IsNil = function() { + var $ptr, _14, k, v; + v = this; + k = new flag(v.flag).kind(); + _14 = k; + if ((_14 === (22)) || (_14 === (23))) { + return v.object() === jsType(v.typ).nil; + } else if (_14 === (18)) { + return v.object() === $chanNil; + } else if (_14 === (19)) { + return v.object() === $throwNilPointerError; + } else if (_14 === (21)) { + return v.object() === false; + } else if (_14 === (20)) { + return v.object() === $ifaceNil; + } else { + $panic(new ValueError.ptr("reflect.Value.IsNil", k)); + } + }; + Value.prototype.IsNil = function() { return this.$val.IsNil(); }; + Value.ptr.prototype.Len = function() { + var $ptr, _15, k, v; + v = this; + k = new flag(v.flag).kind(); + _15 = k; + if ((_15 === (17)) || (_15 === (24))) { + return $parseInt(v.object().length); + } else if (_15 === (23)) { + return $parseInt(v.object().$length) >> 0; + } else if (_15 === (18)) { + return $parseInt(v.object().$buffer.length) >> 0; + } else if (_15 === (21)) { + return $parseInt($keys(v.object()).length); + } else { + $panic(new ValueError.ptr("reflect.Value.Len", k)); + } + }; + Value.prototype.Len = function() { return this.$val.Len(); }; + Value.ptr.prototype.Pointer = function() { + var $ptr, _16, k, v; + v = this; + k = new flag(v.flag).kind(); + _16 = k; + if ((_16 === (18)) || (_16 === (21)) || (_16 === (22)) || (_16 === (26))) { + if (v.IsNil()) { + return 0; + } + return v.object(); + } else if (_16 === (19)) { + if (v.IsNil()) { + return 0; + } + return 1; + } else if (_16 === (23)) { + if (v.IsNil()) { + return 0; + } + return v.object().$array; + } else { + $panic(new ValueError.ptr("reflect.Value.Pointer", k)); + } + }; + Value.prototype.Pointer = function() { return this.$val.Pointer(); }; + Value.ptr.prototype.Set = function(x) { + var $ptr, _17, _r, _r$1, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _17 = $f._17; _r = $f._r; _r$1 = $f._r$1; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + x = x; + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(x.flag).mustBeExported(); + _r = x.assignTo("reflect.Set", v.typ, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + x = _r; + /* */ if (!((((v.flag & 128) >>> 0) === 0))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!((((v.flag & 128) >>> 0) === 0))) { */ case 2: + _17 = v.typ.Kind(); + /* */ if (_17 === (17)) { $s = 5; continue; } + /* */ if (_17 === (20)) { $s = 6; continue; } + /* */ if (_17 === (25)) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (_17 === (17)) { */ case 5: + jsType(v.typ).copy(v.ptr, x.ptr); + $s = 9; continue; + /* } else if (_17 === (20)) { */ case 6: + _r$1 = valueInterface(x, false); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + v.ptr.$set(_r$1); + $s = 9; continue; + /* } else if (_17 === (25)) { */ case 7: + copyStruct(v.ptr, x.ptr, v.typ); + $s = 9; continue; + /* } else { */ case 8: + v.ptr.$set(x.object()); + /* } */ case 9: + case 4: + return; + /* } */ case 3: + v.ptr = x.ptr; + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Set }; } $f.$ptr = $ptr; $f._17 = _17; $f._r = _r; $f._r$1 = _r$1; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Set = function(x) { return this.$val.Set(x); }; + Value.ptr.prototype.SetBytes = function(x) { + var $ptr, _r, _r$1, _v, slice, typedSlice, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _v = $f._v; slice = $f.slice; typedSlice = $f.typedSlice; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(23); + _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 8))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 8))) { */ case 1: + $panic(new $String("reflect.Value.SetBytes of non-byte slice")); + /* } */ case 2: + slice = x; + if (!(v.typ.Name() === "")) { _v = true; $s = 6; continue s; } + _r$1 = v.typ.Elem().Name(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _v = !(_r$1 === ""); case 6: + /* */ if (_v) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_v) { */ case 4: + typedSlice = new (jsType(v.typ))(slice.$array); + typedSlice.$offset = slice.$offset; + typedSlice.$length = slice.$length; + typedSlice.$capacity = slice.$capacity; + slice = typedSlice; + /* } */ case 5: + v.ptr.$set(slice); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.SetBytes }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._v = _v; $f.slice = slice; $f.typedSlice = typedSlice; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.SetBytes = function(x) { return this.$val.SetBytes(x); }; + Value.ptr.prototype.SetCap = function(n) { + var $ptr, n, newSlice, s, v; + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(23); + s = v.ptr.$get(); + if (n < ($parseInt(s.$length) >> 0) || n > ($parseInt(s.$capacity) >> 0)) { + $panic(new $String("reflect: slice capacity out of range in SetCap")); + } + newSlice = new (jsType(v.typ))(s.$array); + newSlice.$offset = s.$offset; + newSlice.$length = s.$length; + newSlice.$capacity = n; + v.ptr.$set(newSlice); + }; + Value.prototype.SetCap = function(n) { return this.$val.SetCap(n); }; + Value.ptr.prototype.SetLen = function(n) { + var $ptr, n, newSlice, s, v; + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(23); + s = v.ptr.$get(); + if (n < 0 || n > ($parseInt(s.$capacity) >> 0)) { + $panic(new $String("reflect: slice length out of range in SetLen")); + } + newSlice = new (jsType(v.typ))(s.$array); + newSlice.$offset = s.$offset; + newSlice.$length = n; + newSlice.$capacity = s.$capacity; + v.ptr.$set(newSlice); + }; + Value.prototype.SetLen = function(n) { return this.$val.SetLen(n); }; + Value.ptr.prototype.Slice = function(i, j) { + var $ptr, _18, _r, _r$1, cap, i, j, kind, s, str, tt, typ, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _18 = $f._18; _r = $f._r; _r$1 = $f._r$1; cap = $f.cap; i = $f.i; j = $f.j; kind = $f.kind; s = $f.s; str = $f.str; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + cap = 0; + typ = $ifaceNil; + s = null; + kind = new flag(v.flag).kind(); + _18 = kind; + /* */ if (_18 === (17)) { $s = 2; continue; } + /* */ if (_18 === (23)) { $s = 3; continue; } + /* */ if (_18 === (24)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_18 === (17)) { */ case 2: + if (((v.flag & 256) >>> 0) === 0) { + $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); + } + tt = v.typ.kindType; + cap = (tt.len >> 0); + typ = SliceOf(tt.elem); + s = new (jsType(typ))(v.object()); + $s = 6; continue; + /* } else if (_18 === (23)) { */ case 3: + typ = v.typ; + s = v.object(); + cap = $parseInt(s.$capacity) >> 0; + $s = 6; continue; + /* } else if (_18 === (24)) { */ case 4: + str = v.ptr.$get(); + if (i < 0 || j < i || j > str.length) { + $panic(new $String("reflect.Value.Slice: string slice index out of bounds")); + } + _r = ValueOf(new $String(str.substring(i, j))); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 8; case 8: + return _r; + /* } else { */ case 5: + $panic(new ValueError.ptr("reflect.Value.Slice", kind)); + /* } */ case 6: + case 1: + if (i < 0 || j < i || j > cap) { + $panic(new $String("reflect.Value.Slice: slice index out of bounds")); + } + _r$1 = makeValue(typ, $subslice(s, i, j), (v.flag & 96) >>> 0); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 10; case 10: + return _r$1; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice }; } $f.$ptr = $ptr; $f._18 = _18; $f._r = _r; $f._r$1 = _r$1; $f.cap = cap; $f.i = i; $f.j = j; $f.kind = kind; $f.s = s; $f.str = str; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Slice = function(i, j) { return this.$val.Slice(i, j); }; + Value.ptr.prototype.Slice3 = function(i, j, k) { + var $ptr, _19, _r, cap, i, j, k, kind, s, tt, typ, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _19 = $f._19; _r = $f._r; cap = $f.cap; i = $f.i; j = $f.j; k = $f.k; kind = $f.kind; s = $f.s; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + cap = 0; + typ = $ifaceNil; + s = null; + kind = new flag(v.flag).kind(); + _19 = kind; + if (_19 === (17)) { + if (((v.flag & 256) >>> 0) === 0) { + $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); + } + tt = v.typ.kindType; + cap = (tt.len >> 0); + typ = SliceOf(tt.elem); + s = new (jsType(typ))(v.object()); + } else if (_19 === (23)) { + typ = v.typ; + s = v.object(); + cap = $parseInt(s.$capacity) >> 0; + } else { + $panic(new ValueError.ptr("reflect.Value.Slice3", kind)); + } + if (i < 0 || j < i || k < j || k > cap) { + $panic(new $String("reflect.Value.Slice3: slice index out of bounds")); + } + _r = makeValue(typ, $subslice(s, i, j, k), (v.flag & 96) >>> 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice3 }; } $f.$ptr = $ptr; $f._19 = _19; $f._r = _r; $f.cap = cap; $f.i = i; $f.j = j; $f.k = k; $f.kind = kind; $f.s = s; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Slice3 = function(i, j, k) { return this.$val.Slice3(i, j, k); }; + Value.ptr.prototype.Close = function() { + var $ptr, v; + v = this; + new flag(v.flag).mustBe(18); + new flag(v.flag).mustBeExported(); + $close(v.object()); + }; + Value.prototype.Close = function() { return this.$val.Close(); }; + chanrecv = function(t, ch, nb, val) { + var $ptr, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, ch, comms, nb, received, recvRes, selectRes, selected, t, val, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; ch = $f.ch; comms = $f.comms; nb = $f.nb; received = $f.received; recvRes = $f.recvRes; selectRes = $f.selectRes; selected = $f.selected; t = $f.t; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + selected = false; + received = false; + comms = new sliceType$9([new sliceType$7([ch])]); + if (nb) { + comms = $append(comms, new sliceType$7([])); + } + _r = selectHelper(new sliceType$2([comms])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + selectRes = _r; + if (nb && (($parseInt(selectRes[0]) >> 0) === 1)) { + _tmp = false; + _tmp$1 = false; + selected = _tmp; + received = _tmp$1; + return [selected, received]; + } + recvRes = selectRes[1]; + val.$set(recvRes[0]); + _tmp$2 = true; + _tmp$3 = !!(recvRes[1]); + selected = _tmp$2; + received = _tmp$3; + return [selected, received]; + /* */ } return; } if ($f === undefined) { $f = { $blk: chanrecv }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.ch = ch; $f.comms = comms; $f.nb = nb; $f.received = received; $f.recvRes = recvRes; $f.selectRes = selectRes; $f.selected = selected; $f.t = t; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; + }; + chansend = function(t, ch, val, nb) { + var $ptr, _r, ch, comms, nb, selectRes, t, val, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; ch = $f.ch; comms = $f.comms; nb = $f.nb; selectRes = $f.selectRes; t = $f.t; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + comms = new sliceType$9([new sliceType$7([ch, val.$get()])]); + if (nb) { + comms = $append(comms, new sliceType$7([])); + } + _r = selectHelper(new sliceType$2([comms])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + selectRes = _r; + if (nb && (($parseInt(selectRes[0]) >> 0) === 1)) { + return false; + } + return true; + /* */ } return; } if ($f === undefined) { $f = { $blk: chansend }; } $f.$ptr = $ptr; $f._r = _r; $f.ch = ch; $f.comms = comms; $f.nb = nb; $f.selectRes = selectRes; $f.t = t; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; + }; + Kind.prototype.String = function() { + var $ptr, k; + k = this.$val; + if ((k >> 0) < kindNames.$length) { + return ((k < 0 || k >= kindNames.$length) ? $throwRuntimeError("index out of range") : kindNames.$array[kindNames.$offset + k]); + } + return "kind" + strconv.Itoa((k >> 0)); + }; + $ptrType(Kind).prototype.String = function() { return new Kind(this.$get()).String(); }; + uncommonType.ptr.prototype.uncommon = function() { + var $ptr, t; + t = this; + return t; + }; + uncommonType.prototype.uncommon = function() { return this.$val.uncommon(); }; + uncommonType.ptr.prototype.PkgPath = function() { + var $ptr, t; + t = this; + if (t === ptrType$7.nil || t.pkgPath === ptrType$6.nil) { + return ""; + } + return t.pkgPath.$get(); + }; + uncommonType.prototype.PkgPath = function() { return this.$val.PkgPath(); }; + uncommonType.ptr.prototype.Name = function() { + var $ptr, t; + t = this; + if (t === ptrType$7.nil || t.name === ptrType$6.nil) { + return ""; + } + return t.name.$get(); + }; + uncommonType.prototype.Name = function() { return this.$val.Name(); }; + rtype.ptr.prototype.String = function() { + var $ptr, t; + t = this; + return t.string.$get(); + }; + rtype.prototype.String = function() { return this.$val.String(); }; + rtype.ptr.prototype.Size = function() { + var $ptr, t; + t = this; + return t.size; + }; + rtype.prototype.Size = function() { return this.$val.Size(); }; + rtype.ptr.prototype.Bits = function() { + var $ptr, k, t; + t = this; + if (t === ptrType$1.nil) { + $panic(new $String("reflect: Bits of nil Type")); + } + k = t.Kind(); + if (k < 2 || k > 16) { + $panic(new $String("reflect: Bits of non-arithmetic Type " + t.String())); + } + return $imul((t.size >> 0), 8); + }; + rtype.prototype.Bits = function() { return this.$val.Bits(); }; + rtype.ptr.prototype.Align = function() { + var $ptr, t; + t = this; + return (t.align >> 0); + }; + rtype.prototype.Align = function() { return this.$val.Align(); }; + rtype.ptr.prototype.FieldAlign = function() { + var $ptr, t; + t = this; + return (t.fieldAlign >> 0); + }; + rtype.prototype.FieldAlign = function() { return this.$val.FieldAlign(); }; + rtype.ptr.prototype.Kind = function() { + var $ptr, t; + t = this; + return (((t.kind & 31) >>> 0) >>> 0); + }; + rtype.prototype.Kind = function() { return this.$val.Kind(); }; + rtype.ptr.prototype.common = function() { + var $ptr, t; + t = this; + return t; + }; + rtype.prototype.common = function() { return this.$val.common(); }; + uncommonType.ptr.prototype.NumMethod = function() { + var $ptr, t; + t = this; + if (t === ptrType$7.nil) { + return 0; + } + return t.methods.$length; + }; + uncommonType.prototype.NumMethod = function() { return this.$val.NumMethod(); }; + uncommonType.ptr.prototype.MethodByName = function(name) { + var $ptr, _i, _ref, _tmp, _tmp$1, i, m, name, ok, p, t, x; + m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + ok = false; + t = this; + if (t === ptrType$7.nil) { + return [m, ok]; + } + p = ptrType$10.nil; + _ref = t.methods; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + p = (x = t.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + if (!(p.name === ptrType$6.nil) && p.name.$get() === name) { + _tmp = $clone(t.Method(i), Method); + _tmp$1 = true; + Method.copy(m, _tmp); + ok = _tmp$1; + return [m, ok]; + } + _i++; + } + return [m, ok]; + }; + uncommonType.prototype.MethodByName = function(name) { return this.$val.MethodByName(name); }; + rtype.ptr.prototype.NumMethod = function() { + var $ptr, t, tt; + t = this; + if (t.Kind() === 20) { + tt = t.kindType; + return tt.NumMethod(); + } + return t.uncommonType.NumMethod(); + }; + rtype.prototype.NumMethod = function() { return this.$val.NumMethod(); }; + rtype.ptr.prototype.Method = function(i) { + var $ptr, i, m, t, tt; + m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + t = this; + if (t.Kind() === 20) { + tt = t.kindType; + Method.copy(m, tt.Method(i)); + return m; + } + Method.copy(m, t.uncommonType.Method(i)); + return m; + }; + rtype.prototype.Method = function(i) { return this.$val.Method(i); }; + rtype.ptr.prototype.MethodByName = function(name) { + var $ptr, _tuple, _tuple$1, m, name, ok, t, tt; + m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + ok = false; + t = this; + if (t.Kind() === 20) { + tt = t.kindType; + _tuple = tt.MethodByName(name); + Method.copy(m, _tuple[0]); + ok = _tuple[1]; + return [m, ok]; + } + _tuple$1 = t.uncommonType.MethodByName(name); + Method.copy(m, _tuple$1[0]); + ok = _tuple$1[1]; + return [m, ok]; + }; + rtype.prototype.MethodByName = function(name) { return this.$val.MethodByName(name); }; + rtype.ptr.prototype.PkgPath = function() { + var $ptr, t; + t = this; + return t.uncommonType.PkgPath(); + }; + rtype.prototype.PkgPath = function() { return this.$val.PkgPath(); }; + rtype.ptr.prototype.Name = function() { + var $ptr, t; + t = this; + return t.uncommonType.Name(); + }; + rtype.prototype.Name = function() { return this.$val.Name(); }; + rtype.ptr.prototype.ChanDir = function() { + var $ptr, t, tt; + t = this; + if (!((t.Kind() === 18))) { + $panic(new $String("reflect: ChanDir of non-chan type")); + } + tt = t.kindType; + return (tt.dir >> 0); + }; + rtype.prototype.ChanDir = function() { return this.$val.ChanDir(); }; + rtype.ptr.prototype.IsVariadic = function() { + var $ptr, t, tt; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: IsVariadic of non-func type")); + } + tt = t.kindType; + return tt.dotdotdot; + }; + rtype.prototype.IsVariadic = function() { return this.$val.IsVariadic(); }; + rtype.ptr.prototype.Elem = function() { + var $ptr, _1, t, tt, tt$1, tt$2, tt$3, tt$4; + t = this; + _1 = t.Kind(); + if (_1 === (17)) { + tt = t.kindType; + return toType(tt.elem); + } else if (_1 === (18)) { + tt$1 = t.kindType; + return toType(tt$1.elem); + } else if (_1 === (21)) { + tt$2 = t.kindType; + return toType(tt$2.elem); + } else if (_1 === (22)) { + tt$3 = t.kindType; + return toType(tt$3.elem); + } else if (_1 === (23)) { + tt$4 = t.kindType; + return toType(tt$4.elem); + } + $panic(new $String("reflect: Elem of invalid type")); + }; + rtype.prototype.Elem = function() { return this.$val.Elem(); }; + rtype.ptr.prototype.Field = function(i) { + var $ptr, _r, i, t, tt, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: Field of non-struct type")); + } + tt = t.kindType; + _r = tt.Field(i); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Field }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; + }; + rtype.prototype.Field = function(i) { return this.$val.Field(i); }; + rtype.ptr.prototype.FieldByIndex = function(index) { + var $ptr, _r, index, t, tt, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; index = $f.index; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: FieldByIndex of non-struct type")); + } + tt = t.kindType; + _r = tt.FieldByIndex(index); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByIndex }; } $f.$ptr = $ptr; $f._r = _r; $f.index = index; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; + }; + rtype.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; + rtype.ptr.prototype.FieldByName = function(name) { + var $ptr, _r, name, t, tt, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: FieldByName of non-struct type")); + } + tt = t.kindType; + _r = tt.FieldByName(name); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByName }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; + }; + rtype.prototype.FieldByName = function(name) { return this.$val.FieldByName(name); }; + rtype.ptr.prototype.FieldByNameFunc = function(match) { + var $ptr, _r, match, t, tt, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; match = $f.match; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: FieldByNameFunc of non-struct type")); + } + tt = t.kindType; + _r = tt.FieldByNameFunc(match); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByNameFunc }; } $f.$ptr = $ptr; $f._r = _r; $f.match = match; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; + }; + rtype.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; + rtype.ptr.prototype.In = function(i) { + var $ptr, i, t, tt, x; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: In of non-func type")); + } + tt = t.kindType; + return toType((x = tt.in$2, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]))); + }; + rtype.prototype.In = function(i) { return this.$val.In(i); }; + rtype.ptr.prototype.Key = function() { + var $ptr, t, tt; + t = this; + if (!((t.Kind() === 21))) { + $panic(new $String("reflect: Key of non-map type")); + } + tt = t.kindType; + return toType(tt.key); + }; + rtype.prototype.Key = function() { return this.$val.Key(); }; + rtype.ptr.prototype.Len = function() { + var $ptr, t, tt; + t = this; + if (!((t.Kind() === 17))) { + $panic(new $String("reflect: Len of non-array type")); + } + tt = t.kindType; + return (tt.len >> 0); + }; + rtype.prototype.Len = function() { return this.$val.Len(); }; + rtype.ptr.prototype.NumField = function() { + var $ptr, t, tt; + t = this; + if (!((t.Kind() === 25))) { + $panic(new $String("reflect: NumField of non-struct type")); + } + tt = t.kindType; + return tt.fields.$length; + }; + rtype.prototype.NumField = function() { return this.$val.NumField(); }; + rtype.ptr.prototype.NumIn = function() { + var $ptr, t, tt; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: NumIn of non-func type")); + } + tt = t.kindType; + return tt.in$2.$length; + }; + rtype.prototype.NumIn = function() { return this.$val.NumIn(); }; + rtype.ptr.prototype.NumOut = function() { + var $ptr, t, tt; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: NumOut of non-func type")); + } + tt = t.kindType; + return tt.out.$length; + }; + rtype.prototype.NumOut = function() { return this.$val.NumOut(); }; + rtype.ptr.prototype.Out = function(i) { + var $ptr, i, t, tt, x; + t = this; + if (!((t.Kind() === 19))) { + $panic(new $String("reflect: Out of non-func type")); + } + tt = t.kindType; + return toType((x = tt.out, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]))); + }; + rtype.prototype.Out = function(i) { return this.$val.Out(i); }; + ChanDir.prototype.String = function() { + var $ptr, _2, d; + d = this.$val; + _2 = d; + if (_2 === (2)) { + return "chan<-"; + } else if (_2 === (1)) { + return "<-chan"; + } else if (_2 === (3)) { + return "chan"; + } + return "ChanDir" + strconv.Itoa((d >> 0)); + }; + $ptrType(ChanDir).prototype.String = function() { return new ChanDir(this.$get()).String(); }; + interfaceType.ptr.prototype.Method = function(i) { + var $ptr, i, m, p, t, x; + m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + t = this; + if (i < 0 || i >= t.methods.$length) { + return m; + } + p = (x = t.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + m.Name = p.name.$get(); + if (!(p.pkgPath === ptrType$6.nil)) { + m.PkgPath = p.pkgPath.$get(); + } + m.Type = toType(p.typ); + m.Index = i; + return m; + }; + interfaceType.prototype.Method = function(i) { return this.$val.Method(i); }; + interfaceType.ptr.prototype.NumMethod = function() { + var $ptr, t; + t = this; + return t.methods.$length; + }; + interfaceType.prototype.NumMethod = function() { return this.$val.NumMethod(); }; + interfaceType.ptr.prototype.MethodByName = function(name) { + var $ptr, _i, _ref, _tmp, _tmp$1, i, m, name, ok, p, t, x; + m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); + ok = false; + t = this; + if (t === ptrType$11.nil) { + return [m, ok]; + } + p = ptrType$12.nil; + _ref = t.methods; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + p = (x = t.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + if (p.name.$get() === name) { + _tmp = $clone(t.Method(i), Method); + _tmp$1 = true; + Method.copy(m, _tmp); + ok = _tmp$1; + return [m, ok]; + } + _i++; + } + return [m, ok]; + }; + interfaceType.prototype.MethodByName = function(name) { return this.$val.MethodByName(name); }; + StructTag.prototype.Get = function(key) { + var $ptr, _tuple, err, i, key, name, qvalue, tag, value; + tag = this.$val; + while (true) { + if (!(!(tag === ""))) { break; } + i = 0; + while (true) { + if (!(i < tag.length && (tag.charCodeAt(i) === 32))) { break; } + i = i + (1) >> 0; + } + tag = tag.substring(i); + if (tag === "") { + break; + } + i = 0; + while (true) { + if (!(i < tag.length && tag.charCodeAt(i) > 32 && !((tag.charCodeAt(i) === 58)) && !((tag.charCodeAt(i) === 34)) && !((tag.charCodeAt(i) === 127)))) { break; } + i = i + (1) >> 0; + } + if ((i === 0) || (i + 1 >> 0) >= tag.length || !((tag.charCodeAt(i) === 58)) || !((tag.charCodeAt((i + 1 >> 0)) === 34))) { + break; + } + name = tag.substring(0, i); + tag = tag.substring((i + 1 >> 0)); + i = 1; + while (true) { + if (!(i < tag.length && !((tag.charCodeAt(i) === 34)))) { break; } + if (tag.charCodeAt(i) === 92) { + i = i + (1) >> 0; + } + i = i + (1) >> 0; + } + if (i >= tag.length) { + break; + } + qvalue = tag.substring(0, (i + 1 >> 0)); + tag = tag.substring((i + 1 >> 0)); + if (key === name) { + _tuple = strconv.Unquote(qvalue); + value = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + break; + } + return value; + } + } + return ""; + }; + $ptrType(StructTag).prototype.Get = function(key) { return new StructTag(this.$get()).Get(key); }; + structType.ptr.prototype.Field = function(i) { + var $ptr, _r, _r$1, _r$2, f, i, p, t, t$1, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; f = $f.f; i = $f.i; p = $f.p; t = $f.t; t$1 = $f.t$1; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$11.nil, false); + t = this; + if (i < 0 || i >= t.fields.$length) { + return f; + } + p = (x = t.fields, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + f.Type = toType(p.typ); + /* */ if (!(p.name === ptrType$6.nil)) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!(p.name === ptrType$6.nil)) { */ case 1: + f.Name = p.name.$get(); + $s = 3; continue; + /* } else { */ case 2: + t$1 = f.Type; + _r = t$1.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (_r === 22) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_r === 22) { */ case 4: + _r$1 = t$1.Elem(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + t$1 = _r$1; + /* } */ case 5: + _r$2 = t$1.Name(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + f.Name = _r$2; + f.Anonymous = true; + /* } */ case 3: + if (!(p.pkgPath === ptrType$6.nil)) { + f.PkgPath = p.pkgPath.$get(); + } + if (!(p.tag === ptrType$6.nil)) { + f.Tag = p.tag.$get(); + } + f.Offset = p.offset; + f.Index = new sliceType$11([i]); + return f; + /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.Field }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.f = f; $f.i = i; $f.p = p; $f.t = t; $f.t$1 = t$1; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + structType.prototype.Field = function(i) { return this.$val.Field(i); }; + structType.ptr.prototype.FieldByIndex = function(index) { + var $ptr, _i, _r, _r$1, _r$2, _r$3, _r$4, _ref, _v, f, ft, i, index, t, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; _v = $f._v; f = $f.f; ft = $f.ft; i = $f.i; index = $f.index; t = $f.t; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$11.nil, false); + t = this; + f.Type = toType(t.rtype); + _ref = index; + _i = 0; + /* while (true) { */ case 1: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } + i = _i; + x = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + /* */ if (i > 0) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (i > 0) { */ case 3: + ft = f.Type; + _r = ft.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + if (!(_r === 22)) { _v = false; $s = 7; continue s; } + _r$1 = ft.Elem(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = _r$1.Kind(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v = _r$2 === 25; case 7: + /* */ if (_v) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (_v) { */ case 5: + _r$3 = ft.Elem(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + ft = _r$3; + /* } */ case 6: + f.Type = ft; + /* } */ case 4: + _r$4 = f.Type.Field(x); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + StructField.copy(f, _r$4); + _i++; + /* } */ $s = 1; continue; case 2: + return f; + /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByIndex }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f._v = _v; $f.f = f; $f.ft = ft; $f.i = i; $f.index = index; $f.t = t; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + structType.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; + structType.ptr.prototype.FieldByNameFunc = function(match) { + var $ptr, _entry, _entry$1, _entry$2, _entry$3, _i, _i$1, _key, _key$1, _key$2, _key$3, _r, _r$1, _r$2, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, count, current, f, fname, i, index, match, next, nextCount, ntyp, ok, result, scan, styp, t, t$1, visited, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _i = $f._i; _i$1 = $f._i$1; _key = $f._key; _key$1 = $f._key$1; _key$2 = $f._key$2; _key$3 = $f._key$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; count = $f.count; current = $f.current; f = $f.f; fname = $f.fname; i = $f.i; index = $f.index; match = $f.match; next = $f.next; nextCount = $f.nextCount; ntyp = $f.ntyp; ok = $f.ok; result = $f.result; scan = $f.scan; styp = $f.styp; t = $f.t; t$1 = $f.t$1; visited = $f.visited; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + result = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$11.nil, false); + ok = false; + t = this; + current = new sliceType$12([]); + next = new sliceType$12([new fieldScan.ptr(t, sliceType$11.nil)]); + nextCount = false; + visited = $makeMap(ptrType$13.keyFor, []); + /* while (true) { */ case 1: + /* if (!(next.$length > 0)) { break; } */ if(!(next.$length > 0)) { $s = 2; continue; } + _tmp = next; + _tmp$1 = $subslice(current, 0, 0); + current = _tmp; + next = _tmp$1; + count = nextCount; + nextCount = false; + _ref = current; + _i = 0; + /* while (true) { */ case 3: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } + scan = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), fieldScan); + t$1 = scan.typ; + /* */ if ((_entry = visited[ptrType$13.keyFor(t$1)], _entry !== undefined ? _entry.v : false)) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if ((_entry = visited[ptrType$13.keyFor(t$1)], _entry !== undefined ? _entry.v : false)) { */ case 5: + _i++; + /* continue; */ $s = 3; continue; + /* } */ case 6: + _key = t$1; (visited || $throwRuntimeError("assignment to entry in nil map"))[ptrType$13.keyFor(_key)] = { k: _key, v: true }; + _ref$1 = t$1.fields; + _i$1 = 0; + /* while (true) { */ case 7: + /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 8; continue; } + i = _i$1; + f = (x = t$1.fields, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + fname = ""; + ntyp = ptrType$1.nil; + /* */ if (!(f.name === ptrType$6.nil)) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (!(f.name === ptrType$6.nil)) { */ case 9: + fname = f.name.$get(); + $s = 11; continue; + /* } else { */ case 10: + ntyp = f.typ; + /* */ if (ntyp.Kind() === 22) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if (ntyp.Kind() === 22) { */ case 12: + _r = ntyp.Elem().common(); /* */ $s = 14; case 14: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + ntyp = _r; + /* } */ case 13: + fname = ntyp.Name(); + /* } */ case 11: + _r$1 = match(fname); /* */ $s = 17; case 17: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (_r$1) { $s = 15; continue; } + /* */ $s = 16; continue; + /* if (_r$1) { */ case 15: + if ((_entry$1 = count[ptrType$13.keyFor(t$1)], _entry$1 !== undefined ? _entry$1.v : 0) > 1 || ok) { + _tmp$2 = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$11.nil, false); + _tmp$3 = false; + StructField.copy(result, _tmp$2); + ok = _tmp$3; + return [result, ok]; + } + _r$2 = t$1.Field(i); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + StructField.copy(result, _r$2); + result.Index = sliceType$11.nil; + result.Index = $appendSlice(result.Index, scan.index); + result.Index = $append(result.Index, i); + ok = true; + _i$1++; + /* continue; */ $s = 7; continue; + /* } */ case 16: + if (ok || ntyp === ptrType$1.nil || !((ntyp.Kind() === 25))) { + _i$1++; + /* continue; */ $s = 7; continue; + } + styp = ntyp.kindType; + if ((_entry$2 = nextCount[ptrType$13.keyFor(styp)], _entry$2 !== undefined ? _entry$2.v : 0) > 0) { + _key$1 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$13.keyFor(_key$1)] = { k: _key$1, v: 2 }; + _i$1++; + /* continue; */ $s = 7; continue; + } + if (nextCount === false) { + nextCount = $makeMap(ptrType$13.keyFor, []); + } + _key$2 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$13.keyFor(_key$2)] = { k: _key$2, v: 1 }; + if ((_entry$3 = count[ptrType$13.keyFor(t$1)], _entry$3 !== undefined ? _entry$3.v : 0) > 1) { + _key$3 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$13.keyFor(_key$3)] = { k: _key$3, v: 2 }; + } + index = sliceType$11.nil; + index = $appendSlice(index, scan.index); + index = $append(index, i); + next = $append(next, new fieldScan.ptr(styp, index)); + _i$1++; + /* } */ $s = 7; continue; case 8: + _i++; + /* } */ $s = 3; continue; case 4: + if (ok) { + /* break; */ $s = 2; continue; + } + /* } */ $s = 1; continue; case 2: + return [result, ok]; + /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByNameFunc }; } $f.$ptr = $ptr; $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._i = _i; $f._i$1 = _i$1; $f._key = _key; $f._key$1 = _key$1; $f._key$2 = _key$2; $f._key$3 = _key$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.count = count; $f.current = current; $f.f = f; $f.fname = fname; $f.i = i; $f.index = index; $f.match = match; $f.next = next; $f.nextCount = nextCount; $f.ntyp = ntyp; $f.ok = ok; $f.result = result; $f.scan = scan; $f.styp = styp; $f.t = t; $f.t$1 = t$1; $f.visited = visited; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + structType.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; + structType.ptr.prototype.FieldByName = function(name) { + var $ptr, _i, _r, _r$1, _ref, _tmp, _tmp$1, _tuple, f, hasAnon, i, name, present, t, tf, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; f = $f.f; hasAnon = $f.hasAnon; i = $f.i; name = $f.name; present = $f.present; t = $f.t; tf = $f.tf; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + name = [name]; + f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$11.nil, false); + present = false; + t = this; + hasAnon = false; + /* */ if (!(name[0] === "")) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!(name[0] === "")) { */ case 1: + _ref = t.fields; + _i = 0; + /* while (true) { */ case 3: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } + i = _i; + tf = (x = t.fields, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + /* */ if (tf.name === ptrType$6.nil) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (tf.name === ptrType$6.nil) { */ case 5: + hasAnon = true; + _i++; + /* continue; */ $s = 3; continue; + /* } */ case 6: + /* */ if (tf.name.$get() === name[0]) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (tf.name.$get() === name[0]) { */ case 7: + _r = t.Field(i); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tmp = $clone(_r, StructField); + _tmp$1 = true; + StructField.copy(f, _tmp); + present = _tmp$1; + /* */ $s = 10; case 10: + return [f, present]; + /* } */ case 8: + _i++; + /* } */ $s = 3; continue; case 4: + /* } */ case 2: + if (!hasAnon) { + return [f, present]; + } + _r$1 = t.FieldByNameFunc((function(name) { return function(s) { + var $ptr, s; + return s === name[0]; + }; })(name)); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + StructField.copy(f, _tuple[0]); + present = _tuple[1]; + /* */ $s = 12; case 12: + return [f, present]; + /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByName }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.f = f; $f.hasAnon = hasAnon; $f.i = i; $f.name = name; $f.present = present; $f.t = t; $f.tf = tf; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + structType.prototype.FieldByName = function(name) { return this.$val.FieldByName(name); }; + PtrTo = function(t) { + var $ptr, t; + return $assertType(t, ptrType$1).ptrTo(); + }; + $pkg.PtrTo = PtrTo; + rtype.ptr.prototype.Implements = function(u) { + var $ptr, _r, t, u, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = this; + if ($interfaceIsEqual(u, $ifaceNil)) { + $panic(new $String("reflect: nil type passed to Type.Implements")); + } + _r = u.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 20))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 20))) { */ case 1: + $panic(new $String("reflect: non-interface type passed to Type.Implements")); + /* } */ case 2: + return implements$1($assertType(u, ptrType$1), t); + /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Implements }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; + }; + rtype.prototype.Implements = function(u) { return this.$val.Implements(u); }; + rtype.ptr.prototype.AssignableTo = function(u) { + var $ptr, t, u, uu; + t = this; + if ($interfaceIsEqual(u, $ifaceNil)) { + $panic(new $String("reflect: nil type passed to Type.AssignableTo")); + } + uu = $assertType(u, ptrType$1); + return directlyAssignable(uu, t) || implements$1(uu, t); + }; + rtype.prototype.AssignableTo = function(u) { return this.$val.AssignableTo(u); }; + rtype.ptr.prototype.ConvertibleTo = function(u) { + var $ptr, _r, t, u, uu, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; u = $f.u; uu = $f.uu; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = this; + if ($interfaceIsEqual(u, $ifaceNil)) { + $panic(new $String("reflect: nil type passed to Type.ConvertibleTo")); + } + uu = $assertType(u, ptrType$1); + _r = convertOp(uu, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return !(_r === $throwNilPointerError); + /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.ConvertibleTo }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.u = u; $f.uu = uu; $f.$s = $s; $f.$r = $r; return $f; + }; + rtype.prototype.ConvertibleTo = function(u) { return this.$val.ConvertibleTo(u); }; + implements$1 = function(T, V) { + var $ptr, T, V, i, i$1, j, j$1, t, tm, tm$1, v, v$1, vm, vm$1, x, x$1, x$2, x$3; + if (!((T.Kind() === 20))) { + return false; + } + t = T.kindType; + if (t.methods.$length === 0) { + return true; + } + if (V.Kind() === 20) { + v = V.kindType; + i = 0; + j = 0; + while (true) { + if (!(j < v.methods.$length)) { break; } + tm = (x = t.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + vm = (x$1 = v.methods, ((j < 0 || j >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + j])); + if (vm.name.$get() === tm.name.$get() && vm.pkgPath === tm.pkgPath && vm.typ === tm.typ) { + i = i + (1) >> 0; + if (i >= t.methods.$length) { + return true; + } + } + j = j + (1) >> 0; + } + return false; + } + v$1 = V.uncommonType.uncommon(); + if (v$1 === ptrType$7.nil) { + return false; + } + i$1 = 0; + j$1 = 0; + while (true) { + if (!(j$1 < v$1.methods.$length)) { break; } + tm$1 = (x$2 = t.methods, ((i$1 < 0 || i$1 >= x$2.$length) ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + i$1])); + vm$1 = (x$3 = v$1.methods, ((j$1 < 0 || j$1 >= x$3.$length) ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + j$1])); + if (vm$1.name.$get() === tm$1.name.$get() && vm$1.pkgPath === tm$1.pkgPath && vm$1.mtyp === tm$1.typ) { + i$1 = i$1 + (1) >> 0; + if (i$1 >= t.methods.$length) { + return true; + } + } + j$1 = j$1 + (1) >> 0; + } + return false; + }; + directlyAssignable = function(T, V) { + var $ptr, T, V; + if (T === V) { + return true; + } + if (!(T.Name() === "") && !(V.Name() === "") || !((T.Kind() === V.Kind()))) { + return false; + } + return haveIdenticalUnderlyingType(T, V); + }; + haveIdenticalUnderlyingType = function(T, V) { + var $ptr, T, V, _3, _i, _i$1, _i$2, _ref, _ref$1, _ref$2, i, i$1, i$2, kind, t, t$1, t$2, tf, typ, typ$1, v, v$1, v$2, vf, x, x$1, x$2, x$3; + if (T === V) { + return true; + } + kind = T.Kind(); + if (!((kind === V.Kind()))) { + return false; + } + if (1 <= kind && kind <= 16 || (kind === 24) || (kind === 26)) { + return true; + } + _3 = kind; + if (_3 === (17)) { + return $interfaceIsEqual(T.Elem(), V.Elem()) && (T.Len() === V.Len()); + } else if (_3 === (18)) { + if ((V.ChanDir() === 3) && $interfaceIsEqual(T.Elem(), V.Elem())) { + return true; + } + return (V.ChanDir() === T.ChanDir()) && $interfaceIsEqual(T.Elem(), V.Elem()); + } else if (_3 === (19)) { + t = T.kindType; + v = V.kindType; + if (!(t.dotdotdot === v.dotdotdot) || !((t.in$2.$length === v.in$2.$length)) || !((t.out.$length === v.out.$length))) { + return false; + } + _ref = t.in$2; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + typ = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (!(typ === (x = v.in$2, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])))) { + return false; + } + _i++; + } + _ref$1 = t.out; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$1 = _i$1; + typ$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); + if (!(typ$1 === (x$1 = v.out, ((i$1 < 0 || i$1 >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + i$1])))) { + return false; + } + _i$1++; + } + return true; + } else if (_3 === (20)) { + t$1 = T.kindType; + v$1 = V.kindType; + if ((t$1.methods.$length === 0) && (v$1.methods.$length === 0)) { + return true; + } + return false; + } else if (_3 === (21)) { + return $interfaceIsEqual(T.Key(), V.Key()) && $interfaceIsEqual(T.Elem(), V.Elem()); + } else if ((_3 === (22)) || (_3 === (23))) { + return $interfaceIsEqual(T.Elem(), V.Elem()); + } else if (_3 === (25)) { + t$2 = T.kindType; + v$2 = V.kindType; + if (!((t$2.fields.$length === v$2.fields.$length))) { + return false; + } + _ref$2 = t$2.fields; + _i$2 = 0; + while (true) { + if (!(_i$2 < _ref$2.$length)) { break; } + i$2 = _i$2; + tf = (x$2 = t$2.fields, ((i$2 < 0 || i$2 >= x$2.$length) ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + i$2])); + vf = (x$3 = v$2.fields, ((i$2 < 0 || i$2 >= x$3.$length) ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + i$2])); + if (!(tf.name === vf.name) && (tf.name === ptrType$6.nil || vf.name === ptrType$6.nil || !(tf.name.$get() === vf.name.$get()))) { + return false; + } + if (!(tf.pkgPath === vf.pkgPath) && (tf.pkgPath === ptrType$6.nil || vf.pkgPath === ptrType$6.nil || !(tf.pkgPath.$get() === vf.pkgPath.$get()))) { + return false; + } + if (!(tf.typ === vf.typ)) { + return false; + } + if (!(tf.tag === vf.tag) && (tf.tag === ptrType$6.nil || vf.tag === ptrType$6.nil || !(tf.tag.$get() === vf.tag.$get()))) { + return false; + } + if (!((tf.offset === vf.offset))) { + return false; + } + _i$2++; + } + return true; + } + return false; + }; + toType = function(t) { + var $ptr, t; + if (t === ptrType$1.nil) { + return $ifaceNil; + } + return t; + }; + ifaceIndir = function(t) { + var $ptr, t; + return ((t.kind & 32) >>> 0) === 0; + }; + flag.prototype.kind = function() { + var $ptr, f; + f = this.$val; + return (((f & 31) >>> 0) >>> 0); + }; + $ptrType(flag).prototype.kind = function() { return new flag(this.$get()).kind(); }; + Value.ptr.prototype.pointer = function() { + var $ptr, v; + v = this; + if (!((v.typ.size === 4)) || !v.typ.pointers()) { + $panic(new $String("can't call pointer on a non-pointer Value")); + } + if (!((((v.flag & 128) >>> 0) === 0))) { + return v.ptr.$get(); + } + return v.ptr; + }; + Value.prototype.pointer = function() { return this.$val.pointer(); }; + ValueError.ptr.prototype.Error = function() { + var $ptr, e; + e = this; + if (e.Kind === 0) { + return "reflect: call of " + e.Method + " on zero Value"; + } + return "reflect: call of " + e.Method + " on " + new Kind(e.Kind).String() + " Value"; + }; + ValueError.prototype.Error = function() { return this.$val.Error(); }; + flag.prototype.mustBe = function(expected) { + var $ptr, expected, f; + f = this.$val; + if (!((new flag(f).kind() === expected))) { + $panic(new ValueError.ptr(methodName(), new flag(f).kind())); + } + }; + $ptrType(flag).prototype.mustBe = function(expected) { return new flag(this.$get()).mustBe(expected); }; + flag.prototype.mustBeExported = function() { + var $ptr, f; + f = this.$val; + if (f === 0) { + $panic(new ValueError.ptr(methodName(), 0)); + } + if (!((((f & 96) >>> 0) === 0))) { + $panic(new $String("reflect: " + methodName() + " using value obtained using unexported field")); + } + }; + $ptrType(flag).prototype.mustBeExported = function() { return new flag(this.$get()).mustBeExported(); }; + flag.prototype.mustBeAssignable = function() { + var $ptr, f; + f = this.$val; + if (f === 0) { + $panic(new ValueError.ptr(methodName(), 0)); + } + if (!((((f & 96) >>> 0) === 0))) { + $panic(new $String("reflect: " + methodName() + " using value obtained using unexported field")); + } + if (((f & 256) >>> 0) === 0) { + $panic(new $String("reflect: " + methodName() + " using unaddressable value")); + } + }; + $ptrType(flag).prototype.mustBeAssignable = function() { return new flag(this.$get()).mustBeAssignable(); }; + Value.ptr.prototype.Addr = function() { + var $ptr, v; + v = this; + if (((v.flag & 256) >>> 0) === 0) { + $panic(new $String("reflect.Value.Addr of unaddressable value")); + } + return new Value.ptr(v.typ.ptrTo(), v.ptr, ((((v.flag & 96) >>> 0)) | 22) >>> 0); + }; + Value.prototype.Addr = function() { return this.$val.Addr(); }; + Value.ptr.prototype.Bool = function() { + var $ptr, v; + v = this; + new flag(v.flag).mustBe(1); + return v.ptr.$get(); + }; + Value.prototype.Bool = function() { return this.$val.Bool(); }; + Value.ptr.prototype.Bytes = function() { + var $ptr, _r, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBe(23); + _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 8))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 8))) { */ case 1: + $panic(new $String("reflect.Value.Bytes of non-byte slice")); + /* } */ case 2: + return v.ptr.$get(); + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Bytes }; } $f.$ptr = $ptr; $f._r = _r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Bytes = function() { return this.$val.Bytes(); }; + Value.ptr.prototype.runes = function() { + var $ptr, _r, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBe(23); + _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 5))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 5))) { */ case 1: + $panic(new $String("reflect.Value.Bytes of non-rune slice")); + /* } */ case 2: + return v.ptr.$get(); + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.runes }; } $f.$ptr = $ptr; $f._r = _r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.runes = function() { return this.$val.runes(); }; + Value.ptr.prototype.CanAddr = function() { + var $ptr, v; + v = this; + return !((((v.flag & 256) >>> 0) === 0)); + }; + Value.prototype.CanAddr = function() { return this.$val.CanAddr(); }; + Value.ptr.prototype.CanSet = function() { + var $ptr, v; + v = this; + return ((v.flag & 352) >>> 0) === 256; + }; + Value.prototype.CanSet = function() { return this.$val.CanSet(); }; + Value.ptr.prototype.Call = function(in$1) { + var $ptr, _r, in$1, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; in$1 = $f.in$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBe(19); + new flag(v.flag).mustBeExported(); + _r = v.call("Call", in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Call }; } $f.$ptr = $ptr; $f._r = _r; $f.in$1 = in$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Call = function(in$1) { return this.$val.Call(in$1); }; + Value.ptr.prototype.CallSlice = function(in$1) { + var $ptr, _r, in$1, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; in$1 = $f.in$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBe(19); + new flag(v.flag).mustBeExported(); + _r = v.call("CallSlice", in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.CallSlice }; } $f.$ptr = $ptr; $f._r = _r; $f.in$1 = in$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.CallSlice = function(in$1) { return this.$val.CallSlice(in$1); }; + Value.ptr.prototype.Complex = function() { + var $ptr, _2, k, v, x; + v = this; + k = new flag(v.flag).kind(); + _2 = k; + if (_2 === (15)) { + return (x = v.ptr.$get(), new $Complex128(x.$real, x.$imag)); + } else if (_2 === (16)) { + return v.ptr.$get(); + } + $panic(new ValueError.ptr("reflect.Value.Complex", new flag(v.flag).kind())); + }; + Value.prototype.Complex = function() { return this.$val.Complex(); }; + Value.ptr.prototype.FieldByIndex = function(index) { + var $ptr, _i, _r, _r$1, _r$2, _r$3, _ref, _v, i, index, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _v = $f._v; i = $f.i; index = $f.index; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + /* */ if (index.$length === 1) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (index.$length === 1) { */ case 1: + _r = v.Field((0 >= index.$length ? $throwRuntimeError("index out of range") : index.$array[index.$offset + 0])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return _r; + /* } */ case 2: + new flag(v.flag).mustBe(25); + _ref = index; + _i = 0; + /* while (true) { */ case 5: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 6; continue; } + i = _i; + x = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + /* */ if (i > 0) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (i > 0) { */ case 7: + if (!(v.Kind() === 22)) { _v = false; $s = 11; continue s; } + _r$1 = v.typ.Elem().Kind(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _v = _r$1 === 25; case 11: + /* */ if (_v) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (_v) { */ case 9: + if (v.IsNil()) { + $panic(new $String("reflect: indirection through nil pointer to embedded struct")); + } + _r$2 = v.Elem(); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + v = _r$2; + /* } */ case 10: + /* } */ case 8: + _r$3 = v.Field(x); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + v = _r$3; + _i++; + /* } */ $s = 5; continue; case 6: + return v; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByIndex }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._v = _v; $f.i = i; $f.index = index; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; + Value.ptr.prototype.FieldByName = function(name) { + var $ptr, _r, _r$1, _tuple, f, name, ok, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; name = $f.name; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBe(25); + _r = v.typ.FieldByName(name); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + f = $clone(_tuple[0], StructField); + ok = _tuple[1]; + /* */ if (ok) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (ok) { */ case 2: + _r$1 = v.FieldByIndex(f.Index); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 5; case 5: + return _r$1; + /* } */ case 3: + return new Value.ptr(ptrType$1.nil, 0, 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByName }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.name = name; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.FieldByName = function(name) { return this.$val.FieldByName(name); }; + Value.ptr.prototype.FieldByNameFunc = function(match) { + var $ptr, _r, _r$1, _tuple, f, match, ok, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; match = $f.match; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + _r = v.typ.FieldByNameFunc(match); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + f = $clone(_tuple[0], StructField); + ok = _tuple[1]; + /* */ if (ok) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (ok) { */ case 2: + _r$1 = v.FieldByIndex(f.Index); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 5; case 5: + return _r$1; + /* } */ case 3: + return new Value.ptr(ptrType$1.nil, 0, 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByNameFunc }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.match = match; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; + Value.ptr.prototype.Float = function() { + var $ptr, _4, k, v; + v = this; + k = new flag(v.flag).kind(); + _4 = k; + if (_4 === (13)) { + return v.ptr.$get(); + } else if (_4 === (14)) { + return v.ptr.$get(); + } + $panic(new ValueError.ptr("reflect.Value.Float", new flag(v.flag).kind())); + }; + Value.prototype.Float = function() { return this.$val.Float(); }; + Value.ptr.prototype.Int = function() { + var $ptr, _6, k, p, v; + v = this; + k = new flag(v.flag).kind(); + p = v.ptr; + _6 = k; + if (_6 === (2)) { + return new $Int64(0, p.$get()); + } else if (_6 === (3)) { + return new $Int64(0, p.$get()); + } else if (_6 === (4)) { + return new $Int64(0, p.$get()); + } else if (_6 === (5)) { + return new $Int64(0, p.$get()); + } else if (_6 === (6)) { + return p.$get(); + } + $panic(new ValueError.ptr("reflect.Value.Int", new flag(v.flag).kind())); + }; + Value.prototype.Int = function() { return this.$val.Int(); }; + Value.ptr.prototype.CanInterface = function() { + var $ptr, v; + v = this; + if (v.flag === 0) { + $panic(new ValueError.ptr("reflect.Value.CanInterface", 0)); + } + return ((v.flag & 96) >>> 0) === 0; + }; + Value.prototype.CanInterface = function() { return this.$val.CanInterface(); }; + Value.ptr.prototype.Interface = function() { + var $ptr, _r, i, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + i = $ifaceNil; + v = this; + _r = valueInterface(v, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + i = _r; + /* */ $s = 2; case 2: + return i; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Interface }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Interface = function() { return this.$val.Interface(); }; + Value.ptr.prototype.IsValid = function() { + var $ptr, v; + v = this; + return !((v.flag === 0)); + }; + Value.prototype.IsValid = function() { return this.$val.IsValid(); }; + Value.ptr.prototype.Kind = function() { + var $ptr, v; + v = this; + return new flag(v.flag).kind(); + }; + Value.prototype.Kind = function() { return this.$val.Kind(); }; + Value.ptr.prototype.MapIndex = function(key) { + var $ptr, _r, c, e, fl, k, key, tt, typ, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; c = $f.c; e = $f.e; fl = $f.fl; k = $f.k; key = $f.key; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + key = key; + v = this; + new flag(v.flag).mustBe(21); + tt = v.typ.kindType; + _r = key.assignTo("reflect.Value.MapIndex", tt.key, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + key = _r; + k = 0; + if (!((((key.flag & 128) >>> 0) === 0))) { + k = key.ptr; + } else { + k = (key.$ptr_ptr || (key.$ptr_ptr = new ptrType$18(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key))); + } + e = mapaccess(v.typ, v.pointer(), k); + if (e === 0) { + return new Value.ptr(ptrType$1.nil, 0, 0); + } + typ = tt.elem; + fl = ((((v.flag | key.flag) >>> 0)) & 96) >>> 0; + fl = (fl | ((typ.Kind() >>> 0))) >>> 0; + if (ifaceIndir(typ)) { + c = unsafe_New(typ); + typedmemmove(typ, c, e); + return new Value.ptr(typ, c, (fl | 128) >>> 0); + } else { + return new Value.ptr(typ, e.$get(), fl); + } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapIndex }; } $f.$ptr = $ptr; $f._r = _r; $f.c = c; $f.e = e; $f.fl = fl; $f.k = k; $f.key = key; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.MapIndex = function(key) { return this.$val.MapIndex(key); }; + Value.ptr.prototype.MapKeys = function() { + var $ptr, _r, a, c, fl, i, it, key, keyType, m, mlen, tt, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; a = $f.a; c = $f.c; fl = $f.fl; i = $f.i; it = $f.it; key = $f.key; keyType = $f.keyType; m = $f.m; mlen = $f.mlen; tt = $f.tt; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBe(21); + tt = v.typ.kindType; + keyType = tt.key; + fl = (((v.flag & 96) >>> 0) | (keyType.Kind() >>> 0)) >>> 0; + m = v.pointer(); + mlen = 0; + if (!(m === 0)) { + mlen = maplen(m); + } + it = mapiterinit(v.typ, m); + a = $makeSlice(sliceType$8, mlen); + i = 0; + i = 0; + /* while (true) { */ case 1: + /* if (!(i < a.$length)) { break; } */ if(!(i < a.$length)) { $s = 2; continue; } + _r = mapiterkey(it); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + key = _r; + if (key === 0) { + /* break; */ $s = 2; continue; + } + if (ifaceIndir(keyType)) { + c = unsafe_New(keyType); + typedmemmove(keyType, c, key); + ((i < 0 || i >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + i] = new Value.ptr(keyType, c, (fl | 128) >>> 0)); + } else { + ((i < 0 || i >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + i] = new Value.ptr(keyType, key.$get(), fl)); + } + mapiternext(it); + i = i + (1) >> 0; + /* } */ $s = 1; continue; case 2: + return $subslice(a, 0, i); + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapKeys }; } $f.$ptr = $ptr; $f._r = _r; $f.a = a; $f.c = c; $f.fl = fl; $f.i = i; $f.it = it; $f.key = key; $f.keyType = keyType; $f.m = m; $f.mlen = mlen; $f.tt = tt; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.MapKeys = function() { return this.$val.MapKeys(); }; + Value.ptr.prototype.Method = function(i) { + var $ptr, fl, i, v; + v = this; + if (v.typ === ptrType$1.nil) { + $panic(new ValueError.ptr("reflect.Value.Method", 0)); + } + if (!((((v.flag & 512) >>> 0) === 0)) || (i >>> 0) >= (v.typ.NumMethod() >>> 0)) { + $panic(new $String("reflect: Method index out of range")); + } + if ((v.typ.Kind() === 20) && v.IsNil()) { + $panic(new $String("reflect: Method on nil interface value")); + } + fl = (v.flag & 160) >>> 0; + fl = (fl | (19)) >>> 0; + fl = (fl | (((((i >>> 0) << 10 >>> 0) | 512) >>> 0))) >>> 0; + return new Value.ptr(v.typ, v.ptr, fl); + }; + Value.prototype.Method = function(i) { return this.$val.Method(i); }; + Value.ptr.prototype.NumMethod = function() { + var $ptr, v; + v = this; + if (v.typ === ptrType$1.nil) { + $panic(new ValueError.ptr("reflect.Value.NumMethod", 0)); + } + if (!((((v.flag & 512) >>> 0) === 0))) { + return 0; + } + return v.typ.NumMethod(); + }; + Value.prototype.NumMethod = function() { return this.$val.NumMethod(); }; + Value.ptr.prototype.MethodByName = function(name) { + var $ptr, _tuple, m, name, ok, v; + v = this; + if (v.typ === ptrType$1.nil) { + $panic(new ValueError.ptr("reflect.Value.MethodByName", 0)); + } + if (!((((v.flag & 512) >>> 0) === 0))) { + return new Value.ptr(ptrType$1.nil, 0, 0); + } + _tuple = v.typ.MethodByName(name); + m = $clone(_tuple[0], Method); + ok = _tuple[1]; + if (!ok) { + return new Value.ptr(ptrType$1.nil, 0, 0); + } + return v.Method(m.Index); + }; + Value.prototype.MethodByName = function(name) { return this.$val.MethodByName(name); }; + Value.ptr.prototype.NumField = function() { + var $ptr, tt, v; + v = this; + new flag(v.flag).mustBe(25); + tt = v.typ.kindType; + return tt.fields.$length; + }; + Value.prototype.NumField = function() { return this.$val.NumField(); }; + Value.ptr.prototype.OverflowComplex = function(x) { + var $ptr, _9, k, v, x; + v = this; + k = new flag(v.flag).kind(); + _9 = k; + if (_9 === (15)) { + return overflowFloat32(x.$real) || overflowFloat32(x.$imag); + } else if (_9 === (16)) { + return false; + } + $panic(new ValueError.ptr("reflect.Value.OverflowComplex", new flag(v.flag).kind())); + }; + Value.prototype.OverflowComplex = function(x) { return this.$val.OverflowComplex(x); }; + Value.ptr.prototype.OverflowFloat = function(x) { + var $ptr, _10, k, v, x; + v = this; + k = new flag(v.flag).kind(); + _10 = k; + if (_10 === (13)) { + return overflowFloat32(x); + } else if (_10 === (14)) { + return false; + } + $panic(new ValueError.ptr("reflect.Value.OverflowFloat", new flag(v.flag).kind())); + }; + Value.prototype.OverflowFloat = function(x) { return this.$val.OverflowFloat(x); }; + overflowFloat32 = function(x) { + var $ptr, x; + if (x < 0) { + x = -x; + } + return 3.4028234663852886e+38 < x && x <= 1.7976931348623157e+308; + }; + Value.ptr.prototype.OverflowInt = function(x) { + var $ptr, _11, bitSize, k, trunc, v, x; + v = this; + k = new flag(v.flag).kind(); + _11 = k; + if ((_11 === (2)) || (_11 === (3)) || (_11 === (4)) || (_11 === (5)) || (_11 === (6))) { + bitSize = $imul(v.typ.size, 8) >>> 0; + trunc = $shiftRightInt64(($shiftLeft64(x, ((64 - bitSize >>> 0)))), ((64 - bitSize >>> 0))); + return !((x.$high === trunc.$high && x.$low === trunc.$low)); + } + $panic(new ValueError.ptr("reflect.Value.OverflowInt", new flag(v.flag).kind())); + }; + Value.prototype.OverflowInt = function(x) { return this.$val.OverflowInt(x); }; + Value.ptr.prototype.OverflowUint = function(x) { + var $ptr, _12, bitSize, k, trunc, v, x; + v = this; + k = new flag(v.flag).kind(); + _12 = k; + if ((_12 === (7)) || (_12 === (12)) || (_12 === (8)) || (_12 === (9)) || (_12 === (10)) || (_12 === (11))) { + bitSize = $imul(v.typ.size, 8) >>> 0; + trunc = $shiftRightUint64(($shiftLeft64(x, ((64 - bitSize >>> 0)))), ((64 - bitSize >>> 0))); + return !((x.$high === trunc.$high && x.$low === trunc.$low)); + } + $panic(new ValueError.ptr("reflect.Value.OverflowUint", new flag(v.flag).kind())); + }; + Value.prototype.OverflowUint = function(x) { return this.$val.OverflowUint(x); }; + Value.ptr.prototype.Recv = function() { + var $ptr, _r, _tuple, ok, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; ok = $f.ok; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + x = new Value.ptr(ptrType$1.nil, 0, 0); + ok = false; + v = this; + new flag(v.flag).mustBe(18); + new flag(v.flag).mustBeExported(); + _r = v.recv(false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + x = _tuple[0]; + ok = _tuple[1]; + /* */ $s = 2; case 2: + return [x, ok]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Recv }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.ok = ok; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Recv = function() { return this.$val.Recv(); }; + Value.ptr.prototype.recv = function(nb) { + var $ptr, _r, _tuple, nb, ok, p, selected, t, tt, v, val, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; nb = $f.nb; ok = $f.ok; p = $f.p; selected = $f.selected; t = $f.t; tt = $f.tt; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + val = new Value.ptr(ptrType$1.nil, 0, 0); + ok = false; + v = this; + tt = v.typ.kindType; + if (((tt.dir >> 0) & 1) === 0) { + $panic(new $String("reflect: recv on send-only channel")); + } + t = tt.elem; + val = new Value.ptr(t, 0, (t.Kind() >>> 0)); + p = 0; + if (ifaceIndir(t)) { + p = unsafe_New(t); + val.ptr = p; + val.flag = (val.flag | (128)) >>> 0; + } else { + p = (val.$ptr_ptr || (val.$ptr_ptr = new ptrType$18(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, val))); + } + _r = chanrecv(v.typ, v.pointer(), nb, p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + selected = _tuple[0]; + ok = _tuple[1]; + if (!selected) { + val = new Value.ptr(ptrType$1.nil, 0, 0); + } + return [val, ok]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.recv }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.nb = nb; $f.ok = ok; $f.p = p; $f.selected = selected; $f.t = t; $f.tt = tt; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.recv = function(nb) { return this.$val.recv(nb); }; + Value.ptr.prototype.Send = function(x) { + var $ptr, _r, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + x = x; + v = this; + new flag(v.flag).mustBe(18); + new flag(v.flag).mustBeExported(); + _r = v.send(x, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r; + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Send }; } $f.$ptr = $ptr; $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Send = function(x) { return this.$val.Send(x); }; + Value.ptr.prototype.send = function(x, nb) { + var $ptr, _r, _r$1, nb, p, selected, tt, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; nb = $f.nb; p = $f.p; selected = $f.selected; tt = $f.tt; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + selected = false; + x = x; + v = this; + tt = v.typ.kindType; + if (((tt.dir >> 0) & 2) === 0) { + $panic(new $String("reflect: send on recv-only channel")); + } + new flag(x.flag).mustBeExported(); + _r = x.assignTo("reflect.Value.Send", tt.elem, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + x = _r; + p = 0; + if (!((((x.flag & 128) >>> 0) === 0))) { + p = x.ptr; + } else { + p = (x.$ptr_ptr || (x.$ptr_ptr = new ptrType$18(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, x))); + } + _r$1 = chansend(v.typ, v.pointer(), p, nb); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + selected = _r$1; + /* */ $s = 3; case 3: + return selected; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.send }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.nb = nb; $f.p = p; $f.selected = selected; $f.tt = tt; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.send = function(x, nb) { return this.$val.send(x, nb); }; + Value.ptr.prototype.SetBool = function(x) { + var $ptr, v, x; + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(1); + v.ptr.$set(x); + }; + Value.prototype.SetBool = function(x) { return this.$val.SetBool(x); }; + Value.ptr.prototype.setRunes = function(x) { + var $ptr, _r, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(23); + _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!((_r === 5))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r === 5))) { */ case 1: + $panic(new $String("reflect.Value.setRunes of non-rune slice")); + /* } */ case 2: + v.ptr.$set(x); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.setRunes }; } $f.$ptr = $ptr; $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.setRunes = function(x) { return this.$val.setRunes(x); }; + Value.ptr.prototype.SetComplex = function(x) { + var $ptr, _14, k, v, x; + v = this; + new flag(v.flag).mustBeAssignable(); + k = new flag(v.flag).kind(); + _14 = k; + if (_14 === (15)) { + v.ptr.$set(new $Complex64(x.$real, x.$imag)); + } else if (_14 === (16)) { + v.ptr.$set(x); + } else { + $panic(new ValueError.ptr("reflect.Value.SetComplex", new flag(v.flag).kind())); + } + }; + Value.prototype.SetComplex = function(x) { return this.$val.SetComplex(x); }; + Value.ptr.prototype.SetFloat = function(x) { + var $ptr, _15, k, v, x; + v = this; + new flag(v.flag).mustBeAssignable(); + k = new flag(v.flag).kind(); + _15 = k; + if (_15 === (13)) { + v.ptr.$set($fround(x)); + } else if (_15 === (14)) { + v.ptr.$set(x); + } else { + $panic(new ValueError.ptr("reflect.Value.SetFloat", new flag(v.flag).kind())); + } + }; + Value.prototype.SetFloat = function(x) { return this.$val.SetFloat(x); }; + Value.ptr.prototype.SetInt = function(x) { + var $ptr, _16, k, v, x; + v = this; + new flag(v.flag).mustBeAssignable(); + k = new flag(v.flag).kind(); + _16 = k; + if (_16 === (2)) { + v.ptr.$set(((x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); + } else if (_16 === (3)) { + v.ptr.$set(((x.$low + ((x.$high >> 31) * 4294967296)) << 24 >> 24)); + } else if (_16 === (4)) { + v.ptr.$set(((x.$low + ((x.$high >> 31) * 4294967296)) << 16 >> 16)); + } else if (_16 === (5)) { + v.ptr.$set(((x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); + } else if (_16 === (6)) { + v.ptr.$set(x); + } else { + $panic(new ValueError.ptr("reflect.Value.SetInt", new flag(v.flag).kind())); + } + }; + Value.prototype.SetInt = function(x) { return this.$val.SetInt(x); }; + Value.ptr.prototype.SetMapIndex = function(key, val) { + var $ptr, _r, _r$1, e, k, key, tt, v, val, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; e = $f.e; k = $f.k; key = $f.key; tt = $f.tt; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + val = val; + key = key; + v = this; + new flag(v.flag).mustBe(21); + new flag(v.flag).mustBeExported(); + new flag(key.flag).mustBeExported(); + tt = v.typ.kindType; + _r = key.assignTo("reflect.Value.SetMapIndex", tt.key, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + key = _r; + k = 0; + if (!((((key.flag & 128) >>> 0) === 0))) { + k = key.ptr; + } else { + k = (key.$ptr_ptr || (key.$ptr_ptr = new ptrType$18(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key))); + } + if (val.typ === ptrType$1.nil) { + mapdelete(v.typ, v.pointer(), k); + return; + } + new flag(val.flag).mustBeExported(); + _r$1 = val.assignTo("reflect.Value.SetMapIndex", tt.elem, 0); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + val = _r$1; + e = 0; + if (!((((val.flag & 128) >>> 0) === 0))) { + e = val.ptr; + } else { + e = (val.$ptr_ptr || (val.$ptr_ptr = new ptrType$18(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, val))); + } + $r = mapassign(v.typ, v.pointer(), k, e); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.SetMapIndex }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.e = e; $f.k = k; $f.key = key; $f.tt = tt; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.SetMapIndex = function(key, val) { return this.$val.SetMapIndex(key, val); }; + Value.ptr.prototype.SetUint = function(x) { + var $ptr, _17, k, v, x; + v = this; + new flag(v.flag).mustBeAssignable(); + k = new flag(v.flag).kind(); + _17 = k; + if (_17 === (7)) { + v.ptr.$set((x.$low >>> 0)); + } else if (_17 === (8)) { + v.ptr.$set((x.$low << 24 >>> 24)); + } else if (_17 === (9)) { + v.ptr.$set((x.$low << 16 >>> 16)); + } else if (_17 === (10)) { + v.ptr.$set((x.$low >>> 0)); + } else if (_17 === (11)) { + v.ptr.$set(x); + } else if (_17 === (12)) { + v.ptr.$set((x.$low >>> 0)); + } else { + $panic(new ValueError.ptr("reflect.Value.SetUint", new flag(v.flag).kind())); + } + }; + Value.prototype.SetUint = function(x) { return this.$val.SetUint(x); }; + Value.ptr.prototype.SetPointer = function(x) { + var $ptr, v, x; + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(26); + v.ptr.$set(x); + }; + Value.prototype.SetPointer = function(x) { return this.$val.SetPointer(x); }; + Value.ptr.prototype.SetString = function(x) { + var $ptr, v, x; + v = this; + new flag(v.flag).mustBeAssignable(); + new flag(v.flag).mustBe(24); + v.ptr.$set(x); + }; + Value.prototype.SetString = function(x) { return this.$val.SetString(x); }; + Value.ptr.prototype.String = function() { + var $ptr, _20, _r, k, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _20 = $f._20; _r = $f._r; k = $f.k; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + k = new flag(v.flag).kind(); + _20 = k; + if (_20 === (0)) { + return ""; + } else if (_20 === (24)) { + return v.ptr.$get(); + } + _r = v.Type().String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return "<" + _r + " Value>"; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.String }; } $f.$ptr = $ptr; $f._20 = _20; $f._r = _r; $f.k = k; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.String = function() { return this.$val.String(); }; + Value.ptr.prototype.TryRecv = function() { + var $ptr, _r, _tuple, ok, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; ok = $f.ok; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + x = new Value.ptr(ptrType$1.nil, 0, 0); + ok = false; + v = this; + new flag(v.flag).mustBe(18); + new flag(v.flag).mustBeExported(); + _r = v.recv(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + x = _tuple[0]; + ok = _tuple[1]; + /* */ $s = 2; case 2: + return [x, ok]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.TryRecv }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.ok = ok; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.TryRecv = function() { return this.$val.TryRecv(); }; + Value.ptr.prototype.TrySend = function(x) { + var $ptr, _r, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + x = x; + v = this; + new flag(v.flag).mustBe(18); + new flag(v.flag).mustBeExported(); + _r = v.send(x, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.TrySend }; } $f.$ptr = $ptr; $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.TrySend = function(x) { return this.$val.TrySend(x); }; + Value.ptr.prototype.Type = function() { + var $ptr, f, i, m, m$1, tt, ut, v, x, x$1; + v = this; + f = v.flag; + if (f === 0) { + $panic(new ValueError.ptr("reflect.Value.Type", 0)); + } + if (((f & 512) >>> 0) === 0) { + return v.typ; + } + i = (v.flag >> 0) >> 10 >> 0; + if (v.typ.Kind() === 20) { + tt = v.typ.kindType; + if ((i >>> 0) >= (tt.methods.$length >>> 0)) { + $panic(new $String("reflect: internal error: invalid method index")); + } + m = (x = tt.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + return m.typ; + } + ut = v.typ.uncommonType.uncommon(); + if (ut === ptrType$7.nil || (i >>> 0) >= (ut.methods.$length >>> 0)) { + $panic(new $String("reflect: internal error: invalid method index")); + } + m$1 = (x$1 = ut.methods, ((i < 0 || i >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + i])); + return m$1.mtyp; + }; + Value.prototype.Type = function() { return this.$val.Type(); }; + Value.ptr.prototype.Uint = function() { + var $ptr, _21, k, p, v, x; + v = this; + k = new flag(v.flag).kind(); + p = v.ptr; + _21 = k; + if (_21 === (7)) { + return new $Uint64(0, p.$get()); + } else if (_21 === (8)) { + return new $Uint64(0, p.$get()); + } else if (_21 === (9)) { + return new $Uint64(0, p.$get()); + } else if (_21 === (10)) { + return new $Uint64(0, p.$get()); + } else if (_21 === (11)) { + return p.$get(); + } else if (_21 === (12)) { + return (x = p.$get(), new $Uint64(0, x.constructor === Number ? x : 1)); + } + $panic(new ValueError.ptr("reflect.Value.Uint", new flag(v.flag).kind())); + }; + Value.prototype.Uint = function() { return this.$val.Uint(); }; + Value.ptr.prototype.UnsafeAddr = function() { + var $ptr, v; + v = this; + if (v.typ === ptrType$1.nil) { + $panic(new ValueError.ptr("reflect.Value.UnsafeAddr", 0)); + } + if (((v.flag & 256) >>> 0) === 0) { + $panic(new $String("reflect.Value.UnsafeAddr of unaddressable value")); + } + return v.ptr; + }; + Value.prototype.UnsafeAddr = function() { return this.$val.UnsafeAddr(); }; + New = function(typ) { + var $ptr, _r, _r$1, fl, ptr, typ, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; fl = $f.fl; ptr = $f.ptr; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + if ($interfaceIsEqual(typ, $ifaceNil)) { + $panic(new $String("reflect: New(nil)")); + } + ptr = unsafe_New($assertType(typ, ptrType$1)); + fl = 22; + _r = typ.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = _r.ptrTo(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 3; case 3: + return new Value.ptr(_r$1, ptr, fl); + /* */ } return; } if ($f === undefined) { $f = { $blk: New }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.fl = fl; $f.ptr = ptr; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.New = New; + Value.ptr.prototype.assignTo = function(context, dst, target) { + var $ptr, _r, _r$1, context, dst, fl, target, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; context = $f.context; dst = $f.dst; fl = $f.fl; target = $f.target; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: + _r = makeMethodValue(context, v); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + v = _r; + /* } */ case 2: + /* */ if (directlyAssignable(dst, v.typ)) { $s = 5; continue; } + /* */ if (implements$1(dst, v.typ)) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if (directlyAssignable(dst, v.typ)) { */ case 5: + v.typ = dst; + fl = (v.flag & 480) >>> 0; + fl = (fl | ((dst.Kind() >>> 0))) >>> 0; + return new Value.ptr(dst, v.ptr, fl); + /* } else if (implements$1(dst, v.typ)) { */ case 6: + if (target === 0) { + target = unsafe_New(dst); + } + _r$1 = valueInterface(v, false); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + x = _r$1; + if (dst.NumMethod() === 0) { + target.$set(x); + } else { + ifaceE2I(dst, x, target); + } + return new Value.ptr(dst, target, 148); + /* } */ case 7: + case 4: + $panic(new $String(context + ": value of type " + v.typ.String() + " is not assignable to type " + dst.String())); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.assignTo }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.context = context; $f.dst = dst; $f.fl = fl; $f.target = target; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.assignTo = function(context, dst, target) { return this.$val.assignTo(context, dst, target); }; + Value.ptr.prototype.Convert = function(t) { + var $ptr, _r, _r$1, _r$2, _r$3, _r$4, op, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; op = $f.op; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = this; + /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: + _r = makeMethodValue("Convert", v); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + v = _r; + /* } */ case 2: + _r$1 = t.common(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = convertOp(_r$1, v.typ); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + op = _r$2; + /* */ if (op === $throwNilPointerError) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if (op === $throwNilPointerError) { */ case 6: + _r$3 = t.String(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $panic(new $String("reflect.Value.Convert: value of type " + v.typ.String() + " cannot be converted to type " + _r$3)); + /* } */ case 7: + _r$4 = op(v, t); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + /* */ $s = 10; case 10: + return _r$4; + /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Convert }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.op = op; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Value.prototype.Convert = function(t) { return this.$val.Convert(t); }; + convertOp = function(dst, src) { + var $ptr, _23, _24, _25, _26, _27, _28, _29, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _v, _v$1, _v$2, dst, src, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _23 = $f._23; _24 = $f._24; _25 = $f._25; _26 = $f._26; _27 = $f._27; _28 = $f._28; _29 = $f._29; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; dst = $f.dst; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _23 = src.Kind(); + /* */ if ((_23 === (2)) || (_23 === (3)) || (_23 === (4)) || (_23 === (5)) || (_23 === (6))) { $s = 2; continue; } + /* */ if ((_23 === (7)) || (_23 === (8)) || (_23 === (9)) || (_23 === (10)) || (_23 === (11)) || (_23 === (12))) { $s = 3; continue; } + /* */ if ((_23 === (13)) || (_23 === (14))) { $s = 4; continue; } + /* */ if ((_23 === (15)) || (_23 === (16))) { $s = 5; continue; } + /* */ if (_23 === (24)) { $s = 6; continue; } + /* */ if (_23 === (23)) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if ((_23 === (2)) || (_23 === (3)) || (_23 === (4)) || (_23 === (5)) || (_23 === (6))) { */ case 2: + _24 = dst.Kind(); + if ((_24 === (2)) || (_24 === (3)) || (_24 === (4)) || (_24 === (5)) || (_24 === (6)) || (_24 === (7)) || (_24 === (8)) || (_24 === (9)) || (_24 === (10)) || (_24 === (11)) || (_24 === (12))) { + return cvtInt; + } else if ((_24 === (13)) || (_24 === (14))) { + return cvtIntFloat; + } else if (_24 === (24)) { + return cvtIntString; + } + $s = 8; continue; + /* } else if ((_23 === (7)) || (_23 === (8)) || (_23 === (9)) || (_23 === (10)) || (_23 === (11)) || (_23 === (12))) { */ case 3: + _25 = dst.Kind(); + if ((_25 === (2)) || (_25 === (3)) || (_25 === (4)) || (_25 === (5)) || (_25 === (6)) || (_25 === (7)) || (_25 === (8)) || (_25 === (9)) || (_25 === (10)) || (_25 === (11)) || (_25 === (12))) { + return cvtUint; + } else if ((_25 === (13)) || (_25 === (14))) { + return cvtUintFloat; + } else if (_25 === (24)) { + return cvtUintString; + } + $s = 8; continue; + /* } else if ((_23 === (13)) || (_23 === (14))) { */ case 4: + _26 = dst.Kind(); + if ((_26 === (2)) || (_26 === (3)) || (_26 === (4)) || (_26 === (5)) || (_26 === (6))) { + return cvtFloatInt; + } else if ((_26 === (7)) || (_26 === (8)) || (_26 === (9)) || (_26 === (10)) || (_26 === (11)) || (_26 === (12))) { + return cvtFloatUint; + } else if ((_26 === (13)) || (_26 === (14))) { + return cvtFloat; + } + $s = 8; continue; + /* } else if ((_23 === (15)) || (_23 === (16))) { */ case 5: + _27 = dst.Kind(); + if ((_27 === (15)) || (_27 === (16))) { + return cvtComplex; + } + $s = 8; continue; + /* } else if (_23 === (24)) { */ case 6: + if (!(dst.Kind() === 23)) { _v = false; $s = 11; continue s; } + _r = dst.Elem().PkgPath(); /* */ $s = 12; case 12: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r === ""; case 11: + /* */ if (_v) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (_v) { */ case 9: + _r$1 = dst.Elem().Kind(); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _28 = _r$1; + if (_28 === (8)) { + return cvtStringBytes; + } else if (_28 === (5)) { + return cvtStringRunes; + } + case 13: + /* } */ case 10: + $s = 8; continue; + /* } else if (_23 === (23)) { */ case 7: + if (!(dst.Kind() === 24)) { _v$1 = false; $s = 17; continue s; } + _r$2 = src.Elem().PkgPath(); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v$1 = _r$2 === ""; case 17: + /* */ if (_v$1) { $s = 15; continue; } + /* */ $s = 16; continue; + /* if (_v$1) { */ case 15: + _r$3 = src.Elem().Kind(); /* */ $s = 20; case 20: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _29 = _r$3; + if (_29 === (8)) { + return cvtBytesString; + } else if (_29 === (5)) { + return cvtRunesString; + } + case 19: + /* } */ case 16: + /* } */ case 8: + case 1: + if (haveIdenticalUnderlyingType(dst, src)) { + return cvtDirect; + } + if (!((dst.Kind() === 22) && dst.Name() === "" && (src.Kind() === 22) && src.Name() === "")) { _v$2 = false; $s = 23; continue s; } + _r$4 = dst.Elem().common(); /* */ $s = 24; case 24: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _arg = _r$4; + _r$5 = src.Elem().common(); /* */ $s = 25; case 25: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _arg$1 = _r$5; + _r$6 = haveIdenticalUnderlyingType(_arg, _arg$1); /* */ $s = 26; case 26: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _v$2 = _r$6; case 23: + /* */ if (_v$2) { $s = 21; continue; } + /* */ $s = 22; continue; + /* if (_v$2) { */ case 21: + return cvtDirect; + /* } */ case 22: + if (implements$1(dst, src)) { + if (src.Kind() === 20) { + return cvtI2I; + } + return cvtT2I; + } + return $throwNilPointerError; + /* */ } return; } if ($f === undefined) { $f = { $blk: convertOp }; } $f.$ptr = $ptr; $f._23 = _23; $f._24 = _24; $f._25 = _25; $f._26 = _26; $f._27 = _27; $f._28 = _28; $f._29 = _29; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f.dst = dst; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; + }; + makeFloat = function(f, v, t) { + var $ptr, _31, _r, f, ptr, t, typ, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _31 = $f._31; _r = $f._r; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + typ = _r; + ptr = unsafe_New(typ); + _31 = typ.size; + if (_31 === (4)) { + ptr.$set($fround(v)); + } else if (_31 === (8)) { + ptr.$set(v); + } + return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | (typ.Kind() >>> 0)) >>> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: makeFloat }; } $f.$ptr = $ptr; $f._31 = _31; $f._r = _r; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + makeComplex = function(f, v, t) { + var $ptr, _32, _r, f, ptr, t, typ, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _32 = $f._32; _r = $f._r; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + typ = _r; + ptr = unsafe_New(typ); + _32 = typ.size; + if (_32 === (8)) { + ptr.$set(new $Complex64(v.$real, v.$imag)); + } else if (_32 === (16)) { + ptr.$set(v); + } + return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | (typ.Kind() >>> 0)) >>> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: makeComplex }; } $f.$ptr = $ptr; $f._32 = _32; $f._r = _r; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + makeString = function(f, v, t) { + var $ptr, _r, _r$1, f, ret, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = New(t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = _r.Elem(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + ret = _r$1; + ret.SetString(v); + ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; + return ret; + /* */ } return; } if ($f === undefined) { $f = { $blk: makeString }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + makeBytes = function(f, v, t) { + var $ptr, _r, _r$1, f, ret, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = New(t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = _r.Elem(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + ret = _r$1; + $r = ret.SetBytes(v); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; + return ret; + /* */ } return; } if ($f === undefined) { $f = { $blk: makeBytes }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + makeRunes = function(f, v, t) { + var $ptr, _r, _r$1, f, ret, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = New(t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = _r.Elem(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + ret = _r$1; + $r = ret.setRunes(v); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; + return ret; + /* */ } return; } if ($f === undefined) { $f = { $blk: makeRunes }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtInt = function(v, t) { + var $ptr, _r, t, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r = makeInt((v.flag & 96) >>> 0, (x = v.Int(), new $Uint64(x.$high, x.$low)), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtInt }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtUint = function(v, t) { + var $ptr, _r, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r = makeInt((v.flag & 96) >>> 0, v.Uint(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUint }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtFloatInt = function(v, t) { + var $ptr, _r, t, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r = makeInt((v.flag & 96) >>> 0, (x = new $Int64(0, v.Float()), new $Uint64(x.$high, x.$low)), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloatInt }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtFloatUint = function(v, t) { + var $ptr, _r, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r = makeInt((v.flag & 96) >>> 0, new $Uint64(0, v.Float()), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloatUint }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtIntFloat = function(v, t) { + var $ptr, _r, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r = makeFloat((v.flag & 96) >>> 0, $flatten64(v.Int()), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtIntFloat }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtUintFloat = function(v, t) { + var $ptr, _r, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r = makeFloat((v.flag & 96) >>> 0, $flatten64(v.Uint()), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUintFloat }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtFloat = function(v, t) { + var $ptr, _r, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r = makeFloat((v.flag & 96) >>> 0, v.Float(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloat }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtComplex = function(v, t) { + var $ptr, _r, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r = makeComplex((v.flag & 96) >>> 0, v.Complex(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtComplex }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtIntString = function(v, t) { + var $ptr, _r, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r = makeString((v.flag & 96) >>> 0, $encodeRune(v.Int().$low), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtIntString }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtUintString = function(v, t) { + var $ptr, _r, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r = makeString((v.flag & 96) >>> 0, $encodeRune(v.Uint().$low), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUintString }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtBytesString = function(v, t) { + var $ptr, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _arg = (v.flag & 96) >>> 0; + _r = v.Bytes(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _arg$1 = $bytesToString(_r); + _arg$2 = t; + _r$1 = makeString(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 3; case 3: + return _r$1; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtBytesString }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtStringBytes = function(v, t) { + var $ptr, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _arg = (v.flag & 96) >>> 0; + _r = v.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _arg$1 = new sliceType$13($stringToBytes(_r)); + _arg$2 = t; + _r$1 = makeBytes(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 3; case 3: + return _r$1; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtStringBytes }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtRunesString = function(v, t) { + var $ptr, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _arg = (v.flag & 96) >>> 0; + _r = v.runes(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _arg$1 = $runesToString(_r); + _arg$2 = t; + _r$1 = makeString(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 3; case 3: + return _r$1; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtRunesString }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtStringRunes = function(v, t) { + var $ptr, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _arg = (v.flag & 96) >>> 0; + _r = v.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _arg$1 = new sliceType$15($stringToRunes(_r)); + _arg$2 = t; + _r$1 = makeRunes(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 3; case 3: + return _r$1; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtStringRunes }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtT2I = function(v, typ) { + var $ptr, _r, _r$1, _r$2, _r$3, _r$4, target, typ, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; target = $f.target; typ = $f.typ; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r = typ.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r$1 = unsafe_New(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + target = _r$1; + _r$2 = valueInterface(v, false); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + x = _r$2; + _r$3 = typ.NumMethod(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (_r$3 === 0) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_r$3 === 0) { */ case 4: + target.$set(x); + $s = 6; continue; + /* } else { */ case 5: + ifaceE2I($assertType(typ, ptrType$1), x, target); + /* } */ case 6: + _r$4 = typ.common(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + /* */ $s = 9; case 9: + return new Value.ptr(_r$4, target, (((((v.flag & 96) >>> 0) | 128) >>> 0) | 20) >>> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtT2I }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.target = target; $f.typ = typ; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + cvtI2I = function(v, typ) { + var $ptr, _r, _r$1, _r$2, ret, typ, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; ret = $f.ret; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + /* */ if (v.IsNil()) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (v.IsNil()) { */ case 1: + _r = Zero(typ); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + ret = _r; + ret.flag = (ret.flag | (((v.flag & 96) >>> 0))) >>> 0; + return ret; + /* } */ case 2: + _r$1 = v.Elem(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = cvtT2I(_r$1, typ); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ $s = 6; case 6: + return _r$2; + /* */ } return; } if ($f === undefined) { $f = { $blk: cvtI2I }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ret = ret; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Kind.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$1.methods = [{prop: "ptrTo", name: "ptrTo", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "pointers", name: "pointers", pkg: "reflect", typ: $funcType([], [$Bool], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Align", name: "Align", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "FieldAlign", name: "FieldAlign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "common", name: "common", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "ChanDir", name: "ChanDir", pkg: "", typ: $funcType([], [ChanDir], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$11], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumIn", name: "NumIn", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumOut", name: "NumOut", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Out", name: "Out", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "ConvertibleTo", name: "ConvertibleTo", pkg: "", typ: $funcType([Type], [$Bool], false)}]; + ptrType$7.methods = [{prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "uncommon", name: "uncommon", pkg: "reflect", typ: $funcType([], [ptrType$7], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}]; + ChanDir.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$11.methods = [{prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}]; + ptrType$13.methods = [{prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$11], [StructField], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}]; + StructTag.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [$String], false)}]; + Value.methods = [{prop: "object", name: "object", pkg: "reflect", typ: $funcType([], [ptrType$3], false)}, {prop: "call", name: "call", pkg: "reflect", typ: $funcType([$String, sliceType$8], [sliceType$8], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "InterfaceData", name: "InterfaceData", pkg: "", typ: $funcType([], [arrayType$3], false)}, {prop: "IsNil", name: "IsNil", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Pointer", name: "Pointer", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([Value], [], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType$13], [], false)}, {prop: "SetCap", name: "SetCap", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "SetLen", name: "SetLen", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Slice", name: "Slice", pkg: "", typ: $funcType([$Int, $Int], [Value], false)}, {prop: "Slice3", name: "Slice3", pkg: "", typ: $funcType([$Int, $Int, $Int], [Value], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [], false)}, {prop: "pointer", name: "pointer", pkg: "reflect", typ: $funcType([], [$UnsafePointer], false)}, {prop: "Addr", name: "Addr", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Bool", name: "Bool", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType$13], false)}, {prop: "runes", name: "runes", pkg: "reflect", typ: $funcType([], [sliceType$15], false)}, {prop: "CanAddr", name: "CanAddr", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "CanSet", name: "CanSet", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Call", name: "Call", pkg: "", typ: $funcType([sliceType$8], [sliceType$8], false)}, {prop: "CallSlice", name: "CallSlice", pkg: "", typ: $funcType([sliceType$8], [sliceType$8], false)}, {prop: "Complex", name: "Complex", pkg: "", typ: $funcType([], [$Complex128], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$11], [Value], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [Value], false)}, {prop: "Float", name: "Float", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "CanInterface", name: "CanInterface", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Interface", name: "Interface", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "IsValid", name: "IsValid", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "MapIndex", name: "MapIndex", pkg: "", typ: $funcType([Value], [Value], false)}, {prop: "MapKeys", name: "MapKeys", pkg: "", typ: $funcType([], [sliceType$8], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "OverflowComplex", name: "OverflowComplex", pkg: "", typ: $funcType([$Complex128], [$Bool], false)}, {prop: "OverflowFloat", name: "OverflowFloat", pkg: "", typ: $funcType([$Float64], [$Bool], false)}, {prop: "OverflowInt", name: "OverflowInt", pkg: "", typ: $funcType([$Int64], [$Bool], false)}, {prop: "OverflowUint", name: "OverflowUint", pkg: "", typ: $funcType([$Uint64], [$Bool], false)}, {prop: "Recv", name: "Recv", pkg: "", typ: $funcType([], [Value, $Bool], false)}, {prop: "recv", name: "recv", pkg: "reflect", typ: $funcType([$Bool], [Value, $Bool], false)}, {prop: "Send", name: "Send", pkg: "", typ: $funcType([Value], [], false)}, {prop: "send", name: "send", pkg: "reflect", typ: $funcType([Value, $Bool], [$Bool], false)}, {prop: "SetBool", name: "SetBool", pkg: "", typ: $funcType([$Bool], [], false)}, {prop: "setRunes", name: "setRunes", pkg: "reflect", typ: $funcType([sliceType$15], [], false)}, {prop: "SetComplex", name: "SetComplex", pkg: "", typ: $funcType([$Complex128], [], false)}, {prop: "SetFloat", name: "SetFloat", pkg: "", typ: $funcType([$Float64], [], false)}, {prop: "SetInt", name: "SetInt", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "SetMapIndex", name: "SetMapIndex", pkg: "", typ: $funcType([Value, Value], [], false)}, {prop: "SetUint", name: "SetUint", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "SetPointer", name: "SetPointer", pkg: "", typ: $funcType([$UnsafePointer], [], false)}, {prop: "SetString", name: "SetString", pkg: "", typ: $funcType([$String], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "TryRecv", name: "TryRecv", pkg: "", typ: $funcType([], [Value, $Bool], false)}, {prop: "TrySend", name: "TrySend", pkg: "", typ: $funcType([Value], [$Bool], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Uint", name: "Uint", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "UnsafeAddr", name: "UnsafeAddr", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "assignTo", name: "assignTo", pkg: "reflect", typ: $funcType([$String, ptrType$1, $UnsafePointer], [Value], false)}, {prop: "Convert", name: "Convert", pkg: "", typ: $funcType([Type], [Value], false)}]; + flag.methods = [{prop: "kind", name: "kind", pkg: "reflect", typ: $funcType([], [Kind], false)}, {prop: "mustBe", name: "mustBe", pkg: "reflect", typ: $funcType([Kind], [], false)}, {prop: "mustBeExported", name: "mustBeExported", pkg: "reflect", typ: $funcType([], [], false)}, {prop: "mustBeAssignable", name: "mustBeAssignable", pkg: "reflect", typ: $funcType([], [], false)}]; + ptrType$20.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + mapIter.init([{prop: "t", name: "t", pkg: "reflect", typ: Type, tag: ""}, {prop: "m", name: "m", pkg: "reflect", typ: ptrType$3, tag: ""}, {prop: "keys", name: "keys", pkg: "reflect", typ: ptrType$3, tag: ""}, {prop: "i", name: "i", pkg: "reflect", typ: $Int, tag: ""}]); + Type.init([{prop: "Align", name: "Align", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "ChanDir", name: "ChanDir", pkg: "", typ: $funcType([], [ChanDir], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ConvertibleTo", name: "ConvertibleTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldAlign", name: "FieldAlign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$11], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumIn", name: "NumIn", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumOut", name: "NumOut", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Out", name: "Out", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "common", name: "common", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "uncommon", name: "uncommon", pkg: "reflect", typ: $funcType([], [ptrType$7], false)}]); + rtype.init([{prop: "size", name: "size", pkg: "reflect", typ: $Uintptr, tag: ""}, {prop: "ptrdata", name: "ptrdata", pkg: "reflect", typ: $Uintptr, tag: ""}, {prop: "hash", name: "hash", pkg: "reflect", typ: $Uint32, tag: ""}, {prop: "_$3", name: "_", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "align", name: "align", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "fieldAlign", name: "fieldAlign", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "kind", name: "kind", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "alg", name: "alg", pkg: "reflect", typ: ptrType$4, tag: ""}, {prop: "gcdata", name: "gcdata", pkg: "reflect", typ: ptrType$5, tag: ""}, {prop: "string", name: "string", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "uncommonType", name: "", pkg: "reflect", typ: ptrType$7, tag: ""}, {prop: "ptrToThis", name: "ptrToThis", pkg: "reflect", typ: ptrType$1, tag: ""}]); + typeAlg.init([{prop: "hash", name: "hash", pkg: "reflect", typ: funcType$4, tag: ""}, {prop: "equal", name: "equal", pkg: "reflect", typ: funcType$5, tag: ""}]); + method.init([{prop: "name", name: "name", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "mtyp", name: "mtyp", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "ifn", name: "ifn", pkg: "reflect", typ: $UnsafePointer, tag: ""}, {prop: "tfn", name: "tfn", pkg: "reflect", typ: $UnsafePointer, tag: ""}]); + uncommonType.init([{prop: "name", name: "name", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "methods", name: "methods", pkg: "reflect", typ: sliceType$4, tag: ""}]); + arrayType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"array\""}, {prop: "elem", name: "elem", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "slice", name: "slice", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "len", name: "len", pkg: "reflect", typ: $Uintptr, tag: ""}]); + chanType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"chan\""}, {prop: "elem", name: "elem", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "dir", name: "dir", pkg: "reflect", typ: $Uintptr, tag: ""}]); + funcType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"func\""}, {prop: "dotdotdot", name: "dotdotdot", pkg: "reflect", typ: $Bool, tag: ""}, {prop: "in$2", name: "in", pkg: "reflect", typ: sliceType$1, tag: ""}, {prop: "out", name: "out", pkg: "reflect", typ: sliceType$1, tag: ""}]); + imethod.init([{prop: "name", name: "name", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$1, tag: ""}]); + interfaceType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"interface\""}, {prop: "methods", name: "methods", pkg: "reflect", typ: sliceType$5, tag: ""}]); + mapType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"map\""}, {prop: "key", name: "key", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "elem", name: "elem", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "bucket", name: "bucket", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "hmap", name: "hmap", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "keysize", name: "keysize", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "indirectkey", name: "indirectkey", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "valuesize", name: "valuesize", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "indirectvalue", name: "indirectvalue", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "bucketsize", name: "bucketsize", pkg: "reflect", typ: $Uint16, tag: ""}, {prop: "reflexivekey", name: "reflexivekey", pkg: "reflect", typ: $Bool, tag: ""}, {prop: "needkeyupdate", name: "needkeyupdate", pkg: "reflect", typ: $Bool, tag: ""}]); + ptrType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"ptr\""}, {prop: "elem", name: "elem", pkg: "reflect", typ: ptrType$1, tag: ""}]); + sliceType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"slice\""}, {prop: "elem", name: "elem", pkg: "reflect", typ: ptrType$1, tag: ""}]); + structField.init([{prop: "name", name: "name", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "tag", name: "tag", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "offset", name: "offset", pkg: "reflect", typ: $Uintptr, tag: ""}]); + structType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"struct\""}, {prop: "fields", name: "fields", pkg: "reflect", typ: sliceType$6, tag: ""}]); + Method.init([{prop: "Name", name: "Name", pkg: "", typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $String, tag: ""}, {prop: "Type", name: "Type", pkg: "", typ: Type, tag: ""}, {prop: "Func", name: "Func", pkg: "", typ: Value, tag: ""}, {prop: "Index", name: "Index", pkg: "", typ: $Int, tag: ""}]); + StructField.init([{prop: "Name", name: "Name", pkg: "", typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $String, tag: ""}, {prop: "Type", name: "Type", pkg: "", typ: Type, tag: ""}, {prop: "Tag", name: "Tag", pkg: "", typ: StructTag, tag: ""}, {prop: "Offset", name: "Offset", pkg: "", typ: $Uintptr, tag: ""}, {prop: "Index", name: "Index", pkg: "", typ: sliceType$11, tag: ""}, {prop: "Anonymous", name: "Anonymous", pkg: "", typ: $Bool, tag: ""}]); + fieldScan.init([{prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$13, tag: ""}, {prop: "index", name: "index", pkg: "reflect", typ: sliceType$11, tag: ""}]); + Value.init([{prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "ptr", name: "ptr", pkg: "reflect", typ: $UnsafePointer, tag: ""}, {prop: "flag", name: "", pkg: "reflect", typ: flag, tag: ""}]); + ValueError.init([{prop: "Method", name: "Method", pkg: "", typ: $String, tag: ""}, {prop: "Kind", name: "Kind", pkg: "", typ: Kind, tag: ""}]); + nonEmptyInterface.init([{prop: "itab", name: "itab", pkg: "reflect", typ: ptrType$9, tag: ""}, {prop: "word", name: "word", pkg: "reflect", typ: $UnsafePointer, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = math.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strconv.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + initialized = false; + stringPtrMap = {}; + callHelper = $assertType($internalize($call, $emptyInterface), funcType$1); + selectHelper = $assertType($internalize($select, $emptyInterface), funcType$1); + kindNames = new sliceType$3(["invalid", "bool", "int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "uintptr", "float32", "float64", "complex64", "complex128", "array", "chan", "func", "interface", "map", "ptr", "slice", "string", "struct", "unsafe.Pointer"]); + jsObjectPtr = reflectType($jsObjectPtr); + uint8Type = $assertType(TypeOf(new $Uint8(0)), ptrType$1); + $r = init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["encoding/binary"] = (function() { + var $pkg = {}, $init, errors, io, math, reflect, overflow; + errors = $packages["errors"]; + io = $packages["io"]; + math = $packages["math"]; + reflect = $packages["reflect"]; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = math.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = reflect.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + overflow = errors.New("binary: varint overflows a 64-bit integer"); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["syscall"] = (function() { + var $pkg = {}, $init, js, race, runtime, sync, mmapper, Errno, Timespec, Stat_t, Dirent, sliceType, sliceType$1, ptrType$2, arrayType$5, arrayType$13, arrayType$14, structType, ptrType$22, ptrType$25, mapType, funcType, funcType$1, ptrType$29, arrayType$18, warningPrinted, lineBuffer, syscallModule, alreadyTriedToLoad, minusOne, envOnce, envLock, env, envs, mapper, errEAGAIN, errEINVAL, errENOENT, ioSync, ioSync$24ptr, errors, init, printWarning, printToConsole, use, indexByte, runtime_envs, syscall, Syscall, Syscall6, BytePtrFromString, copyenv, Getenv, msanRead, msanWrite, itoa, uitoa, clen, ReadDirent, ParseDirent, errnoErr, Read, Write, Close, Exit, Fchdir, Fchmod, Fsync, Getdents, read, write, munmap, Fchown, Fstat, Ftruncate, Lstat, Pread, Pwrite, Seek, mmap; + js = $packages["github.com/gopherjs/gopherjs/js"]; + race = $packages["internal/race"]; + runtime = $packages["runtime"]; + sync = $packages["sync"]; + mmapper = $pkg.mmapper = $newType(0, $kindStruct, "syscall.mmapper", "mmapper", "syscall", function(Mutex_, active_, mmap_, munmap_) { + this.$val = this; + if (arguments.length === 0) { + this.Mutex = new sync.Mutex.ptr(0, 0); + this.active = false; + this.mmap = $throwNilPointerError; + this.munmap = $throwNilPointerError; + return; + } + this.Mutex = Mutex_; + this.active = active_; + this.mmap = mmap_; + this.munmap = munmap_; + }); + Errno = $pkg.Errno = $newType(4, $kindUintptr, "syscall.Errno", "Errno", "syscall", null); + Timespec = $pkg.Timespec = $newType(0, $kindStruct, "syscall.Timespec", "Timespec", "syscall", function(Sec_, Nsec_) { + this.$val = this; + if (arguments.length === 0) { + this.Sec = new $Int64(0, 0); + this.Nsec = new $Int64(0, 0); + return; + } + this.Sec = Sec_; + this.Nsec = Nsec_; + }); + Stat_t = $pkg.Stat_t = $newType(0, $kindStruct, "syscall.Stat_t", "Stat_t", "syscall", function(Dev_, Ino_, Nlink_, Mode_, Uid_, Gid_, X__pad0_, Rdev_, Size_, Blksize_, Blocks_, Atim_, Mtim_, Ctim_, X__unused_) { + this.$val = this; + if (arguments.length === 0) { + this.Dev = new $Uint64(0, 0); + this.Ino = new $Uint64(0, 0); + this.Nlink = new $Uint64(0, 0); + this.Mode = 0; + this.Uid = 0; + this.Gid = 0; + this.X__pad0 = 0; + this.Rdev = new $Uint64(0, 0); + this.Size = new $Int64(0, 0); + this.Blksize = new $Int64(0, 0); + this.Blocks = new $Int64(0, 0); + this.Atim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); + this.Mtim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); + this.Ctim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); + this.X__unused = arrayType$18.zero(); + return; + } + this.Dev = Dev_; + this.Ino = Ino_; + this.Nlink = Nlink_; + this.Mode = Mode_; + this.Uid = Uid_; + this.Gid = Gid_; + this.X__pad0 = X__pad0_; + this.Rdev = Rdev_; + this.Size = Size_; + this.Blksize = Blksize_; + this.Blocks = Blocks_; + this.Atim = Atim_; + this.Mtim = Mtim_; + this.Ctim = Ctim_; + this.X__unused = X__unused_; + }); + Dirent = $pkg.Dirent = $newType(0, $kindStruct, "syscall.Dirent", "Dirent", "syscall", function(Ino_, Off_, Reclen_, Type_, Name_, Pad_cgo_0_) { + this.$val = this; + if (arguments.length === 0) { + this.Ino = new $Uint64(0, 0); + this.Off = new $Int64(0, 0); + this.Reclen = 0; + this.Type = 0; + this.Name = arrayType$13.zero(); + this.Pad_cgo_0 = arrayType$14.zero(); + return; + } + this.Ino = Ino_; + this.Off = Off_; + this.Reclen = Reclen_; + this.Type = Type_; + this.Name = Name_; + this.Pad_cgo_0 = Pad_cgo_0_; + }); + sliceType = $sliceType($Uint8); + sliceType$1 = $sliceType($String); + ptrType$2 = $ptrType($Uint8); + arrayType$5 = $arrayType($Uint8, 32); + arrayType$13 = $arrayType($Int8, 256); + arrayType$14 = $arrayType($Uint8, 5); + structType = $structType([{prop: "addr", name: "addr", pkg: "syscall", typ: $Uintptr, tag: ""}, {prop: "len", name: "len", pkg: "syscall", typ: $Int, tag: ""}, {prop: "cap", name: "cap", pkg: "syscall", typ: $Int, tag: ""}]); + ptrType$22 = $ptrType($Int64); + ptrType$25 = $ptrType(mmapper); + mapType = $mapType(ptrType$2, sliceType); + funcType = $funcType([$Uintptr, $Uintptr, $Int, $Int, $Int, $Int64], [$Uintptr, $error], false); + funcType$1 = $funcType([$Uintptr, $Uintptr], [$error], false); + ptrType$29 = $ptrType(Timespec); + arrayType$18 = $arrayType($Int64, 3); + init = function() { + var $ptr; + $flushConsole = (function() { + var $ptr; + if (!((lineBuffer.$length === 0))) { + $global.console.log($externalize($bytesToString(lineBuffer), $String)); + lineBuffer = sliceType.nil; + } + }); + }; + printWarning = function() { + var $ptr; + if (!warningPrinted) { + $global.console.error($externalize("warning: system calls not available, see https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md", $String)); + } + warningPrinted = true; + }; + printToConsole = function(b) { + var $ptr, b, goPrintToConsole, i; + goPrintToConsole = $global.goPrintToConsole; + if (!(goPrintToConsole === undefined)) { + goPrintToConsole(b); + return; + } + lineBuffer = $appendSlice(lineBuffer, b); + while (true) { + i = indexByte(lineBuffer, 10); + if (i === -1) { + break; + } + $global.console.log($externalize($bytesToString($subslice(lineBuffer, 0, i)), $String)); + lineBuffer = $subslice(lineBuffer, (i + 1 >> 0)); + } + }; + use = function(p) { + var $ptr, p; + }; + indexByte = function(s, c) { + var $ptr, _i, _ref, b, c, i, s; + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + b = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (b === c) { + return i; + } + _i++; + } + return -1; + }; + runtime_envs = function() { + var $ptr, envkeys, envs$1, i, jsEnv, key, process; + process = $global.process; + if (process === undefined) { + return sliceType$1.nil; + } + jsEnv = process.env; + envkeys = $global.Object.keys(jsEnv); + envs$1 = $makeSlice(sliceType$1, $parseInt(envkeys.length)); + i = 0; + while (true) { + if (!(i < $parseInt(envkeys.length))) { break; } + key = $internalize(envkeys[i], $String); + ((i < 0 || i >= envs$1.$length) ? $throwRuntimeError("index out of range") : envs$1.$array[envs$1.$offset + i] = key + "=" + $internalize(jsEnv[$externalize(key, $String)], $String)); + i = i + (1) >> 0; + } + return envs$1; + }; + syscall = function(name) { + var $ptr, name, require, $deferred; + /* */ var $err = null; try { $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + $deferred.push([(function() { + var $ptr; + $recover(); + }), []]); + if (syscallModule === null) { + if (alreadyTriedToLoad) { + return null; + } + alreadyTriedToLoad = true; + require = $global.require; + if (require === undefined) { + $panic(new $String("")); + } + syscallModule = require($externalize("syscall", $String)); + } + return syscallModule[$externalize(name, $String)]; + /* */ } catch(err) { $err = err; return null; } finally { $callDeferred($deferred, $err); } + }; + Syscall = function(trap, a1, a2, a3) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, a1, a2, a3, array, err, f, r, r1, r2, slice, trap; + r1 = 0; + r2 = 0; + err = 0; + f = syscall("Syscall"); + if (!(f === null)) { + r = f(trap, a1, a2, a3); + _tmp = (($parseInt(r[0]) >> 0) >>> 0); + _tmp$1 = (($parseInt(r[1]) >> 0) >>> 0); + _tmp$2 = (($parseInt(r[2]) >> 0) >>> 0); + r1 = _tmp; + r2 = _tmp$1; + err = _tmp$2; + return [r1, r2, err]; + } + if ((trap === 1) && ((a1 === 1) || (a1 === 2))) { + array = a2; + slice = $makeSlice(sliceType, $parseInt(array.length)); + slice.$array = array; + printToConsole(slice); + _tmp$3 = ($parseInt(array.length) >>> 0); + _tmp$4 = 0; + _tmp$5 = 0; + r1 = _tmp$3; + r2 = _tmp$4; + err = _tmp$5; + return [r1, r2, err]; + } + if (trap === 60) { + runtime.Goexit(); + } + printWarning(); + _tmp$6 = (minusOne >>> 0); + _tmp$7 = 0; + _tmp$8 = 13; + r1 = _tmp$6; + r2 = _tmp$7; + err = _tmp$8; + return [r1, r2, err]; + }; + $pkg.Syscall = Syscall; + Syscall6 = function(trap, a1, a2, a3, a4, a5, a6) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, a1, a2, a3, a4, a5, a6, err, f, r, r1, r2, trap; + r1 = 0; + r2 = 0; + err = 0; + f = syscall("Syscall6"); + if (!(f === null)) { + r = f(trap, a1, a2, a3, a4, a5, a6); + _tmp = (($parseInt(r[0]) >> 0) >>> 0); + _tmp$1 = (($parseInt(r[1]) >> 0) >>> 0); + _tmp$2 = (($parseInt(r[2]) >> 0) >>> 0); + r1 = _tmp; + r2 = _tmp$1; + err = _tmp$2; + return [r1, r2, err]; + } + if (!((trap === 202))) { + printWarning(); + } + _tmp$3 = (minusOne >>> 0); + _tmp$4 = 0; + _tmp$5 = 13; + r1 = _tmp$3; + r2 = _tmp$4; + err = _tmp$5; + return [r1, r2, err]; + }; + $pkg.Syscall6 = Syscall6; + BytePtrFromString = function(s) { + var $ptr, _i, _ref, array, b, i, s; + array = new ($global.Uint8Array)(s.length + 1 >> 0); + _ref = new sliceType($stringToBytes(s)); + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + b = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (b === 0) { + return [ptrType$2.nil, new Errno(22)]; + } + array[i] = b; + _i++; + } + array[s.length] = 0; + return [array, $ifaceNil]; + }; + $pkg.BytePtrFromString = BytePtrFromString; + copyenv = function() { + var $ptr, _entry, _i, _key, _ref, _tuple, i, j, key, ok, s; + env = {}; + _ref = envs; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + s = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + j = 0; + while (true) { + if (!(j < s.length)) { break; } + if (s.charCodeAt(j) === 61) { + key = s.substring(0, j); + _tuple = (_entry = env[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [0, false]); + ok = _tuple[1]; + if (!ok) { + _key = key; (env || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: i }; + } else { + ((i < 0 || i >= envs.$length) ? $throwRuntimeError("index out of range") : envs.$array[envs.$offset + i] = ""); + } + break; + } + j = j + (1) >> 0; + } + _i++; + } + }; + Getenv = function(key) { + var $ptr, _entry, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, found, i, i$1, key, ok, s, value, $s, $deferred, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; found = $f.found; i = $f.i; i$1 = $f.i$1; key = $f.key; ok = $f.ok; s = $f.s; value = $f.value; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + value = ""; + found = false; + $r = envOnce.Do(copyenv); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + if (key.length === 0) { + _tmp = ""; + _tmp$1 = false; + value = _tmp; + found = _tmp$1; + return [value, found]; + } + $r = envLock.RLock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $deferred.push([$methodVal(envLock, "RUnlock"), []]); + _tuple = (_entry = env[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [0, false]); + i = _tuple[0]; + ok = _tuple[1]; + if (!ok) { + _tmp$2 = ""; + _tmp$3 = false; + value = _tmp$2; + found = _tmp$3; + return [value, found]; + } + s = ((i < 0 || i >= envs.$length) ? $throwRuntimeError("index out of range") : envs.$array[envs.$offset + i]); + i$1 = 0; + while (true) { + if (!(i$1 < s.length)) { break; } + if (s.charCodeAt(i$1) === 61) { + _tmp$4 = s.substring((i$1 + 1 >> 0)); + _tmp$5 = true; + value = _tmp$4; + found = _tmp$5; + return [value, found]; + } + i$1 = i$1 + (1) >> 0; + } + _tmp$6 = ""; + _tmp$7 = false; + value = _tmp$6; + found = _tmp$7; + return [value, found]; + /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [value, found]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Getenv }; } $f.$ptr = $ptr; $f._entry = _entry; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f.found = found; $f.i = i; $f.i$1 = i$1; $f.key = key; $f.ok = ok; $f.s = s; $f.value = value; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } + }; + $pkg.Getenv = Getenv; + msanRead = function(addr, len) { + var $ptr, addr, len; + }; + msanWrite = function(addr, len) { + var $ptr, addr, len; + }; + itoa = function(val) { + var $ptr, val; + if (val < 0) { + return "-" + uitoa((-val >>> 0)); + } + return uitoa((val >>> 0)); + }; + uitoa = function(val) { + var $ptr, _q, _r, buf, i, val; + buf = arrayType$5.zero(); + i = 31; + while (true) { + if (!(val >= 10)) { break; } + ((i < 0 || i >= buf.length) ? $throwRuntimeError("index out of range") : buf[i] = (((_r = val % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) + 48 >>> 0) << 24 >>> 24)); + i = i - (1) >> 0; + val = (_q = val / (10), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + } + ((i < 0 || i >= buf.length) ? $throwRuntimeError("index out of range") : buf[i] = ((val + 48 >>> 0) << 24 >>> 24)); + return $bytesToString($subslice(new sliceType(buf), i)); + }; + Timespec.ptr.prototype.Unix = function() { + var $ptr, _tmp, _tmp$1, nsec, sec, ts; + sec = new $Int64(0, 0); + nsec = new $Int64(0, 0); + ts = this; + _tmp = ts.Sec; + _tmp$1 = ts.Nsec; + sec = _tmp; + nsec = _tmp$1; + return [sec, nsec]; + }; + Timespec.prototype.Unix = function() { return this.$val.Unix(); }; + Timespec.ptr.prototype.Nano = function() { + var $ptr, ts, x, x$1; + ts = this; + return (x = $mul64(ts.Sec, new $Int64(0, 1000000000)), x$1 = ts.Nsec, new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); + }; + Timespec.prototype.Nano = function() { return this.$val.Nano(); }; + clen = function(n) { + var $ptr, i, n; + i = 0; + while (true) { + if (!(i < n.$length)) { break; } + if (((i < 0 || i >= n.$length) ? $throwRuntimeError("index out of range") : n.$array[n.$offset + i]) === 0) { + return i; + } + i = i + (1) >> 0; + } + return n.$length; + }; + ReadDirent = function(fd, buf) { + var $ptr, _tuple, buf, err, fd, n; + n = 0; + err = $ifaceNil; + _tuple = Getdents(fd, buf); + n = _tuple[0]; + err = _tuple[1]; + return [n, err]; + }; + $pkg.ReadDirent = ReadDirent; + ParseDirent = function(buf, max, names) { + var $ptr, _array, _struct, _tmp, _tmp$1, _tmp$2, _view, buf, bytes, consumed, count, dirent, max, name, names, newnames, origlen, x; + consumed = 0; + count = 0; + newnames = sliceType$1.nil; + origlen = buf.$length; + count = 0; + while (true) { + if (!(!((max === 0)) && buf.$length > 0)) { break; } + dirent = (_array = $sliceToArray(buf), _struct = new Dirent.ptr(new $Uint64(0, 0), new $Int64(0, 0), 0, 0, arrayType$13.zero(), arrayType$14.zero()), _view = new DataView(_array.buffer, _array.byteOffset), _struct.Ino = new $Uint64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Off = new $Int64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Reclen = _view.getUint16(16, true), _struct.Type = _view.getUint8(18, true), _struct.Name = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 19, _array.buffer.byteLength)), _struct.Pad_cgo_0 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 275, _array.buffer.byteLength)), _struct); + buf = $subslice(buf, dirent.Reclen); + if ((x = dirent.Ino, (x.$high === 0 && x.$low === 0))) { + continue; + } + bytes = $sliceToArray(new sliceType(dirent.Name)); + name = $bytesToString($subslice(new sliceType(bytes), 0, clen(new sliceType(bytes)))); + if (name === "." || name === "..") { + continue; + } + max = max - (1) >> 0; + count = count + (1) >> 0; + names = $append(names, name); + } + _tmp = origlen - buf.$length >> 0; + _tmp$1 = count; + _tmp$2 = names; + consumed = _tmp; + count = _tmp$1; + newnames = _tmp$2; + return [consumed, count, newnames]; + }; + $pkg.ParseDirent = ParseDirent; + mmapper.ptr.prototype.Mmap = function(fd, offset, length, prot, flags) { + var $ptr, _key, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, addr, b, data, err, errno, fd, flags, length, m, offset, p, prot, sl, $s, $deferred, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _key = $f._key; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; addr = $f.addr; b = $f.b; data = $f.data; err = $f.err; errno = $f.errno; fd = $f.fd; flags = $f.flags; length = $f.length; m = $f.m; offset = $f.offset; p = $f.p; prot = $f.prot; sl = $f.sl; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + sl = [sl]; + data = sliceType.nil; + err = $ifaceNil; + m = this; + if (length <= 0) { + _tmp = sliceType.nil; + _tmp$1 = new Errno(22); + data = _tmp; + err = _tmp$1; + return [data, err]; + } + _r = m.mmap(0, (length >>> 0), prot, flags, fd, offset); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + addr = _tuple[0]; + errno = _tuple[1]; + if (!($interfaceIsEqual(errno, $ifaceNil))) { + _tmp$2 = sliceType.nil; + _tmp$3 = errno; + data = _tmp$2; + err = _tmp$3; + return [data, err]; + } + sl[0] = new structType.ptr(addr, length, length); + b = sl[0]; + p = $indexPtr(b.$array, b.$offset + (b.$capacity - 1 >> 0), ptrType$2); + $r = m.Mutex.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $deferred.push([$methodVal(m.Mutex, "Unlock"), []]); + _key = p; (m.active || $throwRuntimeError("assignment to entry in nil map"))[ptrType$2.keyFor(_key)] = { k: _key, v: b }; + _tmp$4 = b; + _tmp$5 = $ifaceNil; + data = _tmp$4; + err = _tmp$5; + return [data, err]; + /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [data, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: mmapper.ptr.prototype.Mmap }; } $f.$ptr = $ptr; $f._key = _key; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.data = data; $f.err = err; $f.errno = errno; $f.fd = fd; $f.flags = flags; $f.length = length; $f.m = m; $f.offset = offset; $f.p = p; $f.prot = prot; $f.sl = sl; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } + }; + mmapper.prototype.Mmap = function(fd, offset, length, prot, flags) { return this.$val.Mmap(fd, offset, length, prot, flags); }; + mmapper.ptr.prototype.Munmap = function(data) { + var $ptr, _entry, _r, b, data, err, errno, m, p, $s, $deferred, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _r = $f._r; b = $f.b; data = $f.data; err = $f.err; errno = $f.errno; m = $f.m; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + err = $ifaceNil; + m = this; + if ((data.$length === 0) || !((data.$length === data.$capacity))) { + err = new Errno(22); + return err; + } + p = $indexPtr(data.$array, data.$offset + (data.$capacity - 1 >> 0), ptrType$2); + $r = m.Mutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $deferred.push([$methodVal(m.Mutex, "Unlock"), []]); + b = (_entry = m.active[ptrType$2.keyFor(p)], _entry !== undefined ? _entry.v : sliceType.nil); + if (b === sliceType.nil || !($indexPtr(b.$array, b.$offset + 0, ptrType$2) === $indexPtr(data.$array, data.$offset + 0, ptrType$2))) { + err = new Errno(22); + return err; + } + _r = m.munmap($sliceToArray(b), (b.$length >>> 0)); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + errno = _r; + if (!($interfaceIsEqual(errno, $ifaceNil))) { + err = errno; + return err; + } + delete m.active[ptrType$2.keyFor(p)]; + err = $ifaceNil; + return err; + /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return err; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: mmapper.ptr.prototype.Munmap }; } $f.$ptr = $ptr; $f._entry = _entry; $f._r = _r; $f.b = b; $f.data = data; $f.err = err; $f.errno = errno; $f.m = m; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } + }; + mmapper.prototype.Munmap = function(data) { return this.$val.Munmap(data); }; + Errno.prototype.Error = function() { + var $ptr, e, s; + e = this.$val; + if (0 <= (e >> 0) && (e >> 0) < 133) { + s = ((e < 0 || e >= errors.length) ? $throwRuntimeError("index out of range") : errors[e]); + if (!(s === "")) { + return s; + } + } + return "errno " + itoa((e >> 0)); + }; + $ptrType(Errno).prototype.Error = function() { return new Errno(this.$get()).Error(); }; + Errno.prototype.Temporary = function() { + var $ptr, e; + e = this.$val; + return (e === 4) || (e === 24) || (e === 104) || (e === 103) || new Errno(e).Timeout(); + }; + $ptrType(Errno).prototype.Temporary = function() { return new Errno(this.$get()).Temporary(); }; + Errno.prototype.Timeout = function() { + var $ptr, e; + e = this.$val; + return (e === 11) || (e === 11) || (e === 110); + }; + $ptrType(Errno).prototype.Timeout = function() { return new Errno(this.$get()).Timeout(); }; + errnoErr = function(e) { + var $ptr, _1, e; + _1 = e; + if (_1 === (0)) { + return $ifaceNil; + } else if (_1 === (11)) { + return errEAGAIN; + } else if (_1 === (22)) { + return errEINVAL; + } else if (_1 === (2)) { + return errENOENT; + } + return new Errno(e); + }; + Read = function(fd, p) { + var $ptr, _tuple, err, fd, n, p; + n = 0; + err = $ifaceNil; + _tuple = read(fd, p); + n = _tuple[0]; + err = _tuple[1]; + if (false) { + if (n > 0) { + race.WriteRange($sliceToArray(p), n); + } + if ($interfaceIsEqual(err, $ifaceNil)) { + race.Acquire((ioSync$24ptr || (ioSync$24ptr = new ptrType$22(function() { return ioSync; }, function($v) { ioSync = $v; })))); + } + } + if (false && n > 0) { + msanWrite($sliceToArray(p), n); + } + return [n, err]; + }; + $pkg.Read = Read; + Write = function(fd, p) { + var $ptr, _tuple, err, fd, n, p; + n = 0; + err = $ifaceNil; + if (false) { + race.ReleaseMerge((ioSync$24ptr || (ioSync$24ptr = new ptrType$22(function() { return ioSync; }, function($v) { ioSync = $v; })))); + } + _tuple = write(fd, p); + n = _tuple[0]; + err = _tuple[1]; + if (false && n > 0) { + race.ReadRange($sliceToArray(p), n); + } + if (false && n > 0) { + msanRead($sliceToArray(p), n); + } + return [n, err]; + }; + $pkg.Write = Write; + Close = function(fd) { + var $ptr, _tuple, e1, err, fd; + err = $ifaceNil; + _tuple = Syscall(3, (fd >>> 0), 0, 0); + e1 = _tuple[2]; + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return err; + }; + $pkg.Close = Close; + Exit = function(code) { + var $ptr, code; + Syscall(231, (code >>> 0), 0, 0); + return; + }; + $pkg.Exit = Exit; + Fchdir = function(fd) { + var $ptr, _tuple, e1, err, fd; + err = $ifaceNil; + _tuple = Syscall(81, (fd >>> 0), 0, 0); + e1 = _tuple[2]; + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return err; + }; + $pkg.Fchdir = Fchdir; + Fchmod = function(fd, mode) { + var $ptr, _tuple, e1, err, fd, mode; + err = $ifaceNil; + _tuple = Syscall(91, (fd >>> 0), (mode >>> 0), 0); + e1 = _tuple[2]; + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return err; + }; + $pkg.Fchmod = Fchmod; + Fsync = function(fd) { + var $ptr, _tuple, e1, err, fd; + err = $ifaceNil; + _tuple = Syscall(74, (fd >>> 0), 0, 0); + e1 = _tuple[2]; + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return err; + }; + $pkg.Fsync = Fsync; + Getdents = function(fd, buf) { + var $ptr, _p0, _tuple, buf, e1, err, fd, n, r0; + n = 0; + err = $ifaceNil; + _p0 = 0; + if (buf.$length > 0) { + _p0 = $sliceToArray(buf); + } else { + _p0 = new Uint8Array(0); + } + _tuple = Syscall(217, (fd >>> 0), _p0, (buf.$length >>> 0)); + r0 = _tuple[0]; + e1 = _tuple[2]; + n = (r0 >> 0); + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return [n, err]; + }; + $pkg.Getdents = Getdents; + read = function(fd, p) { + var $ptr, _p0, _tuple, e1, err, fd, n, p, r0; + n = 0; + err = $ifaceNil; + _p0 = 0; + if (p.$length > 0) { + _p0 = $sliceToArray(p); + } else { + _p0 = new Uint8Array(0); + } + _tuple = Syscall(0, (fd >>> 0), _p0, (p.$length >>> 0)); + r0 = _tuple[0]; + e1 = _tuple[2]; + n = (r0 >> 0); + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return [n, err]; + }; + write = function(fd, p) { + var $ptr, _p0, _tuple, e1, err, fd, n, p, r0; + n = 0; + err = $ifaceNil; + _p0 = 0; + if (p.$length > 0) { + _p0 = $sliceToArray(p); + } else { + _p0 = new Uint8Array(0); + } + _tuple = Syscall(1, (fd >>> 0), _p0, (p.$length >>> 0)); + r0 = _tuple[0]; + e1 = _tuple[2]; + n = (r0 >> 0); + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return [n, err]; + }; + munmap = function(addr, length) { + var $ptr, _tuple, addr, e1, err, length; + err = $ifaceNil; + _tuple = Syscall(11, addr, length, 0); + e1 = _tuple[2]; + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return err; + }; + Fchown = function(fd, uid, gid) { + var $ptr, _tuple, e1, err, fd, gid, uid; + err = $ifaceNil; + _tuple = Syscall(93, (fd >>> 0), (uid >>> 0), (gid >>> 0)); + e1 = _tuple[2]; + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return err; + }; + $pkg.Fchown = Fchown; + Fstat = function(fd, stat) { + var $ptr, _array, _struct, _tuple, _view, e1, err, fd, stat; + err = $ifaceNil; + _array = new Uint8Array(144); + _tuple = Syscall(5, (fd >>> 0), _array, 0); + _struct = stat, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Dev = new $Uint64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Ino = new $Uint64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Nlink = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Mode = _view.getUint32(24, true), _struct.Uid = _view.getUint32(28, true), _struct.Gid = _view.getUint32(32, true), _struct.X__pad0 = _view.getInt32(36, true), _struct.Rdev = new $Uint64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Size = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Blksize = new $Int64(_view.getUint32(60, true), _view.getUint32(56, true)), _struct.Blocks = new $Int64(_view.getUint32(68, true), _view.getUint32(64, true)), _struct.Atim.Sec = new $Int64(_view.getUint32(76, true), _view.getUint32(72, true)), _struct.Atim.Nsec = new $Int64(_view.getUint32(84, true), _view.getUint32(80, true)), _struct.Mtim.Sec = new $Int64(_view.getUint32(92, true), _view.getUint32(88, true)), _struct.Mtim.Nsec = new $Int64(_view.getUint32(100, true), _view.getUint32(96, true)), _struct.Ctim.Sec = new $Int64(_view.getUint32(108, true), _view.getUint32(104, true)), _struct.Ctim.Nsec = new $Int64(_view.getUint32(116, true), _view.getUint32(112, true)), _struct.X__unused = new ($nativeArray($kindInt64))(_array.buffer, $min(_array.byteOffset + 120, _array.buffer.byteLength)); + e1 = _tuple[2]; + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return err; + }; + $pkg.Fstat = Fstat; + Ftruncate = function(fd, length) { + var $ptr, _tuple, e1, err, fd, length; + err = $ifaceNil; + _tuple = Syscall(77, (fd >>> 0), (length.$low >>> 0), 0); + e1 = _tuple[2]; + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return err; + }; + $pkg.Ftruncate = Ftruncate; + Lstat = function(path, stat) { + var $ptr, _array, _p0, _struct, _tuple, _tuple$1, _view, e1, err, path, stat; + err = $ifaceNil; + _p0 = ptrType$2.nil; + _tuple = BytePtrFromString(path); + _p0 = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return err; + } + _array = new Uint8Array(144); + _tuple$1 = Syscall(6, _p0, _array, 0); + _struct = stat, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Dev = new $Uint64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Ino = new $Uint64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Nlink = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Mode = _view.getUint32(24, true), _struct.Uid = _view.getUint32(28, true), _struct.Gid = _view.getUint32(32, true), _struct.X__pad0 = _view.getInt32(36, true), _struct.Rdev = new $Uint64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Size = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Blksize = new $Int64(_view.getUint32(60, true), _view.getUint32(56, true)), _struct.Blocks = new $Int64(_view.getUint32(68, true), _view.getUint32(64, true)), _struct.Atim.Sec = new $Int64(_view.getUint32(76, true), _view.getUint32(72, true)), _struct.Atim.Nsec = new $Int64(_view.getUint32(84, true), _view.getUint32(80, true)), _struct.Mtim.Sec = new $Int64(_view.getUint32(92, true), _view.getUint32(88, true)), _struct.Mtim.Nsec = new $Int64(_view.getUint32(100, true), _view.getUint32(96, true)), _struct.Ctim.Sec = new $Int64(_view.getUint32(108, true), _view.getUint32(104, true)), _struct.Ctim.Nsec = new $Int64(_view.getUint32(116, true), _view.getUint32(112, true)), _struct.X__unused = new ($nativeArray($kindInt64))(_array.buffer, $min(_array.byteOffset + 120, _array.buffer.byteLength)); + e1 = _tuple$1[2]; + use(_p0); + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return err; + }; + $pkg.Lstat = Lstat; + Pread = function(fd, p, offset) { + var $ptr, _p0, _tuple, e1, err, fd, n, offset, p, r0; + n = 0; + err = $ifaceNil; + _p0 = 0; + if (p.$length > 0) { + _p0 = $sliceToArray(p); + } else { + _p0 = new Uint8Array(0); + } + _tuple = Syscall6(17, (fd >>> 0), _p0, (p.$length >>> 0), (offset.$low >>> 0), 0, 0); + r0 = _tuple[0]; + e1 = _tuple[2]; + n = (r0 >> 0); + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return [n, err]; + }; + $pkg.Pread = Pread; + Pwrite = function(fd, p, offset) { + var $ptr, _p0, _tuple, e1, err, fd, n, offset, p, r0; + n = 0; + err = $ifaceNil; + _p0 = 0; + if (p.$length > 0) { + _p0 = $sliceToArray(p); + } else { + _p0 = new Uint8Array(0); + } + _tuple = Syscall6(18, (fd >>> 0), _p0, (p.$length >>> 0), (offset.$low >>> 0), 0, 0); + r0 = _tuple[0]; + e1 = _tuple[2]; + n = (r0 >> 0); + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return [n, err]; + }; + $pkg.Pwrite = Pwrite; + Seek = function(fd, offset, whence) { + var $ptr, _tuple, e1, err, fd, off, offset, r0, whence; + off = new $Int64(0, 0); + err = $ifaceNil; + _tuple = Syscall(8, (fd >>> 0), (offset.$low >>> 0), (whence >>> 0)); + r0 = _tuple[0]; + e1 = _tuple[2]; + off = new $Int64(0, r0.constructor === Number ? r0 : 1); + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return [off, err]; + }; + $pkg.Seek = Seek; + mmap = function(addr, length, prot, flags, fd, offset) { + var $ptr, _tuple, addr, e1, err, fd, flags, length, offset, prot, r0, xaddr; + xaddr = 0; + err = $ifaceNil; + _tuple = Syscall6(9, addr, length, (prot >>> 0), (flags >>> 0), (fd >>> 0), (offset.$low >>> 0)); + r0 = _tuple[0]; + e1 = _tuple[2]; + xaddr = r0; + if (!((e1 === 0))) { + err = errnoErr(e1); + } + return [xaddr, err]; + }; + ptrType$25.methods = [{prop: "Mmap", name: "Mmap", pkg: "", typ: $funcType([$Int, $Int64, $Int, $Int, $Int], [sliceType, $error], false)}, {prop: "Munmap", name: "Munmap", pkg: "", typ: $funcType([sliceType], [$error], false)}]; + Errno.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; + ptrType$29.methods = [{prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64, $Int64], false)}, {prop: "Nano", name: "Nano", pkg: "", typ: $funcType([], [$Int64], false)}]; + mmapper.init([{prop: "Mutex", name: "", pkg: "", typ: sync.Mutex, tag: ""}, {prop: "active", name: "active", pkg: "syscall", typ: mapType, tag: ""}, {prop: "mmap", name: "mmap", pkg: "syscall", typ: funcType, tag: ""}, {prop: "munmap", name: "munmap", pkg: "syscall", typ: funcType$1, tag: ""}]); + Timespec.init([{prop: "Sec", name: "Sec", pkg: "", typ: $Int64, tag: ""}, {prop: "Nsec", name: "Nsec", pkg: "", typ: $Int64, tag: ""}]); + Stat_t.init([{prop: "Dev", name: "Dev", pkg: "", typ: $Uint64, tag: ""}, {prop: "Ino", name: "Ino", pkg: "", typ: $Uint64, tag: ""}, {prop: "Nlink", name: "Nlink", pkg: "", typ: $Uint64, tag: ""}, {prop: "Mode", name: "Mode", pkg: "", typ: $Uint32, tag: ""}, {prop: "Uid", name: "Uid", pkg: "", typ: $Uint32, tag: ""}, {prop: "Gid", name: "Gid", pkg: "", typ: $Uint32, tag: ""}, {prop: "X__pad0", name: "X__pad0", pkg: "", typ: $Int32, tag: ""}, {prop: "Rdev", name: "Rdev", pkg: "", typ: $Uint64, tag: ""}, {prop: "Size", name: "Size", pkg: "", typ: $Int64, tag: ""}, {prop: "Blksize", name: "Blksize", pkg: "", typ: $Int64, tag: ""}, {prop: "Blocks", name: "Blocks", pkg: "", typ: $Int64, tag: ""}, {prop: "Atim", name: "Atim", pkg: "", typ: Timespec, tag: ""}, {prop: "Mtim", name: "Mtim", pkg: "", typ: Timespec, tag: ""}, {prop: "Ctim", name: "Ctim", pkg: "", typ: Timespec, tag: ""}, {prop: "X__unused", name: "X__unused", pkg: "", typ: arrayType$18, tag: ""}]); + Dirent.init([{prop: "Ino", name: "Ino", pkg: "", typ: $Uint64, tag: ""}, {prop: "Off", name: "Off", pkg: "", typ: $Int64, tag: ""}, {prop: "Reclen", name: "Reclen", pkg: "", typ: $Uint16, tag: ""}, {prop: "Type", name: "Type", pkg: "", typ: $Uint8, tag: ""}, {prop: "Name", name: "Name", pkg: "", typ: arrayType$13, tag: ""}, {prop: "Pad_cgo_0", name: "Pad_cgo_0", pkg: "", typ: arrayType$14, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = race.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + lineBuffer = sliceType.nil; + syscallModule = null; + envOnce = new sync.Once.ptr(new sync.Mutex.ptr(0, 0), 0); + envLock = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); + env = false; + ioSync = new $Int64(0, 0); + warningPrinted = false; + alreadyTriedToLoad = false; + minusOne = -1; + envs = runtime_envs(); + $pkg.Stdin = 0; + $pkg.Stdout = 1; + $pkg.Stderr = 2; + errEAGAIN = new Errno(11); + errEINVAL = new Errno(22); + errENOENT = new Errno(2); + errors = $toNativeArray($kindString, ["", "operation not permitted", "no such file or directory", "no such process", "interrupted system call", "input/output error", "no such device or address", "argument list too long", "exec format error", "bad file descriptor", "no child processes", "resource temporarily unavailable", "cannot allocate memory", "permission denied", "bad address", "block device required", "device or resource busy", "file exists", "invalid cross-device link", "no such device", "not a directory", "is a directory", "invalid argument", "too many open files in system", "too many open files", "inappropriate ioctl for device", "text file busy", "file too large", "no space left on device", "illegal seek", "read-only file system", "too many links", "broken pipe", "numerical argument out of domain", "numerical result out of range", "resource deadlock avoided", "file name too long", "no locks available", "function not implemented", "directory not empty", "too many levels of symbolic links", "", "no message of desired type", "identifier removed", "channel number out of range", "level 2 not synchronized", "level 3 halted", "level 3 reset", "link number out of range", "protocol driver not attached", "no CSI structure available", "level 2 halted", "invalid exchange", "invalid request descriptor", "exchange full", "no anode", "invalid request code", "invalid slot", "", "bad font file format", "device not a stream", "no data available", "timer expired", "out of streams resources", "machine is not on the network", "package not installed", "object is remote", "link has been severed", "advertise error", "srmount error", "communication error on send", "protocol error", "multihop attempted", "RFS specific error", "bad message", "value too large for defined data type", "name not unique on network", "file descriptor in bad state", "remote address changed", "can not access a needed shared library", "accessing a corrupted shared library", ".lib section in a.out corrupted", "attempting to link in too many shared libraries", "cannot exec a shared library directly", "invalid or incomplete multibyte or wide character", "interrupted system call should be restarted", "streams pipe error", "too many users", "socket operation on non-socket", "destination address required", "message too long", "protocol wrong type for socket", "protocol not available", "protocol not supported", "socket type not supported", "operation not supported", "protocol family not supported", "address family not supported by protocol", "address already in use", "cannot assign requested address", "network is down", "network is unreachable", "network dropped connection on reset", "software caused connection abort", "connection reset by peer", "no buffer space available", "transport endpoint is already connected", "transport endpoint is not connected", "cannot send after transport endpoint shutdown", "too many references: cannot splice", "connection timed out", "connection refused", "host is down", "no route to host", "operation already in progress", "operation now in progress", "stale NFS file handle", "structure needs cleaning", "not a XENIX named type file", "no XENIX semaphores available", "is a named type file", "remote I/O error", "disk quota exceeded", "no medium found", "wrong medium type", "operation canceled", "required key not available", "key has expired", "key has been revoked", "key was rejected by service", "owner died", "state not recoverable", "operation not possible due to RF-kill"]); + mapper = new mmapper.ptr(new sync.Mutex.ptr(0, 0), {}, mmap, munmap); + init(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["github.com/gopherjs/gopherjs/nosync"] = (function() { + var $pkg = {}, $init, Mutex, RWMutex, WaitGroup, Once, ptrType, ptrType$1, ptrType$2, funcType, ptrType$3; + Mutex = $pkg.Mutex = $newType(0, $kindStruct, "nosync.Mutex", "Mutex", "github.com/gopherjs/gopherjs/nosync", function(locked_) { + this.$val = this; + if (arguments.length === 0) { + this.locked = false; + return; + } + this.locked = locked_; + }); + RWMutex = $pkg.RWMutex = $newType(0, $kindStruct, "nosync.RWMutex", "RWMutex", "github.com/gopherjs/gopherjs/nosync", function(writeLocked_, readLockCounter_) { + this.$val = this; + if (arguments.length === 0) { + this.writeLocked = false; + this.readLockCounter = 0; + return; + } + this.writeLocked = writeLocked_; + this.readLockCounter = readLockCounter_; + }); + WaitGroup = $pkg.WaitGroup = $newType(0, $kindStruct, "nosync.WaitGroup", "WaitGroup", "github.com/gopherjs/gopherjs/nosync", function(counter_) { + this.$val = this; + if (arguments.length === 0) { + this.counter = 0; + return; + } + this.counter = counter_; + }); + Once = $pkg.Once = $newType(0, $kindStruct, "nosync.Once", "Once", "github.com/gopherjs/gopherjs/nosync", function(doing_, done_) { + this.$val = this; + if (arguments.length === 0) { + this.doing = false; + this.done = false; + return; + } + this.doing = doing_; + this.done = done_; + }); + ptrType = $ptrType(Mutex); + ptrType$1 = $ptrType(RWMutex); + ptrType$2 = $ptrType(WaitGroup); + funcType = $funcType([], [], false); + ptrType$3 = $ptrType(Once); + Mutex.ptr.prototype.Lock = function() { + var $ptr, m; + m = this; + if (m.locked) { + $panic(new $String("nosync: mutex is already locked")); + } + m.locked = true; + }; + Mutex.prototype.Lock = function() { return this.$val.Lock(); }; + Mutex.ptr.prototype.Unlock = function() { + var $ptr, m; + m = this; + if (!m.locked) { + $panic(new $String("nosync: unlock of unlocked mutex")); + } + m.locked = false; + }; + Mutex.prototype.Unlock = function() { return this.$val.Unlock(); }; + RWMutex.ptr.prototype.Lock = function() { + var $ptr, rw; + rw = this; + if (!((rw.readLockCounter === 0)) || rw.writeLocked) { + $panic(new $String("nosync: mutex is already locked")); + } + rw.writeLocked = true; + }; + RWMutex.prototype.Lock = function() { return this.$val.Lock(); }; + RWMutex.ptr.prototype.Unlock = function() { + var $ptr, rw; + rw = this; + if (!rw.writeLocked) { + $panic(new $String("nosync: unlock of unlocked mutex")); + } + rw.writeLocked = false; + }; + RWMutex.prototype.Unlock = function() { return this.$val.Unlock(); }; + RWMutex.ptr.prototype.RLock = function() { + var $ptr, rw; + rw = this; + if (rw.writeLocked) { + $panic(new $String("nosync: mutex is already locked")); + } + rw.readLockCounter = rw.readLockCounter + (1) >> 0; + }; + RWMutex.prototype.RLock = function() { return this.$val.RLock(); }; + RWMutex.ptr.prototype.RUnlock = function() { + var $ptr, rw; + rw = this; + if (rw.readLockCounter === 0) { + $panic(new $String("nosync: unlock of unlocked mutex")); + } + rw.readLockCounter = rw.readLockCounter - (1) >> 0; + }; + RWMutex.prototype.RUnlock = function() { return this.$val.RUnlock(); }; + WaitGroup.ptr.prototype.Add = function(delta) { + var $ptr, delta, wg; + wg = this; + wg.counter = wg.counter + (delta) >> 0; + if (wg.counter < 0) { + $panic(new $String("sync: negative WaitGroup counter")); + } + }; + WaitGroup.prototype.Add = function(delta) { return this.$val.Add(delta); }; + WaitGroup.ptr.prototype.Done = function() { + var $ptr, wg; + wg = this; + wg.Add(-1); + }; + WaitGroup.prototype.Done = function() { return this.$val.Done(); }; + WaitGroup.ptr.prototype.Wait = function() { + var $ptr, wg; + wg = this; + if (!((wg.counter === 0))) { + $panic(new $String("sync: WaitGroup counter not zero")); + } + }; + WaitGroup.prototype.Wait = function() { return this.$val.Wait(); }; + Once.ptr.prototype.Do = function(f) { + var $ptr, f, o, $s, $deferred, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; o = $f.o; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + o = [o]; + o[0] = this; + if (o[0].done) { + return; + } + if (o[0].doing) { + $panic(new $String("nosync: Do called within f")); + } + o[0].doing = true; + $deferred.push([(function(o) { return function() { + var $ptr; + o[0].doing = false; + o[0].done = true; + }; })(o), []]); + $r = f(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Once.ptr.prototype.Do }; } $f.$ptr = $ptr; $f.f = f; $f.o = o; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } + }; + Once.prototype.Do = function(f) { return this.$val.Do(f); }; + ptrType.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; + ptrType$1.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}, {prop: "RLock", name: "RLock", pkg: "", typ: $funcType([], [], false)}, {prop: "RUnlock", name: "RUnlock", pkg: "", typ: $funcType([], [], false)}]; + ptrType$2.methods = [{prop: "Add", name: "Add", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [], false)}, {prop: "Wait", name: "Wait", pkg: "", typ: $funcType([], [], false)}]; + ptrType$3.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([funcType], [], false)}]; + Mutex.init([{prop: "locked", name: "locked", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Bool, tag: ""}]); + RWMutex.init([{prop: "writeLocked", name: "writeLocked", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Bool, tag: ""}, {prop: "readLockCounter", name: "readLockCounter", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Int, tag: ""}]); + WaitGroup.init([{prop: "counter", name: "counter", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Int, tag: ""}]); + Once.init([{prop: "doing", name: "doing", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Bool, tag: ""}, {prop: "done", name: "done", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Bool, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["strings"] = (function() { + var $pkg = {}, $init, errors, js, io, unicode, utf8, Reader, sliceType, ptrType$5, IndexByte, Index, NewReader, ContainsRune, IndexRune; + errors = $packages["errors"]; + js = $packages["github.com/gopherjs/gopherjs/js"]; + io = $packages["io"]; + unicode = $packages["unicode"]; + utf8 = $packages["unicode/utf8"]; + Reader = $pkg.Reader = $newType(0, $kindStruct, "strings.Reader", "Reader", "strings", function(s_, i_, prevRune_) { + this.$val = this; + if (arguments.length === 0) { + this.s = ""; + this.i = new $Int64(0, 0); + this.prevRune = 0; + return; + } + this.s = s_; + this.i = i_; + this.prevRune = prevRune_; + }); + sliceType = $sliceType($Uint8); + ptrType$5 = $ptrType(Reader); + IndexByte = function(s, c) { + var $ptr, c, s; + return $parseInt(s.indexOf($global.String.fromCharCode(c))) >> 0; + }; + $pkg.IndexByte = IndexByte; + Index = function(s, sep) { + var $ptr, s, sep; + return $parseInt(s.indexOf(sep)) >> 0; + }; + $pkg.Index = Index; + Reader.ptr.prototype.Len = function() { + var $ptr, r, x, x$1, x$2, x$3, x$4; + r = this; + if ((x = r.i, x$1 = new $Int64(0, r.s.length), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { + return 0; + } + return ((x$2 = (x$3 = new $Int64(0, r.s.length), x$4 = r.i, new $Int64(x$3.$high - x$4.$high, x$3.$low - x$4.$low)), x$2.$low + ((x$2.$high >> 31) * 4294967296)) >> 0); + }; + Reader.prototype.Len = function() { return this.$val.Len(); }; + Reader.ptr.prototype.Size = function() { + var $ptr, r; + r = this; + return new $Int64(0, r.s.length); + }; + Reader.prototype.Size = function() { return this.$val.Size(); }; + Reader.ptr.prototype.Read = function(b) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, b, err, n, r, x, x$1, x$2, x$3; + n = 0; + err = $ifaceNil; + r = this; + if (b.$length === 0) { + _tmp = 0; + _tmp$1 = $ifaceNil; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + if ((x = r.i, x$1 = new $Int64(0, r.s.length), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { + _tmp$2 = 0; + _tmp$3 = io.EOF; + n = _tmp$2; + err = _tmp$3; + return [n, err]; + } + r.prevRune = -1; + n = $copyString(b, r.s.substring($flatten64(r.i))); + r.i = (x$2 = r.i, x$3 = new $Int64(0, n), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); + return [n, err]; + }; + Reader.prototype.Read = function(b) { return this.$val.Read(b); }; + Reader.ptr.prototype.ReadAt = function(b, off) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, b, err, n, off, r, x; + n = 0; + err = $ifaceNil; + r = this; + if ((off.$high < 0 || (off.$high === 0 && off.$low < 0))) { + _tmp = 0; + _tmp$1 = errors.New("strings.Reader.ReadAt: negative offset"); + n = _tmp; + err = _tmp$1; + return [n, err]; + } + if ((x = new $Int64(0, r.s.length), (off.$high > x.$high || (off.$high === x.$high && off.$low >= x.$low)))) { + _tmp$2 = 0; + _tmp$3 = io.EOF; + n = _tmp$2; + err = _tmp$3; + return [n, err]; + } + n = $copyString(b, r.s.substring($flatten64(off))); + if (n < b.$length) { + err = io.EOF; + } + return [n, err]; + }; + Reader.prototype.ReadAt = function(b, off) { return this.$val.ReadAt(b, off); }; + Reader.ptr.prototype.ReadByte = function() { + var $ptr, _tmp, _tmp$1, b, err, r, x, x$1, x$2, x$3; + b = 0; + err = $ifaceNil; + r = this; + r.prevRune = -1; + if ((x = r.i, x$1 = new $Int64(0, r.s.length), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { + _tmp = 0; + _tmp$1 = io.EOF; + b = _tmp; + err = _tmp$1; + return [b, err]; + } + b = r.s.charCodeAt($flatten64(r.i)); + r.i = (x$2 = r.i, x$3 = new $Int64(0, 1), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); + return [b, err]; + }; + Reader.prototype.ReadByte = function() { return this.$val.ReadByte(); }; + Reader.ptr.prototype.UnreadByte = function() { + var $ptr, r, x, x$1, x$2; + r = this; + r.prevRune = -1; + if ((x = r.i, (x.$high < 0 || (x.$high === 0 && x.$low <= 0)))) { + return errors.New("strings.Reader.UnreadByte: at beginning of string"); + } + r.i = (x$1 = r.i, x$2 = new $Int64(0, 1), new $Int64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)); + return $ifaceNil; + }; + Reader.prototype.UnreadByte = function() { return this.$val.UnreadByte(); }; + Reader.ptr.prototype.ReadRune = function() { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, c, ch, err, r, size, x, x$1, x$2, x$3, x$4, x$5, x$6; + ch = 0; + size = 0; + err = $ifaceNil; + r = this; + if ((x = r.i, x$1 = new $Int64(0, r.s.length), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { + r.prevRune = -1; + _tmp = 0; + _tmp$1 = 0; + _tmp$2 = io.EOF; + ch = _tmp; + size = _tmp$1; + err = _tmp$2; + return [ch, size, err]; + } + r.prevRune = ((x$2 = r.i, x$2.$low + ((x$2.$high >> 31) * 4294967296)) >> 0); + c = r.s.charCodeAt($flatten64(r.i)); + if (c < 128) { + r.i = (x$3 = r.i, x$4 = new $Int64(0, 1), new $Int64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)); + _tmp$3 = (c >> 0); + _tmp$4 = 1; + _tmp$5 = $ifaceNil; + ch = _tmp$3; + size = _tmp$4; + err = _tmp$5; + return [ch, size, err]; + } + _tuple = utf8.DecodeRuneInString(r.s.substring($flatten64(r.i))); + ch = _tuple[0]; + size = _tuple[1]; + r.i = (x$5 = r.i, x$6 = new $Int64(0, size), new $Int64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)); + return [ch, size, err]; + }; + Reader.prototype.ReadRune = function() { return this.$val.ReadRune(); }; + Reader.ptr.prototype.UnreadRune = function() { + var $ptr, r; + r = this; + if (r.prevRune < 0) { + return errors.New("strings.Reader.UnreadRune: previous operation was not ReadRune"); + } + r.i = new $Int64(0, r.prevRune); + r.prevRune = -1; + return $ifaceNil; + }; + Reader.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; + Reader.ptr.prototype.Seek = function(offset, whence) { + var $ptr, _1, abs, offset, r, whence, x, x$1; + r = this; + r.prevRune = -1; + abs = new $Int64(0, 0); + _1 = whence; + if (_1 === (0)) { + abs = offset; + } else if (_1 === (1)) { + abs = (x = r.i, new $Int64(x.$high + offset.$high, x.$low + offset.$low)); + } else if (_1 === (2)) { + abs = (x$1 = new $Int64(0, r.s.length), new $Int64(x$1.$high + offset.$high, x$1.$low + offset.$low)); + } else { + return [new $Int64(0, 0), errors.New("strings.Reader.Seek: invalid whence")]; + } + if ((abs.$high < 0 || (abs.$high === 0 && abs.$low < 0))) { + return [new $Int64(0, 0), errors.New("strings.Reader.Seek: negative position")]; + } + r.i = abs; + return [abs, $ifaceNil]; + }; + Reader.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; + Reader.ptr.prototype.WriteTo = function(w) { + var $ptr, _r, _tmp, _tmp$1, _tuple, err, m, n, r, s, w, x, x$1, x$2, x$3, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; m = $f.m; n = $f.n; r = $f.r; s = $f.s; w = $f.w; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = new $Int64(0, 0); + err = $ifaceNil; + r = this; + r.prevRune = -1; + if ((x = r.i, x$1 = new $Int64(0, r.s.length), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { + _tmp = new $Int64(0, 0); + _tmp$1 = $ifaceNil; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + s = r.s.substring($flatten64(r.i)); + _r = io.WriteString(w, s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + m = _tuple[0]; + err = _tuple[1]; + if (m > s.length) { + $panic(new $String("strings.Reader.WriteTo: invalid WriteString count")); + } + r.i = (x$2 = r.i, x$3 = new $Int64(0, m), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); + n = new $Int64(0, m); + if (!((m === s.length)) && $interfaceIsEqual(err, $ifaceNil)) { + err = io.ErrShortWrite; + } + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.WriteTo }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.m = m; $f.n = n; $f.r = r; $f.s = s; $f.w = w; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; + }; + Reader.prototype.WriteTo = function(w) { return this.$val.WriteTo(w); }; + NewReader = function(s) { + var $ptr, s; + return new Reader.ptr(s, new $Int64(0, 0), -1); + }; + $pkg.NewReader = NewReader; + ContainsRune = function(s, r) { + var $ptr, r, s; + return IndexRune(s, r) >= 0; + }; + $pkg.ContainsRune = ContainsRune; + IndexRune = function(s, r) { + var $ptr, _i, _ref, _rune, c, i, r, s; + if (r < 128) { + return IndexByte(s, (r << 24 >>> 24)); + } else { + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.length)) { break; } + _rune = $decodeRune(_ref, _i); + i = _i; + c = _rune[0]; + if (c === r) { + return i; + } + _i += _rune[1]; + } + } + return -1; + }; + $pkg.IndexRune = IndexRune; + ptrType$5.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType, $Int64], [$Int, $error], false)}, {prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([io.Writer], [$Int64, $error], false)}]; + Reader.init([{prop: "s", name: "s", pkg: "strings", typ: $String, tag: ""}, {prop: "i", name: "i", pkg: "strings", typ: $Int64, tag: ""}, {prop: "prevRune", name: "prevRune", pkg: "strings", typ: $Int, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = unicode.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf8.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["time"] = (function() { + var $pkg = {}, $init, errors, js, nosync, runtime, strings, syscall, ParseError, Time, Month, Weekday, Duration, Location, zone, zoneTrans, sliceType, sliceType$1, ptrType, sliceType$2, arrayType, sliceType$3, arrayType$1, arrayType$2, ptrType$1, arrayType$4, ptrType$3, ptrType$6, std0x, longDayNames, shortDayNames, shortMonthNames, longMonthNames, atoiError, errBad, errLeadingInt, unitMap, months, days, daysBefore, utcLoc, utcLoc$24ptr, localLoc, localLoc$24ptr, localOnce, zoneinfo, badData, zoneDirs, _tuple, _r, init, initLocal, startsWithLowerCase, nextStdChunk, match, lookup, appendInt, atoi, formatNano, quote, isDigit, getnum, cutspace, skip, Parse, parse, parseTimeZone, parseGMT, parseNanoseconds, leadingInt, ParseDuration, absWeekday, absClock, fmtFrac, fmtInt, absDate, daysIn, Unix, isLeap, norm, Date, div, FixedZone; + errors = $packages["errors"]; + js = $packages["github.com/gopherjs/gopherjs/js"]; + nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; + runtime = $packages["runtime"]; + strings = $packages["strings"]; + syscall = $packages["syscall"]; + ParseError = $pkg.ParseError = $newType(0, $kindStruct, "time.ParseError", "ParseError", "time", function(Layout_, Value_, LayoutElem_, ValueElem_, Message_) { + this.$val = this; + if (arguments.length === 0) { + this.Layout = ""; + this.Value = ""; + this.LayoutElem = ""; + this.ValueElem = ""; + this.Message = ""; + return; + } + this.Layout = Layout_; + this.Value = Value_; + this.LayoutElem = LayoutElem_; + this.ValueElem = ValueElem_; + this.Message = Message_; + }); + Time = $pkg.Time = $newType(0, $kindStruct, "time.Time", "Time", "time", function(sec_, nsec_, loc_) { + this.$val = this; + if (arguments.length === 0) { + this.sec = new $Int64(0, 0); + this.nsec = 0; + this.loc = ptrType$1.nil; + return; + } + this.sec = sec_; + this.nsec = nsec_; + this.loc = loc_; + }); + Month = $pkg.Month = $newType(4, $kindInt, "time.Month", "Month", "time", null); + Weekday = $pkg.Weekday = $newType(4, $kindInt, "time.Weekday", "Weekday", "time", null); + Duration = $pkg.Duration = $newType(8, $kindInt64, "time.Duration", "Duration", "time", null); + Location = $pkg.Location = $newType(0, $kindStruct, "time.Location", "Location", "time", function(name_, zone_, tx_, cacheStart_, cacheEnd_, cacheZone_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ""; + this.zone = sliceType.nil; + this.tx = sliceType$1.nil; + this.cacheStart = new $Int64(0, 0); + this.cacheEnd = new $Int64(0, 0); + this.cacheZone = ptrType.nil; + return; + } + this.name = name_; + this.zone = zone_; + this.tx = tx_; + this.cacheStart = cacheStart_; + this.cacheEnd = cacheEnd_; + this.cacheZone = cacheZone_; + }); + zone = $pkg.zone = $newType(0, $kindStruct, "time.zone", "zone", "time", function(name_, offset_, isDST_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ""; + this.offset = 0; + this.isDST = false; + return; + } + this.name = name_; + this.offset = offset_; + this.isDST = isDST_; + }); + zoneTrans = $pkg.zoneTrans = $newType(0, $kindStruct, "time.zoneTrans", "zoneTrans", "time", function(when_, index_, isstd_, isutc_) { + this.$val = this; + if (arguments.length === 0) { + this.when = new $Int64(0, 0); + this.index = 0; + this.isstd = false; + this.isutc = false; + return; + } + this.when = when_; + this.index = index_; + this.isstd = isstd_; + this.isutc = isutc_; + }); + sliceType = $sliceType(zone); + sliceType$1 = $sliceType(zoneTrans); + ptrType = $ptrType(zone); + sliceType$2 = $sliceType($String); + arrayType = $arrayType($Uint8, 20); + sliceType$3 = $sliceType($Uint8); + arrayType$1 = $arrayType($Uint8, 9); + arrayType$2 = $arrayType($Uint8, 64); + ptrType$1 = $ptrType(Location); + arrayType$4 = $arrayType($Uint8, 32); + ptrType$3 = $ptrType(ParseError); + ptrType$6 = $ptrType(Time); + init = function() { + var $ptr; + Unix(new $Int64(0, 0), new $Int64(0, 0)); + }; + initLocal = function() { + var $ptr, d, i, j, s; + d = new ($global.Date)(); + s = $internalize(d, $String); + i = strings.IndexByte(s, 40); + j = strings.IndexByte(s, 41); + if ((i === -1) || (j === -1)) { + localLoc.name = "UTC"; + return; + } + localLoc.name = s.substring((i + 1 >> 0), j); + localLoc.zone = new sliceType([new zone.ptr(localLoc.name, $imul(($parseInt(d.getTimezoneOffset()) >> 0), -60), false)]); + }; + startsWithLowerCase = function(str) { + var $ptr, c, str; + if (str.length === 0) { + return false; + } + c = str.charCodeAt(0); + return 97 <= c && c <= 122; + }; + nextStdChunk = function(layout) { + var $ptr, _1, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$44, _tmp$45, _tmp$46, _tmp$47, _tmp$48, _tmp$49, _tmp$5, _tmp$50, _tmp$51, _tmp$52, _tmp$53, _tmp$54, _tmp$55, _tmp$56, _tmp$57, _tmp$58, _tmp$59, _tmp$6, _tmp$60, _tmp$61, _tmp$62, _tmp$63, _tmp$64, _tmp$65, _tmp$66, _tmp$67, _tmp$68, _tmp$69, _tmp$7, _tmp$70, _tmp$71, _tmp$72, _tmp$73, _tmp$74, _tmp$75, _tmp$76, _tmp$77, _tmp$78, _tmp$79, _tmp$8, _tmp$80, _tmp$81, _tmp$82, _tmp$83, _tmp$84, _tmp$85, _tmp$86, _tmp$9, c, ch, i, j, layout, prefix, std, std$1, suffix, x; + prefix = ""; + std = 0; + suffix = ""; + i = 0; + while (true) { + if (!(i < layout.length)) { break; } + c = (layout.charCodeAt(i) >> 0); + _1 = c; + if (_1 === (74)) { + if (layout.length >= (i + 3 >> 0) && layout.substring(i, (i + 3 >> 0)) === "Jan") { + if (layout.length >= (i + 7 >> 0) && layout.substring(i, (i + 7 >> 0)) === "January") { + _tmp = layout.substring(0, i); + _tmp$1 = 257; + _tmp$2 = layout.substring((i + 7 >> 0)); + prefix = _tmp; + std = _tmp$1; + suffix = _tmp$2; + return [prefix, std, suffix]; + } + if (!startsWithLowerCase(layout.substring((i + 3 >> 0)))) { + _tmp$3 = layout.substring(0, i); + _tmp$4 = 258; + _tmp$5 = layout.substring((i + 3 >> 0)); + prefix = _tmp$3; + std = _tmp$4; + suffix = _tmp$5; + return [prefix, std, suffix]; + } + } + } else if (_1 === (77)) { + if (layout.length >= (i + 3 >> 0)) { + if (layout.substring(i, (i + 3 >> 0)) === "Mon") { + if (layout.length >= (i + 6 >> 0) && layout.substring(i, (i + 6 >> 0)) === "Monday") { + _tmp$6 = layout.substring(0, i); + _tmp$7 = 261; + _tmp$8 = layout.substring((i + 6 >> 0)); + prefix = _tmp$6; + std = _tmp$7; + suffix = _tmp$8; + return [prefix, std, suffix]; + } + if (!startsWithLowerCase(layout.substring((i + 3 >> 0)))) { + _tmp$9 = layout.substring(0, i); + _tmp$10 = 262; + _tmp$11 = layout.substring((i + 3 >> 0)); + prefix = _tmp$9; + std = _tmp$10; + suffix = _tmp$11; + return [prefix, std, suffix]; + } + } + if (layout.substring(i, (i + 3 >> 0)) === "MST") { + _tmp$12 = layout.substring(0, i); + _tmp$13 = 21; + _tmp$14 = layout.substring((i + 3 >> 0)); + prefix = _tmp$12; + std = _tmp$13; + suffix = _tmp$14; + return [prefix, std, suffix]; + } + } + } else if (_1 === (48)) { + if (layout.length >= (i + 2 >> 0) && 49 <= layout.charCodeAt((i + 1 >> 0)) && layout.charCodeAt((i + 1 >> 0)) <= 54) { + _tmp$15 = layout.substring(0, i); + _tmp$16 = (x = layout.charCodeAt((i + 1 >> 0)) - 49 << 24 >>> 24, ((x < 0 || x >= std0x.length) ? $throwRuntimeError("index out of range") : std0x[x])); + _tmp$17 = layout.substring((i + 2 >> 0)); + prefix = _tmp$15; + std = _tmp$16; + suffix = _tmp$17; + return [prefix, std, suffix]; + } + } else if (_1 === (49)) { + if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 53)) { + _tmp$18 = layout.substring(0, i); + _tmp$19 = 522; + _tmp$20 = layout.substring((i + 2 >> 0)); + prefix = _tmp$18; + std = _tmp$19; + suffix = _tmp$20; + return [prefix, std, suffix]; + } + _tmp$21 = layout.substring(0, i); + _tmp$22 = 259; + _tmp$23 = layout.substring((i + 1 >> 0)); + prefix = _tmp$21; + std = _tmp$22; + suffix = _tmp$23; + return [prefix, std, suffix]; + } else if (_1 === (50)) { + if (layout.length >= (i + 4 >> 0) && layout.substring(i, (i + 4 >> 0)) === "2006") { + _tmp$24 = layout.substring(0, i); + _tmp$25 = 273; + _tmp$26 = layout.substring((i + 4 >> 0)); + prefix = _tmp$24; + std = _tmp$25; + suffix = _tmp$26; + return [prefix, std, suffix]; + } + _tmp$27 = layout.substring(0, i); + _tmp$28 = 263; + _tmp$29 = layout.substring((i + 1 >> 0)); + prefix = _tmp$27; + std = _tmp$28; + suffix = _tmp$29; + return [prefix, std, suffix]; + } else if (_1 === (95)) { + if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 50)) { + if (layout.length >= (i + 5 >> 0) && layout.substring((i + 1 >> 0), (i + 5 >> 0)) === "2006") { + _tmp$30 = layout.substring(0, (i + 1 >> 0)); + _tmp$31 = 273; + _tmp$32 = layout.substring((i + 5 >> 0)); + prefix = _tmp$30; + std = _tmp$31; + suffix = _tmp$32; + return [prefix, std, suffix]; + } + _tmp$33 = layout.substring(0, i); + _tmp$34 = 264; + _tmp$35 = layout.substring((i + 2 >> 0)); + prefix = _tmp$33; + std = _tmp$34; + suffix = _tmp$35; + return [prefix, std, suffix]; + } + } else if (_1 === (51)) { + _tmp$36 = layout.substring(0, i); + _tmp$37 = 523; + _tmp$38 = layout.substring((i + 1 >> 0)); + prefix = _tmp$36; + std = _tmp$37; + suffix = _tmp$38; + return [prefix, std, suffix]; + } else if (_1 === (52)) { + _tmp$39 = layout.substring(0, i); + _tmp$40 = 525; + _tmp$41 = layout.substring((i + 1 >> 0)); + prefix = _tmp$39; + std = _tmp$40; + suffix = _tmp$41; + return [prefix, std, suffix]; + } else if (_1 === (53)) { + _tmp$42 = layout.substring(0, i); + _tmp$43 = 527; + _tmp$44 = layout.substring((i + 1 >> 0)); + prefix = _tmp$42; + std = _tmp$43; + suffix = _tmp$44; + return [prefix, std, suffix]; + } else if (_1 === (80)) { + if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 77)) { + _tmp$45 = layout.substring(0, i); + _tmp$46 = 531; + _tmp$47 = layout.substring((i + 2 >> 0)); + prefix = _tmp$45; + std = _tmp$46; + suffix = _tmp$47; + return [prefix, std, suffix]; + } + } else if (_1 === (112)) { + if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 109)) { + _tmp$48 = layout.substring(0, i); + _tmp$49 = 532; + _tmp$50 = layout.substring((i + 2 >> 0)); + prefix = _tmp$48; + std = _tmp$49; + suffix = _tmp$50; + return [prefix, std, suffix]; + } + } else if (_1 === (45)) { + if (layout.length >= (i + 7 >> 0) && layout.substring(i, (i + 7 >> 0)) === "-070000") { + _tmp$51 = layout.substring(0, i); + _tmp$52 = 28; + _tmp$53 = layout.substring((i + 7 >> 0)); + prefix = _tmp$51; + std = _tmp$52; + suffix = _tmp$53; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 9 >> 0) && layout.substring(i, (i + 9 >> 0)) === "-07:00:00") { + _tmp$54 = layout.substring(0, i); + _tmp$55 = 31; + _tmp$56 = layout.substring((i + 9 >> 0)); + prefix = _tmp$54; + std = _tmp$55; + suffix = _tmp$56; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 5 >> 0) && layout.substring(i, (i + 5 >> 0)) === "-0700") { + _tmp$57 = layout.substring(0, i); + _tmp$58 = 27; + _tmp$59 = layout.substring((i + 5 >> 0)); + prefix = _tmp$57; + std = _tmp$58; + suffix = _tmp$59; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 6 >> 0) && layout.substring(i, (i + 6 >> 0)) === "-07:00") { + _tmp$60 = layout.substring(0, i); + _tmp$61 = 30; + _tmp$62 = layout.substring((i + 6 >> 0)); + prefix = _tmp$60; + std = _tmp$61; + suffix = _tmp$62; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 3 >> 0) && layout.substring(i, (i + 3 >> 0)) === "-07") { + _tmp$63 = layout.substring(0, i); + _tmp$64 = 29; + _tmp$65 = layout.substring((i + 3 >> 0)); + prefix = _tmp$63; + std = _tmp$64; + suffix = _tmp$65; + return [prefix, std, suffix]; + } + } else if (_1 === (90)) { + if (layout.length >= (i + 7 >> 0) && layout.substring(i, (i + 7 >> 0)) === "Z070000") { + _tmp$66 = layout.substring(0, i); + _tmp$67 = 23; + _tmp$68 = layout.substring((i + 7 >> 0)); + prefix = _tmp$66; + std = _tmp$67; + suffix = _tmp$68; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 9 >> 0) && layout.substring(i, (i + 9 >> 0)) === "Z07:00:00") { + _tmp$69 = layout.substring(0, i); + _tmp$70 = 26; + _tmp$71 = layout.substring((i + 9 >> 0)); + prefix = _tmp$69; + std = _tmp$70; + suffix = _tmp$71; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 5 >> 0) && layout.substring(i, (i + 5 >> 0)) === "Z0700") { + _tmp$72 = layout.substring(0, i); + _tmp$73 = 22; + _tmp$74 = layout.substring((i + 5 >> 0)); + prefix = _tmp$72; + std = _tmp$73; + suffix = _tmp$74; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 6 >> 0) && layout.substring(i, (i + 6 >> 0)) === "Z07:00") { + _tmp$75 = layout.substring(0, i); + _tmp$76 = 25; + _tmp$77 = layout.substring((i + 6 >> 0)); + prefix = _tmp$75; + std = _tmp$76; + suffix = _tmp$77; + return [prefix, std, suffix]; + } + if (layout.length >= (i + 3 >> 0) && layout.substring(i, (i + 3 >> 0)) === "Z07") { + _tmp$78 = layout.substring(0, i); + _tmp$79 = 24; + _tmp$80 = layout.substring((i + 3 >> 0)); + prefix = _tmp$78; + std = _tmp$79; + suffix = _tmp$80; + return [prefix, std, suffix]; + } + } else if (_1 === (46)) { + if ((i + 1 >> 0) < layout.length && ((layout.charCodeAt((i + 1 >> 0)) === 48) || (layout.charCodeAt((i + 1 >> 0)) === 57))) { + ch = layout.charCodeAt((i + 1 >> 0)); + j = i + 1 >> 0; + while (true) { + if (!(j < layout.length && (layout.charCodeAt(j) === ch))) { break; } + j = j + (1) >> 0; + } + if (!isDigit(layout, j)) { + std$1 = 32; + if (layout.charCodeAt((i + 1 >> 0)) === 57) { + std$1 = 33; + } + std$1 = std$1 | ((((j - ((i + 1 >> 0)) >> 0)) << 16 >> 0)); + _tmp$81 = layout.substring(0, i); + _tmp$82 = std$1; + _tmp$83 = layout.substring(j); + prefix = _tmp$81; + std = _tmp$82; + suffix = _tmp$83; + return [prefix, std, suffix]; + } + } + } + i = i + (1) >> 0; + } + _tmp$84 = layout; + _tmp$85 = 0; + _tmp$86 = ""; + prefix = _tmp$84; + std = _tmp$85; + suffix = _tmp$86; + return [prefix, std, suffix]; + }; + match = function(s1, s2) { + var $ptr, c1, c2, i, s1, s2; + i = 0; + while (true) { + if (!(i < s1.length)) { break; } + c1 = s1.charCodeAt(i); + c2 = s2.charCodeAt(i); + if (!((c1 === c2))) { + c1 = (c1 | (32)) >>> 0; + c2 = (c2 | (32)) >>> 0; + if (!((c1 === c2)) || c1 < 97 || c1 > 122) { + return false; + } + } + i = i + (1) >> 0; + } + return true; + }; + lookup = function(tab, val) { + var $ptr, _i, _ref, i, tab, v, val; + _ref = tab; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + v = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (val.length >= v.length && match(val.substring(0, v.length), v)) { + return [i, val.substring(v.length), $ifaceNil]; + } + _i++; + } + return [-1, val, errBad]; + }; + appendInt = function(b, x, width) { + var $ptr, _q, b, buf, i, q, u, w, width, x; + u = (x >>> 0); + if (x < 0) { + b = $append(b, 45); + u = (-x >>> 0); + } + buf = arrayType.zero(); + i = 20; + while (true) { + if (!(u >= 10)) { break; } + i = i - (1) >> 0; + q = (_q = u / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + ((i < 0 || i >= buf.length) ? $throwRuntimeError("index out of range") : buf[i] = (((48 + u >>> 0) - (q * 10 >>> 0) >>> 0) << 24 >>> 24)); + u = q; + } + i = i - (1) >> 0; + ((i < 0 || i >= buf.length) ? $throwRuntimeError("index out of range") : buf[i] = ((48 + u >>> 0) << 24 >>> 24)); + w = 20 - i >> 0; + while (true) { + if (!(w < width)) { break; } + b = $append(b, 48); + w = w + (1) >> 0; + } + return $appendSlice(b, $subslice(new sliceType$3(buf), i)); + }; + atoi = function(s) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple$1, err, neg, q, rem, s, x; + x = 0; + err = $ifaceNil; + neg = false; + if (!(s === "") && ((s.charCodeAt(0) === 45) || (s.charCodeAt(0) === 43))) { + neg = s.charCodeAt(0) === 45; + s = s.substring(1); + } + _tuple$1 = leadingInt(s); + q = _tuple$1[0]; + rem = _tuple$1[1]; + err = _tuple$1[2]; + x = ((q.$low + ((q.$high >> 31) * 4294967296)) >> 0); + if (!($interfaceIsEqual(err, $ifaceNil)) || !(rem === "")) { + _tmp = 0; + _tmp$1 = atoiError; + x = _tmp; + err = _tmp$1; + return [x, err]; + } + if (neg) { + x = -x; + } + _tmp$2 = x; + _tmp$3 = $ifaceNil; + x = _tmp$2; + err = _tmp$3; + return [x, err]; + }; + formatNano = function(b, nanosec, n, trim) { + var $ptr, _q, _r$1, b, buf, n, nanosec, start, trim, u, x; + u = nanosec; + buf = arrayType$1.zero(); + start = 9; + while (true) { + if (!(start > 0)) { break; } + start = start - (1) >> 0; + ((start < 0 || start >= buf.length) ? $throwRuntimeError("index out of range") : buf[start] = (((_r$1 = u % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) + 48 >>> 0) << 24 >>> 24)); + u = (_q = u / (10), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + } + if (n > 9) { + n = 9; + } + if (trim) { + while (true) { + if (!(n > 0 && ((x = n - 1 >> 0, ((x < 0 || x >= buf.length) ? $throwRuntimeError("index out of range") : buf[x])) === 48))) { break; } + n = n - (1) >> 0; + } + if (n === 0) { + return b; + } + } + b = $append(b, 46); + return $appendSlice(b, $subslice(new sliceType$3(buf), 0, n)); + }; + Time.ptr.prototype.String = function() { + var $ptr, _r$1, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.Format("2006-01-02 15:04:05.999999999 -0700 MST"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r$1; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.String }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.String = function() { return this.$val.String(); }; + Time.ptr.prototype.Format = function(layout) { + var $ptr, _r$1, b, buf, layout, max, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; b = $f.b; buf = $f.buf; layout = $f.layout; max = $f.max; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + b = sliceType$3.nil; + max = layout.length + 10 >> 0; + if (max < 64) { + buf = arrayType$2.zero(); + b = $subslice(new sliceType$3(buf), 0, 0); + } else { + b = $makeSlice(sliceType$3, 0, max); + } + _r$1 = t.AppendFormat(b, layout); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + b = _r$1; + return $bytesToString(b); + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Format }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.b = b; $f.buf = buf; $f.layout = layout; $f.max = max; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.Format = function(layout) { return this.$val.Format(layout); }; + Time.ptr.prototype.AppendFormat = function(b, layout) { + var $ptr, _2, _q, _q$1, _q$2, _q$3, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple$1, _tuple$2, _tuple$3, _tuple$4, abs, absoffset, b, day, hour, hr, hr$1, layout, m, min, month, name, offset, prefix, s, sec, std, suffix, t, y, year, zone$1, zone$2, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _2 = $f._2; _q = $f._q; _q$1 = $f._q$1; _q$2 = $f._q$2; _q$3 = $f._q$3; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; abs = $f.abs; absoffset = $f.absoffset; b = $f.b; day = $f.day; hour = $f.hour; hr = $f.hr; hr$1 = $f.hr$1; layout = $f.layout; m = $f.m; min = $f.min; month = $f.month; name = $f.name; offset = $f.offset; prefix = $f.prefix; s = $f.s; sec = $f.sec; std = $f.std; suffix = $f.suffix; t = $f.t; y = $f.y; year = $f.year; zone$1 = $f.zone$1; zone$2 = $f.zone$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.locabs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + name = _tuple$1[0]; + offset = _tuple$1[1]; + abs = _tuple$1[2]; + year = -1; + month = 0; + day = 0; + hour = -1; + min = 0; + sec = 0; + while (true) { + if (!(!(layout === ""))) { break; } + _tuple$2 = nextStdChunk(layout); + prefix = _tuple$2[0]; + std = _tuple$2[1]; + suffix = _tuple$2[2]; + if (!(prefix === "")) { + b = $appendSlice(b, prefix); + } + if (std === 0) { + break; + } + layout = suffix; + if (year < 0 && !(((std & 256) === 0))) { + _tuple$3 = absDate(abs, true); + year = _tuple$3[0]; + month = _tuple$3[1]; + day = _tuple$3[2]; + } + if (hour < 0 && !(((std & 512) === 0))) { + _tuple$4 = absClock(abs); + hour = _tuple$4[0]; + min = _tuple$4[1]; + sec = _tuple$4[2]; + } + switch (0) { default: + _2 = std & 65535; + if (_2 === (274)) { + y = year; + if (y < 0) { + y = -y; + } + b = appendInt(b, (_r$2 = y % 100, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")), 2); + } else if (_2 === (273)) { + b = appendInt(b, year, 4); + } else if (_2 === (258)) { + b = $appendSlice(b, new Month(month).String().substring(0, 3)); + } else if (_2 === (257)) { + m = new Month(month).String(); + b = $appendSlice(b, m); + } else if (_2 === (259)) { + b = appendInt(b, (month >> 0), 0); + } else if (_2 === (260)) { + b = appendInt(b, (month >> 0), 2); + } else if (_2 === (262)) { + b = $appendSlice(b, new Weekday(absWeekday(abs)).String().substring(0, 3)); + } else if (_2 === (261)) { + s = new Weekday(absWeekday(abs)).String(); + b = $appendSlice(b, s); + } else if (_2 === (263)) { + b = appendInt(b, day, 0); + } else if (_2 === (264)) { + if (day < 10) { + b = $append(b, 32); + } + b = appendInt(b, day, 0); + } else if (_2 === (265)) { + b = appendInt(b, day, 2); + } else if (_2 === (522)) { + b = appendInt(b, hour, 2); + } else if (_2 === (523)) { + hr = (_r$3 = hour % 12, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")); + if (hr === 0) { + hr = 12; + } + b = appendInt(b, hr, 0); + } else if (_2 === (524)) { + hr$1 = (_r$4 = hour % 12, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); + if (hr$1 === 0) { + hr$1 = 12; + } + b = appendInt(b, hr$1, 2); + } else if (_2 === (525)) { + b = appendInt(b, min, 0); + } else if (_2 === (526)) { + b = appendInt(b, min, 2); + } else if (_2 === (527)) { + b = appendInt(b, sec, 0); + } else if (_2 === (528)) { + b = appendInt(b, sec, 2); + } else if (_2 === (531)) { + if (hour >= 12) { + b = $appendSlice(b, "PM"); + } else { + b = $appendSlice(b, "AM"); + } + } else if (_2 === (532)) { + if (hour >= 12) { + b = $appendSlice(b, "pm"); + } else { + b = $appendSlice(b, "am"); + } + } else if ((_2 === (22)) || (_2 === (25)) || (_2 === (23)) || (_2 === (24)) || (_2 === (26)) || (_2 === (27)) || (_2 === (30)) || (_2 === (28)) || (_2 === (29)) || (_2 === (31))) { + if ((offset === 0) && ((std === 22) || (std === 25) || (std === 23) || (std === 24) || (std === 26))) { + b = $append(b, 90); + break; + } + zone$1 = (_q = offset / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + absoffset = offset; + if (zone$1 < 0) { + b = $append(b, 45); + zone$1 = -zone$1; + absoffset = -absoffset; + } else { + b = $append(b, 43); + } + b = appendInt(b, (_q$1 = zone$1 / 60, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), 2); + if ((std === 25) || (std === 30) || (std === 26) || (std === 31)) { + b = $append(b, 58); + } + if (!((std === 29)) && !((std === 24))) { + b = appendInt(b, (_r$5 = zone$1 % 60, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")), 2); + } + if ((std === 23) || (std === 28) || (std === 31) || (std === 26)) { + if ((std === 31) || (std === 26)) { + b = $append(b, 58); + } + b = appendInt(b, (_r$6 = absoffset % 60, _r$6 === _r$6 ? _r$6 : $throwRuntimeError("integer divide by zero")), 2); + } + } else if (_2 === (21)) { + if (!(name === "")) { + b = $appendSlice(b, name); + break; + } + zone$2 = (_q$2 = offset / 60, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")); + if (zone$2 < 0) { + b = $append(b, 45); + zone$2 = -zone$2; + } else { + b = $append(b, 43); + } + b = appendInt(b, (_q$3 = zone$2 / 60, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero")), 2); + b = appendInt(b, (_r$7 = zone$2 % 60, _r$7 === _r$7 ? _r$7 : $throwRuntimeError("integer divide by zero")), 2); + } else if ((_2 === (32)) || (_2 === (33))) { + b = formatNano(b, (t.Nanosecond() >>> 0), std >> 16 >> 0, (std & 65535) === 33); + } + } + } + return b; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.AppendFormat }; } $f.$ptr = $ptr; $f._2 = _2; $f._q = _q; $f._q$1 = _q$1; $f._q$2 = _q$2; $f._q$3 = _q$3; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.abs = abs; $f.absoffset = absoffset; $f.b = b; $f.day = day; $f.hour = hour; $f.hr = hr; $f.hr$1 = hr$1; $f.layout = layout; $f.m = m; $f.min = min; $f.month = month; $f.name = name; $f.offset = offset; $f.prefix = prefix; $f.s = s; $f.sec = sec; $f.std = std; $f.suffix = suffix; $f.t = t; $f.y = y; $f.year = year; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.AppendFormat = function(b, layout) { return this.$val.AppendFormat(b, layout); }; + quote = function(s) { + var $ptr, s; + return "\"" + s + "\""; + }; + ParseError.ptr.prototype.Error = function() { + var $ptr, e; + e = this; + if (e.Message === "") { + return "parsing time " + quote(e.Value) + " as " + quote(e.Layout) + ": cannot parse " + quote(e.ValueElem) + " as " + quote(e.LayoutElem); + } + return "parsing time " + quote(e.Value) + e.Message; + }; + ParseError.prototype.Error = function() { return this.$val.Error(); }; + isDigit = function(s, i) { + var $ptr, c, i, s; + if (s.length <= i) { + return false; + } + c = s.charCodeAt(i); + return 48 <= c && c <= 57; + }; + getnum = function(s, fixed) { + var $ptr, fixed, s; + if (!isDigit(s, 0)) { + return [0, s, errBad]; + } + if (!isDigit(s, 1)) { + if (fixed) { + return [0, s, errBad]; + } + return [((s.charCodeAt(0) - 48 << 24 >>> 24) >> 0), s.substring(1), $ifaceNil]; + } + return [($imul(((s.charCodeAt(0) - 48 << 24 >>> 24) >> 0), 10)) + ((s.charCodeAt(1) - 48 << 24 >>> 24) >> 0) >> 0, s.substring(2), $ifaceNil]; + }; + cutspace = function(s) { + var $ptr, s; + while (true) { + if (!(s.length > 0 && (s.charCodeAt(0) === 32))) { break; } + s = s.substring(1); + } + return s; + }; + skip = function(value, prefix) { + var $ptr, prefix, value; + while (true) { + if (!(prefix.length > 0)) { break; } + if (prefix.charCodeAt(0) === 32) { + if (value.length > 0 && !((value.charCodeAt(0) === 32))) { + return [value, errBad]; + } + prefix = cutspace(prefix); + value = cutspace(value); + continue; + } + if ((value.length === 0) || !((value.charCodeAt(0) === prefix.charCodeAt(0)))) { + return [value, errBad]; + } + prefix = prefix.substring(1); + value = value.substring(1); + } + return [value, $ifaceNil]; + }; + Parse = function(layout, value) { + var $ptr, _r$1, layout, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; layout = $f.layout; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r$1 = parse(layout, value, $pkg.UTC, $pkg.Local); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r$1; + /* */ } return; } if ($f === undefined) { $f = { $blk: Parse }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.layout = layout; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Parse = Parse; + parse = function(layout, value, defaultLocation, local) { + var $ptr, _3, _4, _5, _6, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple$1, _tuple$10, _tuple$11, _tuple$12, _tuple$13, _tuple$14, _tuple$15, _tuple$16, _tuple$17, _tuple$18, _tuple$19, _tuple$2, _tuple$20, _tuple$21, _tuple$22, _tuple$23, _tuple$24, _tuple$25, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, alayout, amSet, avalue, day, defaultLocation, err, hour, hour$1, hr, i, layout, local, min, min$1, mm, month, n, n$1, name, ndigit, nsec, offset, offset$1, ok, ok$1, p, pmSet, prefix, rangeErrString, sec, seconds, sign, ss, std, stdstr, suffix, t, t$1, value, x, x$1, x$2, x$3, x$4, x$5, year, z, zoneName, zoneOffset, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _3 = $f._3; _4 = $f._4; _5 = $f._5; _6 = $f._6; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _tmp$12 = $f._tmp$12; _tmp$13 = $f._tmp$13; _tmp$14 = $f._tmp$14; _tmp$15 = $f._tmp$15; _tmp$16 = $f._tmp$16; _tmp$17 = $f._tmp$17; _tmp$18 = $f._tmp$18; _tmp$19 = $f._tmp$19; _tmp$2 = $f._tmp$2; _tmp$20 = $f._tmp$20; _tmp$21 = $f._tmp$21; _tmp$22 = $f._tmp$22; _tmp$23 = $f._tmp$23; _tmp$24 = $f._tmp$24; _tmp$25 = $f._tmp$25; _tmp$26 = $f._tmp$26; _tmp$27 = $f._tmp$27; _tmp$28 = $f._tmp$28; _tmp$29 = $f._tmp$29; _tmp$3 = $f._tmp$3; _tmp$30 = $f._tmp$30; _tmp$31 = $f._tmp$31; _tmp$32 = $f._tmp$32; _tmp$33 = $f._tmp$33; _tmp$34 = $f._tmp$34; _tmp$35 = $f._tmp$35; _tmp$36 = $f._tmp$36; _tmp$37 = $f._tmp$37; _tmp$38 = $f._tmp$38; _tmp$39 = $f._tmp$39; _tmp$4 = $f._tmp$4; _tmp$40 = $f._tmp$40; _tmp$41 = $f._tmp$41; _tmp$42 = $f._tmp$42; _tmp$43 = $f._tmp$43; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple$1 = $f._tuple$1; _tuple$10 = $f._tuple$10; _tuple$11 = $f._tuple$11; _tuple$12 = $f._tuple$12; _tuple$13 = $f._tuple$13; _tuple$14 = $f._tuple$14; _tuple$15 = $f._tuple$15; _tuple$16 = $f._tuple$16; _tuple$17 = $f._tuple$17; _tuple$18 = $f._tuple$18; _tuple$19 = $f._tuple$19; _tuple$2 = $f._tuple$2; _tuple$20 = $f._tuple$20; _tuple$21 = $f._tuple$21; _tuple$22 = $f._tuple$22; _tuple$23 = $f._tuple$23; _tuple$24 = $f._tuple$24; _tuple$25 = $f._tuple$25; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; _tuple$8 = $f._tuple$8; _tuple$9 = $f._tuple$9; alayout = $f.alayout; amSet = $f.amSet; avalue = $f.avalue; day = $f.day; defaultLocation = $f.defaultLocation; err = $f.err; hour = $f.hour; hour$1 = $f.hour$1; hr = $f.hr; i = $f.i; layout = $f.layout; local = $f.local; min = $f.min; min$1 = $f.min$1; mm = $f.mm; month = $f.month; n = $f.n; n$1 = $f.n$1; name = $f.name; ndigit = $f.ndigit; nsec = $f.nsec; offset = $f.offset; offset$1 = $f.offset$1; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; pmSet = $f.pmSet; prefix = $f.prefix; rangeErrString = $f.rangeErrString; sec = $f.sec; seconds = $f.seconds; sign = $f.sign; ss = $f.ss; std = $f.std; stdstr = $f.stdstr; suffix = $f.suffix; t = $f.t; t$1 = $f.t$1; value = $f.value; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; year = $f.year; z = $f.z; zoneName = $f.zoneName; zoneOffset = $f.zoneOffset; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _tmp = layout; + _tmp$1 = value; + alayout = _tmp; + avalue = _tmp$1; + rangeErrString = ""; + amSet = false; + pmSet = false; + year = 0; + month = 1; + day = 1; + hour = 0; + min = 0; + sec = 0; + nsec = 0; + z = ptrType$1.nil; + zoneOffset = -1; + zoneName = ""; + while (true) { + err = $ifaceNil; + _tuple$1 = nextStdChunk(layout); + prefix = _tuple$1[0]; + std = _tuple$1[1]; + suffix = _tuple$1[2]; + stdstr = layout.substring(prefix.length, (layout.length - suffix.length >> 0)); + _tuple$2 = skip(value, prefix); + value = _tuple$2[0]; + err = _tuple$2[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [new Time.ptr(new $Int64(0, 0), 0, ptrType$1.nil), new ParseError.ptr(alayout, avalue, prefix, value, "")]; + } + if (std === 0) { + if (!((value.length === 0))) { + return [new Time.ptr(new $Int64(0, 0), 0, ptrType$1.nil), new ParseError.ptr(alayout, avalue, "", value, ": extra text: " + value)]; + } + break; + } + layout = suffix; + p = ""; + switch (0) { default: + _3 = std & 65535; + if (_3 === (274)) { + if (value.length < 2) { + err = errBad; + break; + } + _tmp$2 = value.substring(0, 2); + _tmp$3 = value.substring(2); + p = _tmp$2; + value = _tmp$3; + _tuple$3 = atoi(p); + year = _tuple$3[0]; + err = _tuple$3[1]; + if (year >= 69) { + year = year + (1900) >> 0; + } else { + year = year + (2000) >> 0; + } + } else if (_3 === (273)) { + if (value.length < 4 || !isDigit(value, 0)) { + err = errBad; + break; + } + _tmp$4 = value.substring(0, 4); + _tmp$5 = value.substring(4); + p = _tmp$4; + value = _tmp$5; + _tuple$4 = atoi(p); + year = _tuple$4[0]; + err = _tuple$4[1]; + } else if (_3 === (258)) { + _tuple$5 = lookup(shortMonthNames, value); + month = _tuple$5[0]; + value = _tuple$5[1]; + err = _tuple$5[2]; + } else if (_3 === (257)) { + _tuple$6 = lookup(longMonthNames, value); + month = _tuple$6[0]; + value = _tuple$6[1]; + err = _tuple$6[2]; + } else if ((_3 === (259)) || (_3 === (260))) { + _tuple$7 = getnum(value, std === 260); + month = _tuple$7[0]; + value = _tuple$7[1]; + err = _tuple$7[2]; + if (month <= 0 || 12 < month) { + rangeErrString = "month"; + } + } else if (_3 === (262)) { + _tuple$8 = lookup(shortDayNames, value); + value = _tuple$8[1]; + err = _tuple$8[2]; + } else if (_3 === (261)) { + _tuple$9 = lookup(longDayNames, value); + value = _tuple$9[1]; + err = _tuple$9[2]; + } else if ((_3 === (263)) || (_3 === (264)) || (_3 === (265))) { + if ((std === 264) && value.length > 0 && (value.charCodeAt(0) === 32)) { + value = value.substring(1); + } + _tuple$10 = getnum(value, std === 265); + day = _tuple$10[0]; + value = _tuple$10[1]; + err = _tuple$10[2]; + if (day < 0) { + rangeErrString = "day"; + } + } else if (_3 === (522)) { + _tuple$11 = getnum(value, false); + hour = _tuple$11[0]; + value = _tuple$11[1]; + err = _tuple$11[2]; + if (hour < 0 || 24 <= hour) { + rangeErrString = "hour"; + } + } else if ((_3 === (523)) || (_3 === (524))) { + _tuple$12 = getnum(value, std === 524); + hour = _tuple$12[0]; + value = _tuple$12[1]; + err = _tuple$12[2]; + if (hour < 0 || 12 < hour) { + rangeErrString = "hour"; + } + } else if ((_3 === (525)) || (_3 === (526))) { + _tuple$13 = getnum(value, std === 526); + min = _tuple$13[0]; + value = _tuple$13[1]; + err = _tuple$13[2]; + if (min < 0 || 60 <= min) { + rangeErrString = "minute"; + } + } else if ((_3 === (527)) || (_3 === (528))) { + _tuple$14 = getnum(value, std === 528); + sec = _tuple$14[0]; + value = _tuple$14[1]; + err = _tuple$14[2]; + if (sec < 0 || 60 <= sec) { + rangeErrString = "second"; + } + if (value.length >= 2 && (value.charCodeAt(0) === 46) && isDigit(value, 1)) { + _tuple$15 = nextStdChunk(layout); + std = _tuple$15[1]; + std = std & (65535); + if ((std === 32) || (std === 33)) { + break; + } + n = 2; + while (true) { + if (!(n < value.length && isDigit(value, n))) { break; } + n = n + (1) >> 0; + } + _tuple$16 = parseNanoseconds(value, n); + nsec = _tuple$16[0]; + rangeErrString = _tuple$16[1]; + err = _tuple$16[2]; + value = value.substring(n); + } + } else if (_3 === (531)) { + if (value.length < 2) { + err = errBad; + break; + } + _tmp$6 = value.substring(0, 2); + _tmp$7 = value.substring(2); + p = _tmp$6; + value = _tmp$7; + _4 = p; + if (_4 === ("PM")) { + pmSet = true; + } else if (_4 === ("AM")) { + amSet = true; + } else { + err = errBad; + } + } else if (_3 === (532)) { + if (value.length < 2) { + err = errBad; + break; + } + _tmp$8 = value.substring(0, 2); + _tmp$9 = value.substring(2); + p = _tmp$8; + value = _tmp$9; + _5 = p; + if (_5 === ("pm")) { + pmSet = true; + } else if (_5 === ("am")) { + amSet = true; + } else { + err = errBad; + } + } else if ((_3 === (22)) || (_3 === (25)) || (_3 === (23)) || (_3 === (24)) || (_3 === (26)) || (_3 === (27)) || (_3 === (29)) || (_3 === (30)) || (_3 === (28)) || (_3 === (31))) { + if (((std === 22) || (std === 24) || (std === 25)) && value.length >= 1 && (value.charCodeAt(0) === 90)) { + value = value.substring(1); + z = $pkg.UTC; + break; + } + _tmp$10 = ""; + _tmp$11 = ""; + _tmp$12 = ""; + _tmp$13 = ""; + sign = _tmp$10; + hour$1 = _tmp$11; + min$1 = _tmp$12; + seconds = _tmp$13; + if ((std === 25) || (std === 30)) { + if (value.length < 6) { + err = errBad; + break; + } + if (!((value.charCodeAt(3) === 58))) { + err = errBad; + break; + } + _tmp$14 = value.substring(0, 1); + _tmp$15 = value.substring(1, 3); + _tmp$16 = value.substring(4, 6); + _tmp$17 = "00"; + _tmp$18 = value.substring(6); + sign = _tmp$14; + hour$1 = _tmp$15; + min$1 = _tmp$16; + seconds = _tmp$17; + value = _tmp$18; + } else if ((std === 29) || (std === 24)) { + if (value.length < 3) { + err = errBad; + break; + } + _tmp$19 = value.substring(0, 1); + _tmp$20 = value.substring(1, 3); + _tmp$21 = "00"; + _tmp$22 = "00"; + _tmp$23 = value.substring(3); + sign = _tmp$19; + hour$1 = _tmp$20; + min$1 = _tmp$21; + seconds = _tmp$22; + value = _tmp$23; + } else if ((std === 26) || (std === 31)) { + if (value.length < 9) { + err = errBad; + break; + } + if (!((value.charCodeAt(3) === 58)) || !((value.charCodeAt(6) === 58))) { + err = errBad; + break; + } + _tmp$24 = value.substring(0, 1); + _tmp$25 = value.substring(1, 3); + _tmp$26 = value.substring(4, 6); + _tmp$27 = value.substring(7, 9); + _tmp$28 = value.substring(9); + sign = _tmp$24; + hour$1 = _tmp$25; + min$1 = _tmp$26; + seconds = _tmp$27; + value = _tmp$28; + } else if ((std === 23) || (std === 28)) { + if (value.length < 7) { + err = errBad; + break; + } + _tmp$29 = value.substring(0, 1); + _tmp$30 = value.substring(1, 3); + _tmp$31 = value.substring(3, 5); + _tmp$32 = value.substring(5, 7); + _tmp$33 = value.substring(7); + sign = _tmp$29; + hour$1 = _tmp$30; + min$1 = _tmp$31; + seconds = _tmp$32; + value = _tmp$33; + } else { + if (value.length < 5) { + err = errBad; + break; + } + _tmp$34 = value.substring(0, 1); + _tmp$35 = value.substring(1, 3); + _tmp$36 = value.substring(3, 5); + _tmp$37 = "00"; + _tmp$38 = value.substring(5); + sign = _tmp$34; + hour$1 = _tmp$35; + min$1 = _tmp$36; + seconds = _tmp$37; + value = _tmp$38; + } + _tmp$39 = 0; + _tmp$40 = 0; + _tmp$41 = 0; + hr = _tmp$39; + mm = _tmp$40; + ss = _tmp$41; + _tuple$17 = atoi(hour$1); + hr = _tuple$17[0]; + err = _tuple$17[1]; + if ($interfaceIsEqual(err, $ifaceNil)) { + _tuple$18 = atoi(min$1); + mm = _tuple$18[0]; + err = _tuple$18[1]; + } + if ($interfaceIsEqual(err, $ifaceNil)) { + _tuple$19 = atoi(seconds); + ss = _tuple$19[0]; + err = _tuple$19[1]; + } + zoneOffset = ($imul(((($imul(hr, 60)) + mm >> 0)), 60)) + ss >> 0; + _6 = sign.charCodeAt(0); + if (_6 === (43)) { + } else if (_6 === (45)) { + zoneOffset = -zoneOffset; + } else { + err = errBad; + } + } else if (_3 === (21)) { + if (value.length >= 3 && value.substring(0, 3) === "UTC") { + z = $pkg.UTC; + value = value.substring(3); + break; + } + _tuple$20 = parseTimeZone(value); + n$1 = _tuple$20[0]; + ok = _tuple$20[1]; + if (!ok) { + err = errBad; + break; + } + _tmp$42 = value.substring(0, n$1); + _tmp$43 = value.substring(n$1); + zoneName = _tmp$42; + value = _tmp$43; + } else if (_3 === (32)) { + ndigit = 1 + ((std >> 16 >> 0)) >> 0; + if (value.length < ndigit) { + err = errBad; + break; + } + _tuple$21 = parseNanoseconds(value, ndigit); + nsec = _tuple$21[0]; + rangeErrString = _tuple$21[1]; + err = _tuple$21[2]; + value = value.substring(ndigit); + } else if (_3 === (33)) { + if (value.length < 2 || !((value.charCodeAt(0) === 46)) || value.charCodeAt(1) < 48 || 57 < value.charCodeAt(1)) { + break; + } + i = 0; + while (true) { + if (!(i < 9 && (i + 1 >> 0) < value.length && 48 <= value.charCodeAt((i + 1 >> 0)) && value.charCodeAt((i + 1 >> 0)) <= 57)) { break; } + i = i + (1) >> 0; + } + _tuple$22 = parseNanoseconds(value, 1 + i >> 0); + nsec = _tuple$22[0]; + rangeErrString = _tuple$22[1]; + err = _tuple$22[2]; + value = value.substring((1 + i >> 0)); + } + } + if (!(rangeErrString === "")) { + return [new Time.ptr(new $Int64(0, 0), 0, ptrType$1.nil), new ParseError.ptr(alayout, avalue, stdstr, value, ": " + rangeErrString + " out of range")]; + } + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [new Time.ptr(new $Int64(0, 0), 0, ptrType$1.nil), new ParseError.ptr(alayout, avalue, stdstr, value, "")]; + } + } + if (pmSet && hour < 12) { + hour = hour + (12) >> 0; + } else if (amSet && (hour === 12)) { + hour = 0; + } + if (day > daysIn((month >> 0), year)) { + return [new Time.ptr(new $Int64(0, 0), 0, ptrType$1.nil), new ParseError.ptr(alayout, avalue, "", value, ": day out of range")]; + } + /* */ if (!(z === ptrType$1.nil)) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!(z === ptrType$1.nil)) { */ case 1: + _r$1 = Date(year, (month >> 0), day, hour, min, sec, nsec, z); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return [_r$1, $ifaceNil]; + /* } */ case 2: + /* */ if (!((zoneOffset === -1))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!((zoneOffset === -1))) { */ case 5: + _r$2 = Date(year, (month >> 0), day, hour, min, sec, nsec, $pkg.UTC); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + t = $clone(_r$2, Time); + t.sec = (x = t.sec, x$1 = new $Int64(0, zoneOffset), new $Int64(x.$high - x$1.$high, x.$low - x$1.$low)); + _r$3 = local.lookup((x$2 = t.sec, new $Int64(x$2.$high + -15, x$2.$low + 2288912640))); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple$23 = _r$3; + name = _tuple$23[0]; + offset = _tuple$23[1]; + if ((offset === zoneOffset) && (zoneName === "" || name === zoneName)) { + t.loc = local; + return [t, $ifaceNil]; + } + t.loc = FixedZone(zoneName, zoneOffset); + return [t, $ifaceNil]; + /* } */ case 6: + /* */ if (!(zoneName === "")) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (!(zoneName === "")) { */ case 9: + _r$4 = Date(year, (month >> 0), day, hour, min, sec, nsec, $pkg.UTC); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + t$1 = $clone(_r$4, Time); + _r$5 = local.lookupName(zoneName, (x$3 = t$1.sec, new $Int64(x$3.$high + -15, x$3.$low + 2288912640))); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _tuple$24 = _r$5; + offset$1 = _tuple$24[0]; + ok$1 = _tuple$24[2]; + if (ok$1) { + t$1.sec = (x$4 = t$1.sec, x$5 = new $Int64(0, offset$1), new $Int64(x$4.$high - x$5.$high, x$4.$low - x$5.$low)); + t$1.loc = local; + return [t$1, $ifaceNil]; + } + if (zoneName.length > 3 && zoneName.substring(0, 3) === "GMT") { + _tuple$25 = atoi(zoneName.substring(3)); + offset$1 = _tuple$25[0]; + offset$1 = $imul(offset$1, (3600)); + } + t$1.loc = FixedZone(zoneName, offset$1); + return [t$1, $ifaceNil]; + /* } */ case 10: + _r$6 = Date(year, (month >> 0), day, hour, min, sec, nsec, defaultLocation); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + /* */ $s = 14; case 14: + return [_r$6, $ifaceNil]; + /* */ } return; } if ($f === undefined) { $f = { $blk: parse }; } $f.$ptr = $ptr; $f._3 = _3; $f._4 = _4; $f._5 = _5; $f._6 = _6; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $f._tmp$12 = _tmp$12; $f._tmp$13 = _tmp$13; $f._tmp$14 = _tmp$14; $f._tmp$15 = _tmp$15; $f._tmp$16 = _tmp$16; $f._tmp$17 = _tmp$17; $f._tmp$18 = _tmp$18; $f._tmp$19 = _tmp$19; $f._tmp$2 = _tmp$2; $f._tmp$20 = _tmp$20; $f._tmp$21 = _tmp$21; $f._tmp$22 = _tmp$22; $f._tmp$23 = _tmp$23; $f._tmp$24 = _tmp$24; $f._tmp$25 = _tmp$25; $f._tmp$26 = _tmp$26; $f._tmp$27 = _tmp$27; $f._tmp$28 = _tmp$28; $f._tmp$29 = _tmp$29; $f._tmp$3 = _tmp$3; $f._tmp$30 = _tmp$30; $f._tmp$31 = _tmp$31; $f._tmp$32 = _tmp$32; $f._tmp$33 = _tmp$33; $f._tmp$34 = _tmp$34; $f._tmp$35 = _tmp$35; $f._tmp$36 = _tmp$36; $f._tmp$37 = _tmp$37; $f._tmp$38 = _tmp$38; $f._tmp$39 = _tmp$39; $f._tmp$4 = _tmp$4; $f._tmp$40 = _tmp$40; $f._tmp$41 = _tmp$41; $f._tmp$42 = _tmp$42; $f._tmp$43 = _tmp$43; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple$1 = _tuple$1; $f._tuple$10 = _tuple$10; $f._tuple$11 = _tuple$11; $f._tuple$12 = _tuple$12; $f._tuple$13 = _tuple$13; $f._tuple$14 = _tuple$14; $f._tuple$15 = _tuple$15; $f._tuple$16 = _tuple$16; $f._tuple$17 = _tuple$17; $f._tuple$18 = _tuple$18; $f._tuple$19 = _tuple$19; $f._tuple$2 = _tuple$2; $f._tuple$20 = _tuple$20; $f._tuple$21 = _tuple$21; $f._tuple$22 = _tuple$22; $f._tuple$23 = _tuple$23; $f._tuple$24 = _tuple$24; $f._tuple$25 = _tuple$25; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f._tuple$8 = _tuple$8; $f._tuple$9 = _tuple$9; $f.alayout = alayout; $f.amSet = amSet; $f.avalue = avalue; $f.day = day; $f.defaultLocation = defaultLocation; $f.err = err; $f.hour = hour; $f.hour$1 = hour$1; $f.hr = hr; $f.i = i; $f.layout = layout; $f.local = local; $f.min = min; $f.min$1 = min$1; $f.mm = mm; $f.month = month; $f.n = n; $f.n$1 = n$1; $f.name = name; $f.ndigit = ndigit; $f.nsec = nsec; $f.offset = offset; $f.offset$1 = offset$1; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.pmSet = pmSet; $f.prefix = prefix; $f.rangeErrString = rangeErrString; $f.sec = sec; $f.seconds = seconds; $f.sign = sign; $f.ss = ss; $f.std = std; $f.stdstr = stdstr; $f.suffix = suffix; $f.t = t; $f.t$1 = t$1; $f.value = value; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.year = year; $f.z = z; $f.zoneName = zoneName; $f.zoneOffset = zoneOffset; $f.$s = $s; $f.$r = $r; return $f; + }; + parseTimeZone = function(value) { + var $ptr, _7, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c, length, nUpper, ok, value; + length = 0; + ok = false; + if (value.length < 3) { + _tmp = 0; + _tmp$1 = false; + length = _tmp; + ok = _tmp$1; + return [length, ok]; + } + if (value.length >= 4 && (value.substring(0, 4) === "ChST" || value.substring(0, 4) === "MeST")) { + _tmp$2 = 4; + _tmp$3 = true; + length = _tmp$2; + ok = _tmp$3; + return [length, ok]; + } + if (value.substring(0, 3) === "GMT") { + length = parseGMT(value); + _tmp$4 = length; + _tmp$5 = true; + length = _tmp$4; + ok = _tmp$5; + return [length, ok]; + } + nUpper = 0; + nUpper = 0; + while (true) { + if (!(nUpper < 6)) { break; } + if (nUpper >= value.length) { + break; + } + c = value.charCodeAt(nUpper); + if (c < 65 || 90 < c) { + break; + } + nUpper = nUpper + (1) >> 0; + } + _7 = nUpper; + if ((_7 === (0)) || (_7 === (1)) || (_7 === (2)) || (_7 === (6))) { + _tmp$6 = 0; + _tmp$7 = false; + length = _tmp$6; + ok = _tmp$7; + return [length, ok]; + } else if (_7 === (5)) { + if (value.charCodeAt(4) === 84) { + _tmp$8 = 5; + _tmp$9 = true; + length = _tmp$8; + ok = _tmp$9; + return [length, ok]; + } + } else if (_7 === (4)) { + if (value.charCodeAt(3) === 84) { + _tmp$10 = 4; + _tmp$11 = true; + length = _tmp$10; + ok = _tmp$11; + return [length, ok]; + } + } else if (_7 === (3)) { + _tmp$12 = 3; + _tmp$13 = true; + length = _tmp$12; + ok = _tmp$13; + return [length, ok]; + } + _tmp$14 = 0; + _tmp$15 = false; + length = _tmp$14; + ok = _tmp$15; + return [length, ok]; + }; + parseGMT = function(value) { + var $ptr, _tuple$1, err, rem, sign, value, x; + value = value.substring(3); + if (value.length === 0) { + return 3; + } + sign = value.charCodeAt(0); + if (!((sign === 45)) && !((sign === 43))) { + return 3; + } + _tuple$1 = leadingInt(value.substring(1)); + x = _tuple$1[0]; + rem = _tuple$1[1]; + err = _tuple$1[2]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return 3; + } + if (sign === 45) { + x = new $Int64(-x.$high, -x.$low); + } + if ((x.$high === 0 && x.$low === 0) || (x.$high < -1 || (x.$high === -1 && x.$low < 4294967282)) || (0 < x.$high || (0 === x.$high && 12 < x.$low))) { + return 3; + } + return (3 + value.length >> 0) - rem.length >> 0; + }; + parseNanoseconds = function(value, nbytes) { + var $ptr, _tuple$1, err, i, nbytes, ns, rangeErrString, scaleDigits, value; + ns = 0; + rangeErrString = ""; + err = $ifaceNil; + if (!((value.charCodeAt(0) === 46))) { + err = errBad; + return [ns, rangeErrString, err]; + } + _tuple$1 = atoi(value.substring(1, nbytes)); + ns = _tuple$1[0]; + err = _tuple$1[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [ns, rangeErrString, err]; + } + if (ns < 0 || 1000000000 <= ns) { + rangeErrString = "fractional second"; + return [ns, rangeErrString, err]; + } + scaleDigits = 10 - nbytes >> 0; + i = 0; + while (true) { + if (!(i < scaleDigits)) { break; } + ns = $imul(ns, (10)); + i = i + (1) >> 0; + } + return [ns, rangeErrString, err]; + }; + leadingInt = function(s) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, c, err, i, rem, s, x, x$1, x$2, x$3; + x = new $Int64(0, 0); + rem = ""; + err = $ifaceNil; + i = 0; + while (true) { + if (!(i < s.length)) { break; } + c = s.charCodeAt(i); + if (c < 48 || c > 57) { + break; + } + if ((x.$high > 214748364 || (x.$high === 214748364 && x.$low > 3435973836))) { + _tmp = new $Int64(0, 0); + _tmp$1 = ""; + _tmp$2 = errLeadingInt; + x = _tmp; + rem = _tmp$1; + err = _tmp$2; + return [x, rem, err]; + } + x = (x$1 = (x$2 = $mul64(x, new $Int64(0, 10)), x$3 = new $Int64(0, c), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)), new $Int64(x$1.$high - 0, x$1.$low - 48)); + if ((x.$high < 0 || (x.$high === 0 && x.$low < 0))) { + _tmp$3 = new $Int64(0, 0); + _tmp$4 = ""; + _tmp$5 = errLeadingInt; + x = _tmp$3; + rem = _tmp$4; + err = _tmp$5; + return [x, rem, err]; + } + i = i + (1) >> 0; + } + _tmp$6 = x; + _tmp$7 = s.substring(i); + _tmp$8 = $ifaceNil; + x = _tmp$6; + rem = _tmp$7; + err = _tmp$8; + return [x, rem, err]; + }; + ParseDuration = function(s) { + var $ptr, _entry, _tmp, _tmp$1, _tuple$1, _tuple$2, _tuple$3, c, c$1, d, err, f, i, n, neg, ok, orig, pl, pl$1, post, pre, s, scale, u, unit, v, x, x$1, x$2; + orig = s; + d = new $Int64(0, 0); + neg = false; + if (!(s === "")) { + c = s.charCodeAt(0); + if ((c === 45) || (c === 43)) { + neg = c === 45; + s = s.substring(1); + } + } + if (s === "0") { + return [new Duration(0, 0), $ifaceNil]; + } + if (s === "") { + return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; + } + while (true) { + if (!(!(s === ""))) { break; } + _tmp = new $Int64(0, 0); + _tmp$1 = new $Int64(0, 0); + v = _tmp; + f = _tmp$1; + scale = 1; + err = $ifaceNil; + if (!((s.charCodeAt(0) === 46) || 48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57)) { + return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; + } + pl = s.length; + _tuple$1 = leadingInt(s); + v = _tuple$1[0]; + s = _tuple$1[1]; + err = _tuple$1[2]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; + } + pre = !((pl === s.length)); + post = false; + if (!(s === "") && (s.charCodeAt(0) === 46)) { + s = s.substring(1); + pl$1 = s.length; + _tuple$2 = leadingInt(s); + f = _tuple$2[0]; + s = _tuple$2[1]; + err = _tuple$2[2]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; + } + n = pl$1 - s.length >> 0; + while (true) { + if (!(n > 0)) { break; } + scale = scale * (10); + n = n - (1) >> 0; + } + post = !((pl$1 === s.length)); + } + if (!pre && !post) { + return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; + } + i = 0; + while (true) { + if (!(i < s.length)) { break; } + c$1 = s.charCodeAt(i); + if ((c$1 === 46) || 48 <= c$1 && c$1 <= 57) { + break; + } + i = i + (1) >> 0; + } + if (i === 0) { + return [new Duration(0, 0), errors.New("time: missing unit in duration " + orig)]; + } + u = s.substring(0, i); + s = s.substring(i); + _tuple$3 = (_entry = unitMap[$String.keyFor(u)], _entry !== undefined ? [_entry.v, true] : [new $Int64(0, 0), false]); + unit = _tuple$3[0]; + ok = _tuple$3[1]; + if (!ok) { + return [new Duration(0, 0), errors.New("time: unknown unit " + u + " in duration " + orig)]; + } + if ((x = $div64(new $Int64(2147483647, 4294967295), unit, false), (v.$high > x.$high || (v.$high === x.$high && v.$low > x.$low)))) { + return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; + } + v = $mul64(v, (unit)); + if ((f.$high > 0 || (f.$high === 0 && f.$low > 0))) { + v = (x$1 = new $Int64(0, $flatten64(f) * ($flatten64(unit) / scale)), new $Int64(v.$high + x$1.$high, v.$low + x$1.$low)); + if ((v.$high < 0 || (v.$high === 0 && v.$low < 0))) { + return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; + } + } + d = (x$2 = v, new $Int64(d.$high + x$2.$high, d.$low + x$2.$low)); + if ((d.$high < 0 || (d.$high === 0 && d.$low < 0))) { + return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; + } + } + if (neg) { + d = new $Int64(-d.$high, -d.$low); + } + return [new Duration(d.$high, d.$low), $ifaceNil]; + }; + $pkg.ParseDuration = ParseDuration; + Time.ptr.prototype.After = function(u) { + var $ptr, t, u, x, x$1, x$2, x$3; + u = $clone(u, Time); + t = $clone(this, Time); + return (x = t.sec, x$1 = u.sec, (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low > x$1.$low))) || (x$2 = t.sec, x$3 = u.sec, (x$2.$high === x$3.$high && x$2.$low === x$3.$low)) && t.nsec > u.nsec; + }; + Time.prototype.After = function(u) { return this.$val.After(u); }; + Time.ptr.prototype.Before = function(u) { + var $ptr, t, u, x, x$1, x$2, x$3; + u = $clone(u, Time); + t = $clone(this, Time); + return (x = t.sec, x$1 = u.sec, (x.$high < x$1.$high || (x.$high === x$1.$high && x.$low < x$1.$low))) || (x$2 = t.sec, x$3 = u.sec, (x$2.$high === x$3.$high && x$2.$low === x$3.$low)) && t.nsec < u.nsec; + }; + Time.prototype.Before = function(u) { return this.$val.Before(u); }; + Time.ptr.prototype.Equal = function(u) { + var $ptr, t, u, x, x$1; + u = $clone(u, Time); + t = $clone(this, Time); + return (x = t.sec, x$1 = u.sec, (x.$high === x$1.$high && x.$low === x$1.$low)) && (t.nsec === u.nsec); + }; + Time.prototype.Equal = function(u) { return this.$val.Equal(u); }; + Month.prototype.String = function() { + var $ptr, m, x; + m = this.$val; + return (x = m - 1 >> 0, ((x < 0 || x >= months.length) ? $throwRuntimeError("index out of range") : months[x])); + }; + $ptrType(Month).prototype.String = function() { return new Month(this.$get()).String(); }; + Weekday.prototype.String = function() { + var $ptr, d; + d = this.$val; + return ((d < 0 || d >= days.length) ? $throwRuntimeError("index out of range") : days[d]); + }; + $ptrType(Weekday).prototype.String = function() { return new Weekday(this.$get()).String(); }; + Time.ptr.prototype.IsZero = function() { + var $ptr, t, x; + t = $clone(this, Time); + return (x = t.sec, (x.$high === 0 && x.$low === 0)) && (t.nsec === 0); + }; + Time.prototype.IsZero = function() { return this.$val.IsZero(); }; + Time.ptr.prototype.abs = function() { + var $ptr, _r$1, _r$2, _tuple$1, l, offset, sec, t, x, x$1, x$2, x$3, x$4, x$5, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple$1 = $f._tuple$1; l = $f.l; offset = $f.offset; sec = $f.sec; t = $f.t; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + l = t.loc; + /* */ if (l === ptrType$1.nil || l === localLoc) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (l === ptrType$1.nil || l === localLoc) { */ case 1: + _r$1 = l.get(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + l = _r$1; + /* } */ case 2: + sec = (x = t.sec, new $Int64(x.$high + -15, x.$low + 2288912640)); + /* */ if (!(l === utcLoc)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (!(l === utcLoc)) { */ case 4: + /* */ if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { */ case 6: + sec = (x$3 = new $Int64(0, l.cacheZone.offset), new $Int64(sec.$high + x$3.$high, sec.$low + x$3.$low)); + $s = 8; continue; + /* } else { */ case 7: + _r$2 = l.lookup(sec); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$1 = _r$2; + offset = _tuple$1[1]; + sec = (x$4 = new $Int64(0, offset), new $Int64(sec.$high + x$4.$high, sec.$low + x$4.$low)); + /* } */ case 8: + /* } */ case 5: + return (x$5 = new $Int64(sec.$high + 2147483646, sec.$low + 450480384), new $Uint64(x$5.$high, x$5.$low)); + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.abs }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple$1 = _tuple$1; $f.l = l; $f.offset = offset; $f.sec = sec; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.abs = function() { return this.$val.abs(); }; + Time.ptr.prototype.locabs = function() { + var $ptr, _r$1, _r$2, _tuple$1, abs, l, name, offset, sec, t, x, x$1, x$2, x$3, x$4, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple$1 = $f._tuple$1; abs = $f.abs; l = $f.l; name = $f.name; offset = $f.offset; sec = $f.sec; t = $f.t; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + name = ""; + offset = 0; + abs = new $Uint64(0, 0); + t = $clone(this, Time); + l = t.loc; + /* */ if (l === ptrType$1.nil || l === localLoc) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (l === ptrType$1.nil || l === localLoc) { */ case 1: + _r$1 = l.get(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + l = _r$1; + /* } */ case 2: + sec = (x = t.sec, new $Int64(x.$high + -15, x.$low + 2288912640)); + /* */ if (!(l === utcLoc)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (!(l === utcLoc)) { */ case 4: + /* */ if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { */ case 7: + name = l.cacheZone.name; + offset = l.cacheZone.offset; + $s = 9; continue; + /* } else { */ case 8: + _r$2 = l.lookup(sec); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$1 = _r$2; + name = _tuple$1[0]; + offset = _tuple$1[1]; + /* } */ case 9: + sec = (x$3 = new $Int64(0, offset), new $Int64(sec.$high + x$3.$high, sec.$low + x$3.$low)); + $s = 6; continue; + /* } else { */ case 5: + name = "UTC"; + /* } */ case 6: + abs = (x$4 = new $Int64(sec.$high + 2147483646, sec.$low + 450480384), new $Uint64(x$4.$high, x$4.$low)); + return [name, offset, abs]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.locabs }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple$1 = _tuple$1; $f.abs = abs; $f.l = l; $f.name = name; $f.offset = offset; $f.sec = sec; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.locabs = function() { return this.$val.locabs(); }; + Time.ptr.prototype.Date = function() { + var $ptr, _r$1, _tuple$1, day, month, t, year, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; day = $f.day; month = $f.month; t = $f.t; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + year = 0; + month = 0; + day = 0; + t = $clone(this, Time); + _r$1 = t.date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + year = _tuple$1[0]; + month = _tuple$1[1]; + day = _tuple$1[2]; + return [year, month, day]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Date }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.day = day; $f.month = month; $f.t = t; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.Date = function() { return this.$val.Date(); }; + Time.ptr.prototype.Year = function() { + var $ptr, _r$1, _tuple$1, t, year, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; t = $f.t; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.date(false); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + year = _tuple$1[0]; + return year; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Year }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.t = t; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.Year = function() { return this.$val.Year(); }; + Time.ptr.prototype.Month = function() { + var $ptr, _r$1, _tuple$1, month, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; month = $f.month; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + month = _tuple$1[1]; + return month; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Month }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.month = month; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.Month = function() { return this.$val.Month(); }; + Time.ptr.prototype.Day = function() { + var $ptr, _r$1, _tuple$1, day, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; day = $f.day; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + day = _tuple$1[2]; + return day; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Day }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.day = day; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.Day = function() { return this.$val.Day(); }; + Time.ptr.prototype.Weekday = function() { + var $ptr, _r$1, _r$2, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = absWeekday(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ $s = 3; case 3: + return _r$2; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Weekday }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.Weekday = function() { return this.$val.Weekday(); }; + absWeekday = function(abs) { + var $ptr, _q, abs, sec; + sec = $div64((new $Uint64(abs.$high + 0, abs.$low + 86400)), new $Uint64(0, 604800), true); + return ((_q = (sec.$low >> 0) / 86400, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0); + }; + Time.ptr.prototype.ISOWeek = function() { + var $ptr, _q, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple$1, day, dec31wday, jan1wday, month, t, wday, week, yday, year, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple$1 = $f._tuple$1; day = $f.day; dec31wday = $f.dec31wday; jan1wday = $f.jan1wday; month = $f.month; t = $f.t; wday = $f.wday; week = $f.week; yday = $f.yday; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + year = 0; + week = 0; + t = $clone(this, Time); + _r$1 = t.date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + year = _tuple$1[0]; + month = _tuple$1[1]; + day = _tuple$1[2]; + yday = _tuple$1[3]; + _r$3 = t.Weekday(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + wday = (_r$2 = ((_r$3 + 6 >> 0) >> 0) % 7, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")); + week = (_q = (((yday - wday >> 0) + 7 >> 0)) / 7, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + jan1wday = (_r$4 = (((wday - yday >> 0) + 371 >> 0)) % 7, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); + if (1 <= jan1wday && jan1wday <= 3) { + week = week + (1) >> 0; + } + if (week === 0) { + year = year - (1) >> 0; + week = 52; + if ((jan1wday === 4) || ((jan1wday === 5) && isLeap(year))) { + week = week + (1) >> 0; + } + } + if ((month === 12) && day >= 29 && wday < 3) { + dec31wday = (_r$5 = (((wday + 31 >> 0) - day >> 0)) % 7, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")); + if (0 <= dec31wday && dec31wday <= 2) { + year = year + (1) >> 0; + week = 1; + } + } + return [year, week]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.ISOWeek }; } $f.$ptr = $ptr; $f._q = _q; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple$1 = _tuple$1; $f.day = day; $f.dec31wday = dec31wday; $f.jan1wday = jan1wday; $f.month = month; $f.t = t; $f.wday = wday; $f.week = week; $f.yday = yday; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.ISOWeek = function() { return this.$val.ISOWeek(); }; + Time.ptr.prototype.Clock = function() { + var $ptr, _r$1, _r$2, _tuple$1, hour, min, sec, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple$1 = $f._tuple$1; hour = $f.hour; min = $f.min; sec = $f.sec; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + hour = 0; + min = 0; + sec = 0; + t = $clone(this, Time); + _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = absClock(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$1 = _r$2; + hour = _tuple$1[0]; + min = _tuple$1[1]; + sec = _tuple$1[2]; + /* */ $s = 3; case 3: + return [hour, min, sec]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Clock }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple$1 = _tuple$1; $f.hour = hour; $f.min = min; $f.sec = sec; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.Clock = function() { return this.$val.Clock(); }; + absClock = function(abs) { + var $ptr, _q, _q$1, abs, hour, min, sec; + hour = 0; + min = 0; + sec = 0; + sec = ($div64(abs, new $Uint64(0, 86400), true).$low >> 0); + hour = (_q = sec / 3600, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + sec = sec - (($imul(hour, 3600))) >> 0; + min = (_q$1 = sec / 60, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); + sec = sec - (($imul(min, 60))) >> 0; + return [hour, min, sec]; + }; + Time.ptr.prototype.Hour = function() { + var $ptr, _q, _r$1, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return (_q = ($div64(_r$1, new $Uint64(0, 86400), true).$low >> 0) / 3600, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Hour }; } $f.$ptr = $ptr; $f._q = _q; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.Hour = function() { return this.$val.Hour(); }; + Time.ptr.prototype.Minute = function() { + var $ptr, _q, _r$1, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return (_q = ($div64(_r$1, new $Uint64(0, 3600), true).$low >> 0) / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Minute }; } $f.$ptr = $ptr; $f._q = _q; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.Minute = function() { return this.$val.Minute(); }; + Time.ptr.prototype.Second = function() { + var $ptr, _r$1, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return ($div64(_r$1, new $Uint64(0, 60), true).$low >> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Second }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.Second = function() { return this.$val.Second(); }; + Time.ptr.prototype.Nanosecond = function() { + var $ptr, t; + t = $clone(this, Time); + return (t.nsec >> 0); + }; + Time.prototype.Nanosecond = function() { return this.$val.Nanosecond(); }; + Time.ptr.prototype.YearDay = function() { + var $ptr, _r$1, _tuple$1, t, yday, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; t = $f.t; yday = $f.yday; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.date(false); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + yday = _tuple$1[3]; + return yday + 1 >> 0; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.YearDay }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.t = t; $f.yday = yday; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.YearDay = function() { return this.$val.YearDay(); }; + Duration.prototype.String = function() { + var $ptr, _tuple$1, _tuple$2, buf, d, neg, prec, u, w; + d = this; + buf = arrayType$4.zero(); + w = 32; + u = new $Uint64(d.$high, d.$low); + neg = (d.$high < 0 || (d.$high === 0 && d.$low < 0)); + if (neg) { + u = new $Uint64(-u.$high, -u.$low); + } + if ((u.$high < 0 || (u.$high === 0 && u.$low < 1000000000))) { + prec = 0; + w = w - (1) >> 0; + ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 115); + w = w - (1) >> 0; + if ((u.$high === 0 && u.$low === 0)) { + return "0"; + } else if ((u.$high < 0 || (u.$high === 0 && u.$low < 1000))) { + prec = 0; + ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 110); + } else if ((u.$high < 0 || (u.$high === 0 && u.$low < 1000000))) { + prec = 3; + w = w - (1) >> 0; + $copyString($subslice(new sliceType$3(buf), w), "\xC2\xB5"); + } else { + prec = 6; + ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 109); + } + _tuple$1 = fmtFrac($subslice(new sliceType$3(buf), 0, w), u, prec); + w = _tuple$1[0]; + u = _tuple$1[1]; + w = fmtInt($subslice(new sliceType$3(buf), 0, w), u); + } else { + w = w - (1) >> 0; + ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 115); + _tuple$2 = fmtFrac($subslice(new sliceType$3(buf), 0, w), u, 9); + w = _tuple$2[0]; + u = _tuple$2[1]; + w = fmtInt($subslice(new sliceType$3(buf), 0, w), $div64(u, new $Uint64(0, 60), true)); + u = $div64(u, (new $Uint64(0, 60)), false); + if ((u.$high > 0 || (u.$high === 0 && u.$low > 0))) { + w = w - (1) >> 0; + ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 109); + w = fmtInt($subslice(new sliceType$3(buf), 0, w), $div64(u, new $Uint64(0, 60), true)); + u = $div64(u, (new $Uint64(0, 60)), false); + if ((u.$high > 0 || (u.$high === 0 && u.$low > 0))) { + w = w - (1) >> 0; + ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 104); + w = fmtInt($subslice(new sliceType$3(buf), 0, w), u); + } + } + } + if (neg) { + w = w - (1) >> 0; + ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 45); + } + return $bytesToString($subslice(new sliceType$3(buf), w)); + }; + $ptrType(Duration).prototype.String = function() { return this.$get().String(); }; + fmtFrac = function(buf, v, prec) { + var $ptr, _tmp, _tmp$1, buf, digit, i, nv, nw, prec, print, v, w; + nw = 0; + nv = new $Uint64(0, 0); + w = buf.$length; + print = false; + i = 0; + while (true) { + if (!(i < prec)) { break; } + digit = $div64(v, new $Uint64(0, 10), true); + print = print || !((digit.$high === 0 && digit.$low === 0)); + if (print) { + w = w - (1) >> 0; + ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = ((digit.$low << 24 >>> 24) + 48 << 24 >>> 24)); + } + v = $div64(v, (new $Uint64(0, 10)), false); + i = i + (1) >> 0; + } + if (print) { + w = w - (1) >> 0; + ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = 46); + } + _tmp = w; + _tmp$1 = v; + nw = _tmp; + nv = _tmp$1; + return [nw, nv]; + }; + fmtInt = function(buf, v) { + var $ptr, buf, v, w; + w = buf.$length; + if ((v.$high === 0 && v.$low === 0)) { + w = w - (1) >> 0; + ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = 48); + } else { + while (true) { + if (!((v.$high > 0 || (v.$high === 0 && v.$low > 0)))) { break; } + w = w - (1) >> 0; + ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = (($div64(v, new $Uint64(0, 10), true).$low << 24 >>> 24) + 48 << 24 >>> 24)); + v = $div64(v, (new $Uint64(0, 10)), false); + } + } + return w; + }; + Duration.prototype.Nanoseconds = function() { + var $ptr, d; + d = this; + return new $Int64(d.$high, d.$low); + }; + $ptrType(Duration).prototype.Nanoseconds = function() { return this.$get().Nanoseconds(); }; + Duration.prototype.Seconds = function() { + var $ptr, d, nsec, sec; + d = this; + sec = $div64(d, new Duration(0, 1000000000), false); + nsec = $div64(d, new Duration(0, 1000000000), true); + return $flatten64(sec) + $flatten64(nsec) * 1e-09; + }; + $ptrType(Duration).prototype.Seconds = function() { return this.$get().Seconds(); }; + Duration.prototype.Minutes = function() { + var $ptr, d, min, nsec; + d = this; + min = $div64(d, new Duration(13, 4165425152), false); + nsec = $div64(d, new Duration(13, 4165425152), true); + return $flatten64(min) + $flatten64(nsec) * 1.6666666666666667e-11; + }; + $ptrType(Duration).prototype.Minutes = function() { return this.$get().Minutes(); }; + Duration.prototype.Hours = function() { + var $ptr, d, hour, nsec; + d = this; + hour = $div64(d, new Duration(838, 817405952), false); + nsec = $div64(d, new Duration(838, 817405952), true); + return $flatten64(hour) + $flatten64(nsec) * 2.777777777777778e-13; + }; + $ptrType(Duration).prototype.Hours = function() { return this.$get().Hours(); }; + Time.ptr.prototype.Add = function(d) { + var $ptr, d, nsec, t, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; + t = $clone(this, Time); + t.sec = (x = t.sec, x$1 = (x$2 = $div64(d, new Duration(0, 1000000000), false), new $Int64(x$2.$high, x$2.$low)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); + nsec = t.nsec + ((x$3 = $div64(d, new Duration(0, 1000000000), true), x$3.$low + ((x$3.$high >> 31) * 4294967296)) >> 0) >> 0; + if (nsec >= 1000000000) { + t.sec = (x$4 = t.sec, x$5 = new $Int64(0, 1), new $Int64(x$4.$high + x$5.$high, x$4.$low + x$5.$low)); + nsec = nsec - (1000000000) >> 0; + } else if (nsec < 0) { + t.sec = (x$6 = t.sec, x$7 = new $Int64(0, 1), new $Int64(x$6.$high - x$7.$high, x$6.$low - x$7.$low)); + nsec = nsec + (1000000000) >> 0; + } + t.nsec = nsec; + return t; + }; + Time.prototype.Add = function(d) { return this.$val.Add(d); }; + Time.ptr.prototype.Sub = function(u) { + var $ptr, d, t, u, x, x$1, x$2, x$3, x$4; + u = $clone(u, Time); + t = $clone(this, Time); + d = (x = $mul64((x$1 = (x$2 = t.sec, x$3 = u.sec, new $Int64(x$2.$high - x$3.$high, x$2.$low - x$3.$low)), new Duration(x$1.$high, x$1.$low)), new Duration(0, 1000000000)), x$4 = new Duration(0, (t.nsec - u.nsec >> 0)), new Duration(x.$high + x$4.$high, x.$low + x$4.$low)); + if (u.Add(d).Equal(t)) { + return d; + } else if (t.Before(u)) { + return new Duration(-2147483648, 0); + } else { + return new Duration(2147483647, 4294967295); + } + }; + Time.prototype.Sub = function(u) { return this.$val.Sub(u); }; + Time.ptr.prototype.AddDate = function(years, months$1, days$1) { + var $ptr, _r$1, _r$2, _r$3, _tuple$1, _tuple$2, day, days$1, hour, min, month, months$1, sec, t, year, years, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; day = $f.day; days$1 = $f.days$1; hour = $f.hour; min = $f.min; month = $f.month; months$1 = $f.months$1; sec = $f.sec; t = $f.t; year = $f.year; years = $f.years; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.Date(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + year = _tuple$1[0]; + month = _tuple$1[1]; + day = _tuple$1[2]; + _r$2 = t.Clock(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$2 = _r$2; + hour = _tuple$2[0]; + min = _tuple$2[1]; + sec = _tuple$2[2]; + _r$3 = Date(year + years >> 0, month + (months$1 >> 0) >> 0, day + days$1 >> 0, hour, min, sec, (t.nsec >> 0), t.loc); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return _r$3; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.AddDate }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.day = day; $f.days$1 = days$1; $f.hour = hour; $f.min = min; $f.month = month; $f.months$1 = months$1; $f.sec = sec; $f.t = t; $f.year = year; $f.years = years; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.AddDate = function(years, months$1, days$1) { return this.$val.AddDate(years, months$1, days$1); }; + Time.ptr.prototype.date = function(full) { + var $ptr, _r$1, _r$2, _tuple$1, day, full, month, t, yday, year, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple$1 = $f._tuple$1; day = $f.day; full = $f.full; month = $f.month; t = $f.t; yday = $f.yday; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + year = 0; + month = 0; + day = 0; + yday = 0; + t = $clone(this, Time); + _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = absDate(_r$1, full); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$1 = _r$2; + year = _tuple$1[0]; + month = _tuple$1[1]; + day = _tuple$1[2]; + yday = _tuple$1[3]; + /* */ $s = 3; case 3: + return [year, month, day, yday]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.date }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple$1 = _tuple$1; $f.day = day; $f.full = full; $f.month = month; $f.t = t; $f.yday = yday; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.date = function(full) { return this.$val.date(full); }; + absDate = function(abs, full) { + var $ptr, _q, abs, begin, d, day, end, full, month, n, x, x$1, x$10, x$11, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, yday, year; + year = 0; + month = 0; + day = 0; + yday = 0; + d = $div64(abs, new $Uint64(0, 86400), false); + n = $div64(d, new $Uint64(0, 146097), false); + y = $mul64(new $Uint64(0, 400), n); + d = (x = $mul64(new $Uint64(0, 146097), n), new $Uint64(d.$high - x.$high, d.$low - x.$low)); + n = $div64(d, new $Uint64(0, 36524), false); + n = (x$1 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$1.$high, n.$low - x$1.$low)); + y = (x$2 = $mul64(new $Uint64(0, 100), n), new $Uint64(y.$high + x$2.$high, y.$low + x$2.$low)); + d = (x$3 = $mul64(new $Uint64(0, 36524), n), new $Uint64(d.$high - x$3.$high, d.$low - x$3.$low)); + n = $div64(d, new $Uint64(0, 1461), false); + y = (x$4 = $mul64(new $Uint64(0, 4), n), new $Uint64(y.$high + x$4.$high, y.$low + x$4.$low)); + d = (x$5 = $mul64(new $Uint64(0, 1461), n), new $Uint64(d.$high - x$5.$high, d.$low - x$5.$low)); + n = $div64(d, new $Uint64(0, 365), false); + n = (x$6 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$6.$high, n.$low - x$6.$low)); + y = (x$7 = n, new $Uint64(y.$high + x$7.$high, y.$low + x$7.$low)); + d = (x$8 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high - x$8.$high, d.$low - x$8.$low)); + year = ((x$9 = (x$10 = new $Int64(y.$high, y.$low), new $Int64(x$10.$high + -69, x$10.$low + 4075721025)), x$9.$low + ((x$9.$high >> 31) * 4294967296)) >> 0); + yday = (d.$low >> 0); + if (!full) { + return [year, month, day, yday]; + } + day = yday; + if (isLeap(year)) { + if (day > 59) { + day = day - (1) >> 0; + } else if ((day === 59)) { + month = 2; + day = 29; + return [year, month, day, yday]; + } + } + month = ((_q = day / 31, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0); + end = ((x$11 = month + 1 >> 0, ((x$11 < 0 || x$11 >= daysBefore.length) ? $throwRuntimeError("index out of range") : daysBefore[x$11])) >> 0); + begin = 0; + if (day >= end) { + month = month + (1) >> 0; + begin = end; + } else { + begin = (((month < 0 || month >= daysBefore.length) ? $throwRuntimeError("index out of range") : daysBefore[month]) >> 0); + } + month = month + (1) >> 0; + day = (day - begin >> 0) + 1 >> 0; + return [year, month, day, yday]; + }; + daysIn = function(m, year) { + var $ptr, m, x, year; + if ((m === 2) && isLeap(year)) { + return 29; + } + return ((((m < 0 || m >= daysBefore.length) ? $throwRuntimeError("index out of range") : daysBefore[m]) - (x = m - 1 >> 0, ((x < 0 || x >= daysBefore.length) ? $throwRuntimeError("index out of range") : daysBefore[x])) >> 0) >> 0); + }; + Time.ptr.prototype.UTC = function() { + var $ptr, t; + t = $clone(this, Time); + t.loc = $pkg.UTC; + return t; + }; + Time.prototype.UTC = function() { return this.$val.UTC(); }; + Time.ptr.prototype.Local = function() { + var $ptr, t; + t = $clone(this, Time); + t.loc = $pkg.Local; + return t; + }; + Time.prototype.Local = function() { return this.$val.Local(); }; + Time.ptr.prototype.In = function(loc) { + var $ptr, loc, t; + t = $clone(this, Time); + if (loc === ptrType$1.nil) { + $panic(new $String("time: missing Location in call to Time.In")); + } + t.loc = loc; + return t; + }; + Time.prototype.In = function(loc) { return this.$val.In(loc); }; + Time.ptr.prototype.Location = function() { + var $ptr, l, t; + t = $clone(this, Time); + l = t.loc; + if (l === ptrType$1.nil) { + l = $pkg.UTC; + } + return l; + }; + Time.prototype.Location = function() { return this.$val.Location(); }; + Time.ptr.prototype.Zone = function() { + var $ptr, _r$1, _tuple$1, name, offset, t, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; name = $f.name; offset = $f.offset; t = $f.t; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + name = ""; + offset = 0; + t = $clone(this, Time); + _r$1 = t.loc.lookup((x = t.sec, new $Int64(x.$high + -15, x.$low + 2288912640))); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + name = _tuple$1[0]; + offset = _tuple$1[1]; + return [name, offset]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Zone }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.name = name; $f.offset = offset; $f.t = t; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.Zone = function() { return this.$val.Zone(); }; + Time.ptr.prototype.Unix = function() { + var $ptr, t, x; + t = $clone(this, Time); + return (x = t.sec, new $Int64(x.$high + -15, x.$low + 2288912640)); + }; + Time.prototype.Unix = function() { return this.$val.Unix(); }; + Time.ptr.prototype.UnixNano = function() { + var $ptr, t, x, x$1, x$2; + t = $clone(this, Time); + return (x = $mul64(((x$1 = t.sec, new $Int64(x$1.$high + -15, x$1.$low + 2288912640))), new $Int64(0, 1000000000)), x$2 = new $Int64(0, t.nsec), new $Int64(x.$high + x$2.$high, x.$low + x$2.$low)); + }; + Time.prototype.UnixNano = function() { return this.$val.UnixNano(); }; + Time.ptr.prototype.MarshalBinary = function() { + var $ptr, _q, _r$1, _r$2, _tuple$1, enc, offset, offsetMin, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple$1 = $f._tuple$1; enc = $f.enc; offset = $f.offset; offsetMin = $f.offsetMin; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + offsetMin = 0; + /* */ if (t.Location() === utcLoc) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (t.Location() === utcLoc) { */ case 1: + offsetMin = -1; + $s = 3; continue; + /* } else { */ case 2: + _r$1 = t.Zone(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + offset = _tuple$1[1]; + if (!(((_r$2 = offset % 60, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0))) { + return [sliceType$3.nil, errors.New("Time.MarshalBinary: zone offset has fractional minute")]; + } + offset = (_q = offset / (60), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + if (offset < -32768 || (offset === -1) || offset > 32767) { + return [sliceType$3.nil, errors.New("Time.MarshalBinary: unexpected zone offset")]; + } + offsetMin = (offset << 16 >> 16); + /* } */ case 3: + enc = new sliceType$3([1, ($shiftRightInt64(t.sec, 56).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 48).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 40).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 32).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 24).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 16).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 8).$low << 24 >>> 24), (t.sec.$low << 24 >>> 24), ((t.nsec >> 24 >> 0) << 24 >>> 24), ((t.nsec >> 16 >> 0) << 24 >>> 24), ((t.nsec >> 8 >> 0) << 24 >>> 24), (t.nsec << 24 >>> 24), ((offsetMin >> 8 << 16 >> 16) << 24 >>> 24), (offsetMin << 24 >>> 24)]); + return [enc, $ifaceNil]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalBinary }; } $f.$ptr = $ptr; $f._q = _q; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple$1 = _tuple$1; $f.enc = enc; $f.offset = offset; $f.offsetMin = offsetMin; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.MarshalBinary = function() { return this.$val.MarshalBinary(); }; + Time.ptr.prototype.UnmarshalBinary = function(data$1) { + var $ptr, _r$1, _tuple$1, buf, data$1, localoff, offset, t, x, x$1, x$10, x$11, x$12, x$13, x$14, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; buf = $f.buf; data$1 = $f.data$1; localoff = $f.localoff; offset = $f.offset; t = $f.t; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$14 = $f.x$14; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = this; + buf = data$1; + if (buf.$length === 0) { + return errors.New("Time.UnmarshalBinary: no data"); + } + if (!(((0 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 0]) === 1))) { + return errors.New("Time.UnmarshalBinary: unsupported version"); + } + if (!((buf.$length === 15))) { + return errors.New("Time.UnmarshalBinary: invalid length"); + } + buf = $subslice(buf, 1); + t.sec = (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = new $Int64(0, (7 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 7])), x$7 = $shiftLeft64(new $Int64(0, (6 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 6])), 8), new $Int64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64(new $Int64(0, (5 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 5])), 16), new $Int64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64(new $Int64(0, (4 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 4])), 24), new $Int64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64(new $Int64(0, (3 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 3])), 32), new $Int64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64(new $Int64(0, (2 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 2])), 40), new $Int64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64(new $Int64(0, (1 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 1])), 48), new $Int64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64(new $Int64(0, (0 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 0])), 56), new $Int64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); + buf = $subslice(buf, 8); + t.nsec = ((((3 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 3]) >> 0) | (((2 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 2]) >> 0) << 8 >> 0)) | (((1 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 1]) >> 0) << 16 >> 0)) | (((0 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 0]) >> 0) << 24 >> 0); + buf = $subslice(buf, 4); + offset = $imul(((((1 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 1]) << 16 >> 16) | (((0 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 0]) << 16 >> 16) << 8 << 16 >> 16)) >> 0), 60); + /* */ if (offset === -60) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (offset === -60) { */ case 1: + t.loc = utcLoc; + $s = 3; continue; + /* } else { */ case 2: + _r$1 = $pkg.Local.lookup((x$14 = t.sec, new $Int64(x$14.$high + -15, x$14.$low + 2288912640))); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + localoff = _tuple$1[1]; + if (offset === localoff) { + t.loc = $pkg.Local; + } else { + t.loc = FixedZone("", offset); + } + /* } */ case 3: + return $ifaceNil; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalBinary }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.buf = buf; $f.data$1 = data$1; $f.localoff = localoff; $f.offset = offset; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$14 = x$14; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.UnmarshalBinary = function(data$1) { return this.$val.UnmarshalBinary(data$1); }; + Time.ptr.prototype.GobEncode = function() { + var $ptr, _r$1, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.MarshalBinary(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r$1; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.GobEncode }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.GobEncode = function() { return this.$val.GobEncode(); }; + Time.ptr.prototype.GobDecode = function(data$1) { + var $ptr, _r$1, data$1, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; data$1 = $f.data$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = this; + _r$1 = t.UnmarshalBinary(data$1); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r$1; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.GobDecode }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.data$1 = data$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.GobDecode = function(data$1) { return this.$val.GobDecode(data$1); }; + Time.ptr.prototype.MarshalJSON = function() { + var $ptr, _r$1, _r$2, b, t, y, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; b = $f.b; t = $f.t; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + y = _r$1; + if (y < 0 || y >= 10000) { + return [sliceType$3.nil, errors.New("Time.MarshalJSON: year outside of range [0,9999]")]; + } + b = $makeSlice(sliceType$3, 0, 37); + b = $append(b, 34); + _r$2 = t.AppendFormat(b, "2006-01-02T15:04:05.999999999Z07:00"); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + b = _r$2; + b = $append(b, 34); + return [b, $ifaceNil]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalJSON }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.b = b; $f.t = t; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.MarshalJSON = function() { return this.$val.MarshalJSON(); }; + Time.ptr.prototype.UnmarshalJSON = function(data$1) { + var $ptr, _r$1, _tuple$1, data$1, err, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; data$1 = $f.data$1; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + err = $ifaceNil; + t = this; + _r$1 = Parse("\"2006-01-02T15:04:05Z07:00\"", $bytesToString(data$1)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + Time.copy(t, _tuple$1[0]); + err = _tuple$1[1]; + return err; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalJSON }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.data$1 = data$1; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.UnmarshalJSON = function(data$1) { return this.$val.UnmarshalJSON(data$1); }; + Time.ptr.prototype.MarshalText = function() { + var $ptr, _r$1, _r$2, b, t, y, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; b = $f.b; t = $f.t; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + t = $clone(this, Time); + _r$1 = t.Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + y = _r$1; + if (y < 0 || y >= 10000) { + return [sliceType$3.nil, errors.New("Time.MarshalText: year outside of range [0,9999]")]; + } + b = $makeSlice(sliceType$3, 0, 35); + _r$2 = t.AppendFormat(b, "2006-01-02T15:04:05.999999999Z07:00"); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ $s = 3; case 3: + return [_r$2, $ifaceNil]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalText }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.b = b; $f.t = t; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.MarshalText = function() { return this.$val.MarshalText(); }; + Time.ptr.prototype.UnmarshalText = function(data$1) { + var $ptr, _r$1, _tuple$1, data$1, err, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; data$1 = $f.data$1; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + err = $ifaceNil; + t = this; + _r$1 = Parse("2006-01-02T15:04:05Z07:00", $bytesToString(data$1)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + Time.copy(t, _tuple$1[0]); + err = _tuple$1[1]; + return err; + /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalText }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.data$1 = data$1; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + Time.prototype.UnmarshalText = function(data$1) { return this.$val.UnmarshalText(data$1); }; + Unix = function(sec, nsec) { + var $ptr, n, nsec, sec, x, x$1, x$2, x$3; + if ((nsec.$high < 0 || (nsec.$high === 0 && nsec.$low < 0)) || (nsec.$high > 0 || (nsec.$high === 0 && nsec.$low >= 1000000000))) { + n = $div64(nsec, new $Int64(0, 1000000000), false); + sec = (x = n, new $Int64(sec.$high + x.$high, sec.$low + x.$low)); + nsec = (x$1 = $mul64(n, new $Int64(0, 1000000000)), new $Int64(nsec.$high - x$1.$high, nsec.$low - x$1.$low)); + if ((nsec.$high < 0 || (nsec.$high === 0 && nsec.$low < 0))) { + nsec = (x$2 = new $Int64(0, 1000000000), new $Int64(nsec.$high + x$2.$high, nsec.$low + x$2.$low)); + sec = (x$3 = new $Int64(0, 1), new $Int64(sec.$high - x$3.$high, sec.$low - x$3.$low)); + } + } + return new Time.ptr(new $Int64(sec.$high + 14, sec.$low + 2006054656), ((nsec.$low + ((nsec.$high >> 31) * 4294967296)) >> 0), $pkg.Local); + }; + $pkg.Unix = Unix; + isLeap = function(year) { + var $ptr, _r$1, _r$2, _r$3, year; + return ((_r$1 = year % 4, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0) && (!(((_r$2 = year % 100, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0)) || ((_r$3 = year % 400, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")) === 0)); + }; + norm = function(hi, lo, base) { + var $ptr, _q, _q$1, _tmp, _tmp$1, base, hi, lo, n, n$1, nhi, nlo; + nhi = 0; + nlo = 0; + if (lo < 0) { + n = (_q = ((-lo - 1 >> 0)) / base, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) + 1 >> 0; + hi = hi - (n) >> 0; + lo = lo + (($imul(n, base))) >> 0; + } + if (lo >= base) { + n$1 = (_q$1 = lo / base, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); + hi = hi + (n$1) >> 0; + lo = lo - (($imul(n$1, base))) >> 0; + } + _tmp = hi; + _tmp$1 = lo; + nhi = _tmp; + nlo = _tmp$1; + return [nhi, nlo]; + }; + Date = function(year, month, day, hour, min, sec, nsec, loc) { + var $ptr, _r$1, _r$2, _r$3, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, abs, d, day, end, hour, loc, m, min, month, n, nsec, offset, sec, start, unix, utc, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, year, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; _tuple$8 = $f._tuple$8; abs = $f.abs; d = $f.d; day = $f.day; end = $f.end; hour = $f.hour; loc = $f.loc; m = $f.m; min = $f.min; month = $f.month; n = $f.n; nsec = $f.nsec; offset = $f.offset; sec = $f.sec; start = $f.start; unix = $f.unix; utc = $f.utc; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$14 = $f.x$14; x$15 = $f.x$15; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; y = $f.y; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + if (loc === ptrType$1.nil) { + $panic(new $String("time: missing Location in call to Date")); + } + m = (month >> 0) - 1 >> 0; + _tuple$1 = norm(year, m, 12); + year = _tuple$1[0]; + m = _tuple$1[1]; + month = (m >> 0) + 1 >> 0; + _tuple$2 = norm(sec, nsec, 1000000000); + sec = _tuple$2[0]; + nsec = _tuple$2[1]; + _tuple$3 = norm(min, sec, 60); + min = _tuple$3[0]; + sec = _tuple$3[1]; + _tuple$4 = norm(hour, min, 60); + hour = _tuple$4[0]; + min = _tuple$4[1]; + _tuple$5 = norm(day, hour, 24); + day = _tuple$5[0]; + hour = _tuple$5[1]; + y = (x = (x$1 = new $Int64(0, year), new $Int64(x$1.$high - -69, x$1.$low - 4075721025)), new $Uint64(x.$high, x.$low)); + n = $div64(y, new $Uint64(0, 400), false); + y = (x$2 = $mul64(new $Uint64(0, 400), n), new $Uint64(y.$high - x$2.$high, y.$low - x$2.$low)); + d = $mul64(new $Uint64(0, 146097), n); + n = $div64(y, new $Uint64(0, 100), false); + y = (x$3 = $mul64(new $Uint64(0, 100), n), new $Uint64(y.$high - x$3.$high, y.$low - x$3.$low)); + d = (x$4 = $mul64(new $Uint64(0, 36524), n), new $Uint64(d.$high + x$4.$high, d.$low + x$4.$low)); + n = $div64(y, new $Uint64(0, 4), false); + y = (x$5 = $mul64(new $Uint64(0, 4), n), new $Uint64(y.$high - x$5.$high, y.$low - x$5.$low)); + d = (x$6 = $mul64(new $Uint64(0, 1461), n), new $Uint64(d.$high + x$6.$high, d.$low + x$6.$low)); + n = y; + d = (x$7 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high + x$7.$high, d.$low + x$7.$low)); + d = (x$8 = new $Uint64(0, (x$9 = month - 1 >> 0, ((x$9 < 0 || x$9 >= daysBefore.length) ? $throwRuntimeError("index out of range") : daysBefore[x$9]))), new $Uint64(d.$high + x$8.$high, d.$low + x$8.$low)); + if (isLeap(year) && month >= 3) { + d = (x$10 = new $Uint64(0, 1), new $Uint64(d.$high + x$10.$high, d.$low + x$10.$low)); + } + d = (x$11 = new $Uint64(0, (day - 1 >> 0)), new $Uint64(d.$high + x$11.$high, d.$low + x$11.$low)); + abs = $mul64(d, new $Uint64(0, 86400)); + abs = (x$12 = new $Uint64(0, ((($imul(hour, 3600)) + ($imul(min, 60)) >> 0) + sec >> 0)), new $Uint64(abs.$high + x$12.$high, abs.$low + x$12.$low)); + unix = (x$13 = new $Int64(abs.$high, abs.$low), new $Int64(x$13.$high + -2147483647, x$13.$low + 3844486912)); + _r$1 = loc.lookup(unix); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$6 = _r$1; + offset = _tuple$6[1]; + start = _tuple$6[3]; + end = _tuple$6[4]; + /* */ if (!((offset === 0))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!((offset === 0))) { */ case 2: + utc = (x$14 = new $Int64(0, offset), new $Int64(unix.$high - x$14.$high, unix.$low - x$14.$low)); + /* */ if ((utc.$high < start.$high || (utc.$high === start.$high && utc.$low < start.$low))) { $s = 5; continue; } + /* */ if ((utc.$high > end.$high || (utc.$high === end.$high && utc.$low >= end.$low))) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if ((utc.$high < start.$high || (utc.$high === start.$high && utc.$low < start.$low))) { */ case 5: + _r$2 = loc.lookup(new $Int64(start.$high - 0, start.$low - 1)); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$7 = _r$2; + offset = _tuple$7[1]; + $s = 7; continue; + /* } else if ((utc.$high > end.$high || (utc.$high === end.$high && utc.$low >= end.$low))) { */ case 6: + _r$3 = loc.lookup(end); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple$8 = _r$3; + offset = _tuple$8[1]; + /* } */ case 7: + case 4: + unix = (x$15 = new $Int64(0, offset), new $Int64(unix.$high - x$15.$high, unix.$low - x$15.$low)); + /* } */ case 3: + return new Time.ptr(new $Int64(unix.$high + 14, unix.$low + 2006054656), (nsec >> 0), loc); + /* */ } return; } if ($f === undefined) { $f = { $blk: Date }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f._tuple$8 = _tuple$8; $f.abs = abs; $f.d = d; $f.day = day; $f.end = end; $f.hour = hour; $f.loc = loc; $f.m = m; $f.min = min; $f.month = month; $f.n = n; $f.nsec = nsec; $f.offset = offset; $f.sec = sec; $f.start = start; $f.unix = unix; $f.utc = utc; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$14 = x$14; $f.x$15 = x$15; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.y = y; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Date = Date; + Time.ptr.prototype.Truncate = function(d) { + var $ptr, _tuple$1, d, r, t; + t = $clone(this, Time); + if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { + return t; + } + _tuple$1 = div(t, d); + r = _tuple$1[1]; + return t.Add(new Duration(-r.$high, -r.$low)); + }; + Time.prototype.Truncate = function(d) { return this.$val.Truncate(d); }; + Time.ptr.prototype.Round = function(d) { + var $ptr, _tuple$1, d, r, t, x; + t = $clone(this, Time); + if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { + return t; + } + _tuple$1 = div(t, d); + r = _tuple$1[1]; + if ((x = new Duration(r.$high + r.$high, r.$low + r.$low), (x.$high < d.$high || (x.$high === d.$high && x.$low < d.$low)))) { + return t.Add(new Duration(-r.$high, -r.$low)); + } + return t.Add(new Duration(d.$high - r.$high, d.$low - r.$low)); + }; + Time.prototype.Round = function(d) { return this.$val.Round(d); }; + div = function(t, d) { + var $ptr, _q, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, d, d0, d1, d1$1, neg, nsec, qmod2, r, sec, t, tmp, u0, u0x, u1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + qmod2 = 0; + r = new Duration(0, 0); + t = $clone(t, Time); + neg = false; + nsec = t.nsec; + if ((x = t.sec, (x.$high < 0 || (x.$high === 0 && x.$low < 0)))) { + neg = true; + t.sec = (x$1 = t.sec, new $Int64(-x$1.$high, -x$1.$low)); + nsec = -nsec; + if (nsec < 0) { + nsec = nsec + (1000000000) >> 0; + t.sec = (x$2 = t.sec, x$3 = new $Int64(0, 1), new $Int64(x$2.$high - x$3.$high, x$2.$low - x$3.$low)); + } + } + if ((d.$high < 0 || (d.$high === 0 && d.$low < 1000000000)) && (x$4 = $div64(new Duration(0, 1000000000), (new Duration(d.$high + d.$high, d.$low + d.$low)), true), (x$4.$high === 0 && x$4.$low === 0))) { + qmod2 = ((_q = nsec / ((d.$low + ((d.$high >> 31) * 4294967296)) >> 0), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) & 1; + r = new Duration(0, (_r$1 = nsec % ((d.$low + ((d.$high >> 31) * 4294967296)) >> 0), _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero"))); + } else if ((x$5 = $div64(d, new Duration(0, 1000000000), true), (x$5.$high === 0 && x$5.$low === 0))) { + d1 = (x$6 = $div64(d, new Duration(0, 1000000000), false), new $Int64(x$6.$high, x$6.$low)); + qmod2 = ((x$7 = $div64(t.sec, d1, false), x$7.$low + ((x$7.$high >> 31) * 4294967296)) >> 0) & 1; + r = (x$8 = $mul64((x$9 = $div64(t.sec, d1, true), new Duration(x$9.$high, x$9.$low)), new Duration(0, 1000000000)), x$10 = new Duration(0, nsec), new Duration(x$8.$high + x$10.$high, x$8.$low + x$10.$low)); + } else { + sec = (x$11 = t.sec, new $Uint64(x$11.$high, x$11.$low)); + tmp = $mul64(($shiftRightUint64(sec, 32)), new $Uint64(0, 1000000000)); + u1 = $shiftRightUint64(tmp, 32); + u0 = $shiftLeft64(tmp, 32); + tmp = $mul64(new $Uint64(sec.$high & 0, (sec.$low & 4294967295) >>> 0), new $Uint64(0, 1000000000)); + _tmp = u0; + _tmp$1 = new $Uint64(u0.$high + tmp.$high, u0.$low + tmp.$low); + u0x = _tmp; + u0 = _tmp$1; + if ((u0.$high < u0x.$high || (u0.$high === u0x.$high && u0.$low < u0x.$low))) { + u1 = (x$12 = new $Uint64(0, 1), new $Uint64(u1.$high + x$12.$high, u1.$low + x$12.$low)); + } + _tmp$2 = u0; + _tmp$3 = (x$13 = new $Uint64(0, nsec), new $Uint64(u0.$high + x$13.$high, u0.$low + x$13.$low)); + u0x = _tmp$2; + u0 = _tmp$3; + if ((u0.$high < u0x.$high || (u0.$high === u0x.$high && u0.$low < u0x.$low))) { + u1 = (x$14 = new $Uint64(0, 1), new $Uint64(u1.$high + x$14.$high, u1.$low + x$14.$low)); + } + d1$1 = new $Uint64(d.$high, d.$low); + while (true) { + if (!(!((x$15 = $shiftRightUint64(d1$1, 63), (x$15.$high === 0 && x$15.$low === 1))))) { break; } + d1$1 = $shiftLeft64(d1$1, (1)); + } + d0 = new $Uint64(0, 0); + while (true) { + qmod2 = 0; + if ((u1.$high > d1$1.$high || (u1.$high === d1$1.$high && u1.$low > d1$1.$low)) || (u1.$high === d1$1.$high && u1.$low === d1$1.$low) && (u0.$high > d0.$high || (u0.$high === d0.$high && u0.$low >= d0.$low))) { + qmod2 = 1; + _tmp$4 = u0; + _tmp$5 = new $Uint64(u0.$high - d0.$high, u0.$low - d0.$low); + u0x = _tmp$4; + u0 = _tmp$5; + if ((u0.$high > u0x.$high || (u0.$high === u0x.$high && u0.$low > u0x.$low))) { + u1 = (x$16 = new $Uint64(0, 1), new $Uint64(u1.$high - x$16.$high, u1.$low - x$16.$low)); + } + u1 = (x$17 = d1$1, new $Uint64(u1.$high - x$17.$high, u1.$low - x$17.$low)); + } + if ((d1$1.$high === 0 && d1$1.$low === 0) && (x$18 = new $Uint64(d.$high, d.$low), (d0.$high === x$18.$high && d0.$low === x$18.$low))) { + break; + } + d0 = $shiftRightUint64(d0, (1)); + d0 = (x$19 = $shiftLeft64((new $Uint64(d1$1.$high & 0, (d1$1.$low & 1) >>> 0)), 63), new $Uint64(d0.$high | x$19.$high, (d0.$low | x$19.$low) >>> 0)); + d1$1 = $shiftRightUint64(d1$1, (1)); + } + r = new Duration(u0.$high, u0.$low); + } + if (neg && !((r.$high === 0 && r.$low === 0))) { + qmod2 = (qmod2 ^ (1)) >> 0; + r = new Duration(d.$high - r.$high, d.$low - r.$low); + } + return [qmod2, r]; + }; + Location.ptr.prototype.get = function() { + var $ptr, l, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; l = $f.l; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + l = this; + if (l === ptrType$1.nil) { + return utcLoc; + } + /* */ if (l === localLoc) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (l === localLoc) { */ case 1: + $r = localOnce.Do(initLocal); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + return l; + /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.get }; } $f.$ptr = $ptr; $f.l = l; $f.$s = $s; $f.$r = $r; return $f; + }; + Location.prototype.get = function() { return this.$val.get(); }; + Location.ptr.prototype.String = function() { + var $ptr, _r$1, l, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; l = $f.l; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + l = this; + _r$1 = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r$1.name; + /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.String }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.l = l; $f.$s = $s; $f.$r = $r; return $f; + }; + Location.prototype.String = function() { return this.$val.String(); }; + FixedZone = function(name, offset) { + var $ptr, l, name, offset, x; + l = new Location.ptr(name, new sliceType([new zone.ptr(name, offset, false)]), new sliceType$1([new zoneTrans.ptr(new $Int64(-2147483648, 0), 0, false, false)]), new $Int64(-2147483648, 0), new $Int64(2147483647, 4294967295), ptrType.nil); + l.cacheZone = (x = l.zone, (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0])); + return l; + }; + $pkg.FixedZone = FixedZone; + Location.ptr.prototype.lookup = function(sec) { + var $ptr, _q, _r$1, end, hi, isDST, l, lim, lo, m, name, offset, sec, start, tx, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, zone$1, zone$2, zone$3, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r$1 = $f._r$1; end = $f.end; hi = $f.hi; isDST = $f.isDST; l = $f.l; lim = $f.lim; lo = $f.lo; m = $f.m; name = $f.name; offset = $f.offset; sec = $f.sec; start = $f.start; tx = $f.tx; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; zone$1 = $f.zone$1; zone$2 = $f.zone$2; zone$3 = $f.zone$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + name = ""; + offset = 0; + isDST = false; + start = new $Int64(0, 0); + end = new $Int64(0, 0); + l = this; + _r$1 = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + l = _r$1; + if (l.zone.$length === 0) { + name = "UTC"; + offset = 0; + isDST = false; + start = new $Int64(-2147483648, 0); + end = new $Int64(2147483647, 4294967295); + return [name, offset, isDST, start, end]; + } + zone$1 = l.cacheZone; + if (!(zone$1 === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { + name = zone$1.name; + offset = zone$1.offset; + isDST = zone$1.isDST; + start = l.cacheStart; + end = l.cacheEnd; + return [name, offset, isDST, start, end]; + } + if ((l.tx.$length === 0) || (x$2 = (x$3 = l.tx, (0 >= x$3.$length ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + 0])).when, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { + zone$2 = (x$4 = l.zone, x$5 = l.lookupFirstZone(), ((x$5 < 0 || x$5 >= x$4.$length) ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + x$5])); + name = zone$2.name; + offset = zone$2.offset; + isDST = zone$2.isDST; + start = new $Int64(-2147483648, 0); + if (l.tx.$length > 0) { + end = (x$6 = l.tx, (0 >= x$6.$length ? $throwRuntimeError("index out of range") : x$6.$array[x$6.$offset + 0])).when; + } else { + end = new $Int64(2147483647, 4294967295); + } + return [name, offset, isDST, start, end]; + } + tx = l.tx; + end = new $Int64(2147483647, 4294967295); + lo = 0; + hi = tx.$length; + while (true) { + if (!((hi - lo >> 0) > 1)) { break; } + m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; + lim = ((m < 0 || m >= tx.$length) ? $throwRuntimeError("index out of range") : tx.$array[tx.$offset + m]).when; + if ((sec.$high < lim.$high || (sec.$high === lim.$high && sec.$low < lim.$low))) { + end = lim; + hi = m; + } else { + lo = m; + } + } + zone$3 = (x$7 = l.zone, x$8 = ((lo < 0 || lo >= tx.$length) ? $throwRuntimeError("index out of range") : tx.$array[tx.$offset + lo]).index, ((x$8 < 0 || x$8 >= x$7.$length) ? $throwRuntimeError("index out of range") : x$7.$array[x$7.$offset + x$8])); + name = zone$3.name; + offset = zone$3.offset; + isDST = zone$3.isDST; + start = ((lo < 0 || lo >= tx.$length) ? $throwRuntimeError("index out of range") : tx.$array[tx.$offset + lo]).when; + return [name, offset, isDST, start, end]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.lookup }; } $f.$ptr = $ptr; $f._q = _q; $f._r$1 = _r$1; $f.end = end; $f.hi = hi; $f.isDST = isDST; $f.l = l; $f.lim = lim; $f.lo = lo; $f.m = m; $f.name = name; $f.offset = offset; $f.sec = sec; $f.start = start; $f.tx = tx; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.zone$3 = zone$3; $f.$s = $s; $f.$r = $r; return $f; + }; + Location.prototype.lookup = function(sec) { return this.$val.lookup(sec); }; + Location.ptr.prototype.lookupFirstZone = function() { + var $ptr, _i, _ref, l, x, x$1, x$2, x$3, x$4, x$5, zi, zi$1; + l = this; + if (!l.firstZoneUsed()) { + return 0; + } + if (l.tx.$length > 0 && (x = l.zone, x$1 = (x$2 = l.tx, (0 >= x$2.$length ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + 0])).index, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])).isDST) { + zi = ((x$3 = l.tx, (0 >= x$3.$length ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + 0])).index >> 0) - 1 >> 0; + while (true) { + if (!(zi >= 0)) { break; } + if (!(x$4 = l.zone, ((zi < 0 || zi >= x$4.$length) ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + zi])).isDST) { + return zi; + } + zi = zi - (1) >> 0; + } + } + _ref = l.zone; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + zi$1 = _i; + if (!(x$5 = l.zone, ((zi$1 < 0 || zi$1 >= x$5.$length) ? $throwRuntimeError("index out of range") : x$5.$array[x$5.$offset + zi$1])).isDST) { + return zi$1; + } + _i++; + } + return 0; + }; + Location.prototype.lookupFirstZone = function() { return this.$val.lookupFirstZone(); }; + Location.ptr.prototype.firstZoneUsed = function() { + var $ptr, _i, _ref, l, tx; + l = this; + _ref = l.tx; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + tx = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), zoneTrans); + if (tx.index === 0) { + return true; + } + _i++; + } + return false; + }; + Location.prototype.firstZoneUsed = function() { return this.$val.firstZoneUsed(); }; + Location.ptr.prototype.lookupName = function(name, unix) { + var $ptr, _i, _i$1, _r$1, _r$2, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple$1, i, i$1, isDST, isDST$1, l, nam, name, offset, offset$1, ok, unix, x, x$1, x$2, zone$1, zone$2, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _i$1 = $f._i$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple$1 = $f._tuple$1; i = $f.i; i$1 = $f.i$1; isDST = $f.isDST; isDST$1 = $f.isDST$1; l = $f.l; nam = $f.nam; name = $f.name; offset = $f.offset; offset$1 = $f.offset$1; ok = $f.ok; unix = $f.unix; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; zone$1 = $f.zone$1; zone$2 = $f.zone$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + offset = 0; + isDST = false; + ok = false; + l = this; + _r$1 = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + l = _r$1; + _ref = l.zone; + _i = 0; + /* while (true) { */ case 2: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } + i = _i; + zone$1 = (x = l.zone, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); + /* */ if (zone$1.name === name) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (zone$1.name === name) { */ case 4: + _r$2 = l.lookup((x$1 = new $Int64(0, zone$1.offset), new $Int64(unix.$high - x$1.$high, unix.$low - x$1.$low))); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$1 = _r$2; + nam = _tuple$1[0]; + offset$1 = _tuple$1[1]; + isDST$1 = _tuple$1[2]; + if (nam === zone$1.name) { + _tmp = offset$1; + _tmp$1 = isDST$1; + _tmp$2 = true; + offset = _tmp; + isDST = _tmp$1; + ok = _tmp$2; + return [offset, isDST, ok]; + } + /* } */ case 5: + _i++; + /* } */ $s = 2; continue; case 3: + _ref$1 = l.zone; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$1 = _i$1; + zone$2 = (x$2 = l.zone, ((i$1 < 0 || i$1 >= x$2.$length) ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + i$1])); + if (zone$2.name === name) { + _tmp$3 = zone$2.offset; + _tmp$4 = zone$2.isDST; + _tmp$5 = true; + offset = _tmp$3; + isDST = _tmp$4; + ok = _tmp$5; + return [offset, isDST, ok]; + } + _i$1++; + } + return [offset, isDST, ok]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.lookupName }; } $f.$ptr = $ptr; $f._i = _i; $f._i$1 = _i$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple$1 = _tuple$1; $f.i = i; $f.i$1 = i$1; $f.isDST = isDST; $f.isDST$1 = isDST$1; $f.l = l; $f.nam = nam; $f.name = name; $f.offset = offset; $f.offset$1 = offset$1; $f.ok = ok; $f.unix = unix; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.$s = $s; $f.$r = $r; return $f; + }; + Location.prototype.lookupName = function(name, unix) { return this.$val.lookupName(name, unix); }; + ptrType$3.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + Time.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Format", name: "Format", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "AppendFormat", name: "AppendFormat", pkg: "", typ: $funcType([sliceType$3, $String], [sliceType$3], false)}, {prop: "After", name: "After", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "Before", name: "Before", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "IsZero", name: "IsZero", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "abs", name: "abs", pkg: "time", typ: $funcType([], [$Uint64], false)}, {prop: "locabs", name: "locabs", pkg: "time", typ: $funcType([], [$String, $Int, $Uint64], false)}, {prop: "Date", name: "Date", pkg: "", typ: $funcType([], [$Int, Month, $Int], false)}, {prop: "Year", name: "Year", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Month", name: "Month", pkg: "", typ: $funcType([], [Month], false)}, {prop: "Day", name: "Day", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Weekday", name: "Weekday", pkg: "", typ: $funcType([], [Weekday], false)}, {prop: "ISOWeek", name: "ISOWeek", pkg: "", typ: $funcType([], [$Int, $Int], false)}, {prop: "Clock", name: "Clock", pkg: "", typ: $funcType([], [$Int, $Int, $Int], false)}, {prop: "Hour", name: "Hour", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Minute", name: "Minute", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Second", name: "Second", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Nanosecond", name: "Nanosecond", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "YearDay", name: "YearDay", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "Sub", name: "Sub", pkg: "", typ: $funcType([Time], [Duration], false)}, {prop: "AddDate", name: "AddDate", pkg: "", typ: $funcType([$Int, $Int, $Int], [Time], false)}, {prop: "date", name: "date", pkg: "time", typ: $funcType([$Bool], [$Int, Month, $Int, $Int], false)}, {prop: "UTC", name: "UTC", pkg: "", typ: $funcType([], [Time], false)}, {prop: "Local", name: "Local", pkg: "", typ: $funcType([], [Time], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([ptrType$1], [Time], false)}, {prop: "Location", name: "Location", pkg: "", typ: $funcType([], [ptrType$1], false)}, {prop: "Zone", name: "Zone", pkg: "", typ: $funcType([], [$String, $Int], false)}, {prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "UnixNano", name: "UnixNano", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "GobEncode", name: "GobEncode", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "MarshalJSON", name: "MarshalJSON", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([Duration], [Time], false)}]; + ptrType$6.methods = [{prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "GobDecode", name: "GobDecode", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "UnmarshalJSON", name: "UnmarshalJSON", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "UnmarshalText", name: "UnmarshalText", pkg: "", typ: $funcType([sliceType$3], [$error], false)}]; + Month.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + Weekday.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + Duration.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Nanoseconds", name: "Nanoseconds", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seconds", name: "Seconds", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Minutes", name: "Minutes", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Hours", name: "Hours", pkg: "", typ: $funcType([], [$Float64], false)}]; + ptrType$1.methods = [{prop: "get", name: "get", pkg: "time", typ: $funcType([], [ptrType$1], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "lookup", name: "lookup", pkg: "time", typ: $funcType([$Int64], [$String, $Int, $Bool, $Int64, $Int64], false)}, {prop: "lookupFirstZone", name: "lookupFirstZone", pkg: "time", typ: $funcType([], [$Int], false)}, {prop: "firstZoneUsed", name: "firstZoneUsed", pkg: "time", typ: $funcType([], [$Bool], false)}, {prop: "lookupName", name: "lookupName", pkg: "time", typ: $funcType([$String, $Int64], [$Int, $Bool, $Bool], false)}]; + ParseError.init([{prop: "Layout", name: "Layout", pkg: "", typ: $String, tag: ""}, {prop: "Value", name: "Value", pkg: "", typ: $String, tag: ""}, {prop: "LayoutElem", name: "LayoutElem", pkg: "", typ: $String, tag: ""}, {prop: "ValueElem", name: "ValueElem", pkg: "", typ: $String, tag: ""}, {prop: "Message", name: "Message", pkg: "", typ: $String, tag: ""}]); + Time.init([{prop: "sec", name: "sec", pkg: "time", typ: $Int64, tag: ""}, {prop: "nsec", name: "nsec", pkg: "time", typ: $Int32, tag: ""}, {prop: "loc", name: "loc", pkg: "time", typ: ptrType$1, tag: ""}]); + Location.init([{prop: "name", name: "name", pkg: "time", typ: $String, tag: ""}, {prop: "zone", name: "zone", pkg: "time", typ: sliceType, tag: ""}, {prop: "tx", name: "tx", pkg: "time", typ: sliceType$1, tag: ""}, {prop: "cacheStart", name: "cacheStart", pkg: "time", typ: $Int64, tag: ""}, {prop: "cacheEnd", name: "cacheEnd", pkg: "time", typ: $Int64, tag: ""}, {prop: "cacheZone", name: "cacheZone", pkg: "time", typ: ptrType, tag: ""}]); + zone.init([{prop: "name", name: "name", pkg: "time", typ: $String, tag: ""}, {prop: "offset", name: "offset", pkg: "time", typ: $Int, tag: ""}, {prop: "isDST", name: "isDST", pkg: "time", typ: $Bool, tag: ""}]); + zoneTrans.init([{prop: "when", name: "when", pkg: "time", typ: $Int64, tag: ""}, {prop: "index", name: "index", pkg: "time", typ: $Uint8, tag: ""}, {prop: "isstd", name: "isstd", pkg: "time", typ: $Bool, tag: ""}, {prop: "isutc", name: "isutc", pkg: "time", typ: $Bool, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = nosync.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strings.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = syscall.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + localLoc = new Location.ptr("", sliceType.nil, sliceType$1.nil, new $Int64(0, 0), new $Int64(0, 0), ptrType.nil); + localOnce = new nosync.Once.ptr(false, false); + std0x = $toNativeArray($kindInt, [260, 265, 524, 526, 528, 274]); + longDayNames = new sliceType$2(["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]); + shortDayNames = new sliceType$2(["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]); + shortMonthNames = new sliceType$2(["---", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]); + longMonthNames = new sliceType$2(["---", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]); + atoiError = errors.New("time: invalid number"); + errBad = errors.New("bad value for field"); + errLeadingInt = errors.New("time: bad [0-9]*"); + months = $toNativeArray($kindString, ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]); + days = $toNativeArray($kindString, ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]); + unitMap = $makeMap($String.keyFor, [{ k: "ns", v: new $Int64(0, 1) }, { k: "us", v: new $Int64(0, 1000) }, { k: "\xC2\xB5s", v: new $Int64(0, 1000) }, { k: "\xCE\xBCs", v: new $Int64(0, 1000) }, { k: "ms", v: new $Int64(0, 1000000) }, { k: "s", v: new $Int64(0, 1000000000) }, { k: "m", v: new $Int64(13, 4165425152) }, { k: "h", v: new $Int64(838, 817405952) }]); + daysBefore = $toNativeArray($kindInt32, [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]); + utcLoc = new Location.ptr("UTC", sliceType.nil, sliceType$1.nil, new $Int64(0, 0), new $Int64(0, 0), ptrType.nil); + $pkg.UTC = utcLoc; + $pkg.Local = localLoc; + _r = syscall.Getenv("ZONEINFO"); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + zoneinfo = _tuple[0]; + badData = errors.New("malformed time zone information"); + zoneDirs = new sliceType$2(["/usr/share/zoneinfo/", "/usr/share/lib/zoneinfo/", "/usr/lib/locale/TZ/", runtime.GOROOT() + "/lib/time/zoneinfo.zip"]); + init(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["os"] = (function() { + var $pkg = {}, $init, errors, js, io, runtime, sync, atomic, syscall, time, PathError, SyscallError, LinkError, File, file, dirInfo, FileInfo, FileMode, fileStat, sliceType, ptrType, sliceType$1, sliceType$2, ptrType$1, ptrType$2, ptrType$3, ptrType$4, ptrType$12, funcType$1, ptrType$13, arrayType$1, arrayType$5, ptrType$15, errFinished, lstat, runtime_args, init, runtime_beforeExit, NewSyscallError, IsNotExist, isNotExist, fixCount, sigpipe, syscallMode, NewFile, epipecheck, Lstat, basename, init$1, Exit, fillFileStatFromSys, timespecToTime; + errors = $packages["errors"]; + js = $packages["github.com/gopherjs/gopherjs/js"]; + io = $packages["io"]; + runtime = $packages["runtime"]; + sync = $packages["sync"]; + atomic = $packages["sync/atomic"]; + syscall = $packages["syscall"]; + time = $packages["time"]; + PathError = $pkg.PathError = $newType(0, $kindStruct, "os.PathError", "PathError", "os", function(Op_, Path_, Err_) { + this.$val = this; + if (arguments.length === 0) { + this.Op = ""; + this.Path = ""; + this.Err = $ifaceNil; + return; + } + this.Op = Op_; + this.Path = Path_; + this.Err = Err_; + }); + SyscallError = $pkg.SyscallError = $newType(0, $kindStruct, "os.SyscallError", "SyscallError", "os", function(Syscall_, Err_) { + this.$val = this; + if (arguments.length === 0) { + this.Syscall = ""; + this.Err = $ifaceNil; + return; + } + this.Syscall = Syscall_; + this.Err = Err_; + }); + LinkError = $pkg.LinkError = $newType(0, $kindStruct, "os.LinkError", "LinkError", "os", function(Op_, Old_, New_, Err_) { + this.$val = this; + if (arguments.length === 0) { + this.Op = ""; + this.Old = ""; + this.New = ""; + this.Err = $ifaceNil; + return; + } + this.Op = Op_; + this.Old = Old_; + this.New = New_; + this.Err = Err_; + }); + File = $pkg.File = $newType(0, $kindStruct, "os.File", "File", "os", function(file_) { + this.$val = this; + if (arguments.length === 0) { + this.file = ptrType$12.nil; + return; + } + this.file = file_; + }); + file = $pkg.file = $newType(0, $kindStruct, "os.file", "file", "os", function(fd_, name_, dirinfo_) { + this.$val = this; + if (arguments.length === 0) { + this.fd = 0; + this.name = ""; + this.dirinfo = ptrType.nil; + return; + } + this.fd = fd_; + this.name = name_; + this.dirinfo = dirinfo_; + }); + dirInfo = $pkg.dirInfo = $newType(0, $kindStruct, "os.dirInfo", "dirInfo", "os", function(buf_, nbuf_, bufp_) { + this.$val = this; + if (arguments.length === 0) { + this.buf = sliceType$1.nil; + this.nbuf = 0; + this.bufp = 0; + return; + } + this.buf = buf_; + this.nbuf = nbuf_; + this.bufp = bufp_; + }); + FileInfo = $pkg.FileInfo = $newType(8, $kindInterface, "os.FileInfo", "FileInfo", "os", null); + FileMode = $pkg.FileMode = $newType(4, $kindUint32, "os.FileMode", "FileMode", "os", null); + fileStat = $pkg.fileStat = $newType(0, $kindStruct, "os.fileStat", "fileStat", "os", function(name_, size_, mode_, modTime_, sys_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ""; + this.size = new $Int64(0, 0); + this.mode = 0; + this.modTime = new time.Time.ptr(new $Int64(0, 0), 0, ptrType$13.nil); + this.sys = new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero()); + return; + } + this.name = name_; + this.size = size_; + this.mode = mode_; + this.modTime = modTime_; + this.sys = sys_; + }); + sliceType = $sliceType($String); + ptrType = $ptrType(dirInfo); + sliceType$1 = $sliceType($Uint8); + sliceType$2 = $sliceType(FileInfo); + ptrType$1 = $ptrType(File); + ptrType$2 = $ptrType(PathError); + ptrType$3 = $ptrType(LinkError); + ptrType$4 = $ptrType(SyscallError); + ptrType$12 = $ptrType(file); + funcType$1 = $funcType([ptrType$12], [$error], false); + ptrType$13 = $ptrType(time.Location); + arrayType$1 = $arrayType($Int64, 3); + arrayType$5 = $arrayType($Uint8, 32); + ptrType$15 = $ptrType(fileStat); + runtime_args = function() { + var $ptr; + return $pkg.Args; + }; + init = function() { + var $ptr, argv, i, process; + process = $global.process; + if (!(process === undefined)) { + argv = process.argv; + $pkg.Args = $makeSlice(sliceType, ($parseInt(argv.length) - 1 >> 0)); + i = 0; + while (true) { + if (!(i < ($parseInt(argv.length) - 1 >> 0))) { break; } + ((i < 0 || i >= $pkg.Args.$length) ? $throwRuntimeError("index out of range") : $pkg.Args.$array[$pkg.Args.$offset + i] = $internalize(argv[(i + 1 >> 0)], $String)); + i = i + (1) >> 0; + } + } + if ($pkg.Args.$length === 0) { + $pkg.Args = new sliceType(["?"]); + } + }; + runtime_beforeExit = function() { + var $ptr; + }; + File.ptr.prototype.readdirnames = function(n) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, _tuple$2, d, err, errno, f, n, names, nb, nc, size; + names = sliceType.nil; + err = $ifaceNil; + f = this; + if (f.file.dirinfo === ptrType.nil) { + f.file.dirinfo = new dirInfo.ptr(sliceType$1.nil, 0, 0); + f.file.dirinfo.buf = $makeSlice(sliceType$1, 4096); + } + d = f.file.dirinfo; + size = n; + if (size <= 0) { + size = 100; + n = -1; + } + names = $makeSlice(sliceType, 0, size); + while (true) { + if (!(!((n === 0)))) { break; } + if (d.bufp >= d.nbuf) { + d.bufp = 0; + errno = $ifaceNil; + _tuple$1 = syscall.ReadDirent(f.file.fd, d.buf); + _tuple = fixCount(_tuple$1[0], _tuple$1[1]); + d.nbuf = _tuple[0]; + errno = _tuple[1]; + if (!($interfaceIsEqual(errno, $ifaceNil))) { + _tmp = names; + _tmp$1 = NewSyscallError("readdirent", errno); + names = _tmp; + err = _tmp$1; + return [names, err]; + } + if (d.nbuf <= 0) { + break; + } + } + _tmp$2 = 0; + _tmp$3 = 0; + nb = _tmp$2; + nc = _tmp$3; + _tuple$2 = syscall.ParseDirent($subslice(d.buf, d.bufp, d.nbuf), n, names); + nb = _tuple$2[0]; + nc = _tuple$2[1]; + names = _tuple$2[2]; + d.bufp = d.bufp + (nb) >> 0; + n = n - (nc) >> 0; + } + if (n >= 0 && (names.$length === 0)) { + _tmp$4 = names; + _tmp$5 = io.EOF; + names = _tmp$4; + err = _tmp$5; + return [names, err]; + } + _tmp$6 = names; + _tmp$7 = $ifaceNil; + names = _tmp$6; + err = _tmp$7; + return [names, err]; + }; + File.prototype.readdirnames = function(n) { return this.$val.readdirnames(n); }; + File.ptr.prototype.Readdir = function(n) { + var $ptr, _r, _tmp, _tmp$1, _tuple, err, f, fi, n, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; f = $f.f; fi = $f.fi; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + fi = sliceType$2.nil; + err = $ifaceNil; + f = this; + if (f === ptrType$1.nil) { + _tmp = sliceType$2.nil; + _tmp$1 = $pkg.ErrInvalid; + fi = _tmp; + err = _tmp$1; + return [fi, err]; + } + _r = f.readdir(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + fi = _tuple[0]; + err = _tuple[1]; + /* */ $s = 2; case 2: + return [fi, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Readdir }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.fi = fi; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; + }; + File.prototype.Readdir = function(n) { return this.$val.Readdir(n); }; + File.ptr.prototype.Readdirnames = function(n) { + var $ptr, _tmp, _tmp$1, _tuple, err, f, n, names; + names = sliceType.nil; + err = $ifaceNil; + f = this; + if (f === ptrType$1.nil) { + _tmp = sliceType.nil; + _tmp$1 = $pkg.ErrInvalid; + names = _tmp; + err = _tmp$1; + return [names, err]; + } + _tuple = f.readdirnames(n); + names = _tuple[0]; + err = _tuple[1]; + return [names, err]; + }; + File.prototype.Readdirnames = function(n) { return this.$val.Readdirnames(n); }; + PathError.ptr.prototype.Error = function() { + var $ptr, _r, e, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + e = this; + _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return e.Op + " " + e.Path + ": " + _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: PathError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; + }; + PathError.prototype.Error = function() { return this.$val.Error(); }; + SyscallError.ptr.prototype.Error = function() { + var $ptr, _r, e, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + e = this; + _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return e.Syscall + ": " + _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: SyscallError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; + }; + SyscallError.prototype.Error = function() { return this.$val.Error(); }; + NewSyscallError = function(syscall$1, err) { + var $ptr, err, syscall$1; + if ($interfaceIsEqual(err, $ifaceNil)) { + return $ifaceNil; + } + return new SyscallError.ptr(syscall$1, err); + }; + $pkg.NewSyscallError = NewSyscallError; + IsNotExist = function(err) { + var $ptr, err; + return isNotExist(err); + }; + $pkg.IsNotExist = IsNotExist; + isNotExist = function(err) { + var $ptr, _ref, err, pe, pe$1, pe$2, pe$3; + _ref = err; + if (_ref === $ifaceNil) { + pe = _ref; + return false; + } else if ($assertType(_ref, ptrType$2, true)[1]) { + pe$1 = _ref.$val; + err = pe$1.Err; + } else if ($assertType(_ref, ptrType$3, true)[1]) { + pe$2 = _ref.$val; + err = pe$2.Err; + } else if ($assertType(_ref, ptrType$4, true)[1]) { + pe$3 = _ref.$val; + err = pe$3.Err; + } + return $interfaceIsEqual(err, new syscall.Errno(2)) || $interfaceIsEqual(err, $pkg.ErrNotExist); + }; + File.ptr.prototype.Name = function() { + var $ptr, f; + f = this; + return f.file.name; + }; + File.prototype.Name = function() { return this.$val.Name(); }; + LinkError.ptr.prototype.Error = function() { + var $ptr, _r, e, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + e = this; + _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return e.Op + " " + e.Old + " " + e.New + ": " + _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: LinkError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; + }; + LinkError.prototype.Error = function() { return this.$val.Error(); }; + File.ptr.prototype.Read = function(b) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, b, e, err, f, n; + n = 0; + err = $ifaceNil; + f = this; + if (f === ptrType$1.nil) { + _tmp = 0; + _tmp$1 = $pkg.ErrInvalid; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + _tuple = f.read(b); + n = _tuple[0]; + e = _tuple[1]; + if ((n === 0) && b.$length > 0 && $interfaceIsEqual(e, $ifaceNil)) { + _tmp$2 = 0; + _tmp$3 = io.EOF; + n = _tmp$2; + err = _tmp$3; + return [n, err]; + } + if (!($interfaceIsEqual(e, $ifaceNil))) { + err = new PathError.ptr("read", f.file.name, e); + } + _tmp$4 = n; + _tmp$5 = err; + n = _tmp$4; + err = _tmp$5; + return [n, err]; + }; + File.prototype.Read = function(b) { return this.$val.Read(b); }; + File.ptr.prototype.ReadAt = function(b, off) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, f, m, n, off, x; + n = 0; + err = $ifaceNil; + f = this; + if (f === ptrType$1.nil) { + _tmp = 0; + _tmp$1 = $pkg.ErrInvalid; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + while (true) { + if (!(b.$length > 0)) { break; } + _tuple = f.pread(b, off); + m = _tuple[0]; + e = _tuple[1]; + if ((m === 0) && $interfaceIsEqual(e, $ifaceNil)) { + _tmp$2 = n; + _tmp$3 = io.EOF; + n = _tmp$2; + err = _tmp$3; + return [n, err]; + } + if (!($interfaceIsEqual(e, $ifaceNil))) { + err = new PathError.ptr("read", f.file.name, e); + break; + } + n = n + (m) >> 0; + b = $subslice(b, m); + off = (x = new $Int64(0, m), new $Int64(off.$high + x.$high, off.$low + x.$low)); + } + return [n, err]; + }; + File.prototype.ReadAt = function(b, off) { return this.$val.ReadAt(b, off); }; + File.ptr.prototype.Write = function(b) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, f, n; + n = 0; + err = $ifaceNil; + f = this; + if (f === ptrType$1.nil) { + _tmp = 0; + _tmp$1 = $pkg.ErrInvalid; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + _tuple = f.write(b); + n = _tuple[0]; + e = _tuple[1]; + if (n < 0) { + n = 0; + } + if (!((n === b.$length))) { + err = io.ErrShortWrite; + } + epipecheck(f, e); + if (!($interfaceIsEqual(e, $ifaceNil))) { + err = new PathError.ptr("write", f.file.name, e); + } + _tmp$2 = n; + _tmp$3 = err; + n = _tmp$2; + err = _tmp$3; + return [n, err]; + }; + File.prototype.Write = function(b) { return this.$val.Write(b); }; + File.ptr.prototype.WriteAt = function(b, off) { + var $ptr, _tmp, _tmp$1, _tuple, b, e, err, f, m, n, off, x; + n = 0; + err = $ifaceNil; + f = this; + if (f === ptrType$1.nil) { + _tmp = 0; + _tmp$1 = $pkg.ErrInvalid; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + while (true) { + if (!(b.$length > 0)) { break; } + _tuple = f.pwrite(b, off); + m = _tuple[0]; + e = _tuple[1]; + if (!($interfaceIsEqual(e, $ifaceNil))) { + err = new PathError.ptr("write", f.file.name, e); + break; + } + n = n + (m) >> 0; + b = $subslice(b, m); + off = (x = new $Int64(0, m), new $Int64(off.$high + x.$high, off.$low + x.$low)); + } + return [n, err]; + }; + File.prototype.WriteAt = function(b, off) { return this.$val.WriteAt(b, off); }; + File.ptr.prototype.Seek = function(offset, whence) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, e, err, f, offset, r, ret, whence; + ret = new $Int64(0, 0); + err = $ifaceNil; + f = this; + if (f === ptrType$1.nil) { + _tmp = new $Int64(0, 0); + _tmp$1 = $pkg.ErrInvalid; + ret = _tmp; + err = _tmp$1; + return [ret, err]; + } + _tuple = f.seek(offset, whence); + r = _tuple[0]; + e = _tuple[1]; + if ($interfaceIsEqual(e, $ifaceNil) && !(f.file.dirinfo === ptrType.nil) && !((r.$high === 0 && r.$low === 0))) { + e = new syscall.Errno(21); + } + if (!($interfaceIsEqual(e, $ifaceNil))) { + _tmp$2 = new $Int64(0, 0); + _tmp$3 = new PathError.ptr("seek", f.file.name, e); + ret = _tmp$2; + err = _tmp$3; + return [ret, err]; + } + _tmp$4 = r; + _tmp$5 = $ifaceNil; + ret = _tmp$4; + err = _tmp$5; + return [ret, err]; + }; + File.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; + File.ptr.prototype.WriteString = function(s) { + var $ptr, _tmp, _tmp$1, _tuple, err, f, n, s; + n = 0; + err = $ifaceNil; + f = this; + if (f === ptrType$1.nil) { + _tmp = 0; + _tmp$1 = $pkg.ErrInvalid; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + _tuple = f.Write(new sliceType$1($stringToBytes(s))); + n = _tuple[0]; + err = _tuple[1]; + return [n, err]; + }; + File.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; + File.ptr.prototype.Chdir = function() { + var $ptr, e, f; + f = this; + if (f === ptrType$1.nil) { + return $pkg.ErrInvalid; + } + e = syscall.Fchdir(f.file.fd); + if (!($interfaceIsEqual(e, $ifaceNil))) { + return new PathError.ptr("chdir", f.file.name, e); + } + return $ifaceNil; + }; + File.prototype.Chdir = function() { return this.$val.Chdir(); }; + fixCount = function(n, err) { + var $ptr, err, n; + if (n < 0) { + n = 0; + } + return [n, err]; + }; + sigpipe = function() { + $throwRuntimeError("native function not implemented: os.sigpipe"); + }; + syscallMode = function(i) { + var $ptr, i, o; + o = 0; + o = (o | ((new FileMode(i).Perm() >>> 0))) >>> 0; + if (!((((i & 8388608) >>> 0) === 0))) { + o = (o | (2048)) >>> 0; + } + if (!((((i & 4194304) >>> 0) === 0))) { + o = (o | (1024)) >>> 0; + } + if (!((((i & 1048576) >>> 0) === 0))) { + o = (o | (512)) >>> 0; + } + return o; + }; + File.ptr.prototype.Chmod = function(mode) { + var $ptr, e, f, mode; + f = this; + if (f === ptrType$1.nil) { + return $pkg.ErrInvalid; + } + e = syscall.Fchmod(f.file.fd, syscallMode(mode)); + if (!($interfaceIsEqual(e, $ifaceNil))) { + return new PathError.ptr("chmod", f.file.name, e); + } + return $ifaceNil; + }; + File.prototype.Chmod = function(mode) { return this.$val.Chmod(mode); }; + File.ptr.prototype.Chown = function(uid, gid) { + var $ptr, e, f, gid, uid; + f = this; + if (f === ptrType$1.nil) { + return $pkg.ErrInvalid; + } + e = syscall.Fchown(f.file.fd, uid, gid); + if (!($interfaceIsEqual(e, $ifaceNil))) { + return new PathError.ptr("chown", f.file.name, e); + } + return $ifaceNil; + }; + File.prototype.Chown = function(uid, gid) { return this.$val.Chown(uid, gid); }; + File.ptr.prototype.Truncate = function(size) { + var $ptr, e, f, size; + f = this; + if (f === ptrType$1.nil) { + return $pkg.ErrInvalid; + } + e = syscall.Ftruncate(f.file.fd, size); + if (!($interfaceIsEqual(e, $ifaceNil))) { + return new PathError.ptr("truncate", f.file.name, e); + } + return $ifaceNil; + }; + File.prototype.Truncate = function(size) { return this.$val.Truncate(size); }; + File.ptr.prototype.Sync = function() { + var $ptr, e, f; + f = this; + if (f === ptrType$1.nil) { + return $pkg.ErrInvalid; + } + e = syscall.Fsync(f.file.fd); + if (!($interfaceIsEqual(e, $ifaceNil))) { + return NewSyscallError("fsync", e); + } + return $ifaceNil; + }; + File.prototype.Sync = function() { return this.$val.Sync(); }; + File.ptr.prototype.Fd = function() { + var $ptr, f; + f = this; + if (f === ptrType$1.nil) { + return 4294967295; + } + return (f.file.fd >>> 0); + }; + File.prototype.Fd = function() { return this.$val.Fd(); }; + NewFile = function(fd, name) { + var $ptr, f, fd, fdi, name; + fdi = (fd >> 0); + if (fdi < 0) { + return ptrType$1.nil; + } + f = new File.ptr(new file.ptr(fdi, name, ptrType.nil)); + runtime.SetFinalizer(f.file, new funcType$1($methodExpr(ptrType$12, "close"))); + return f; + }; + $pkg.NewFile = NewFile; + epipecheck = function(file$1, e) { + var $ptr, e, file$1; + if ($interfaceIsEqual(e, new syscall.Errno(32)) && ((file$1.file.fd === 1) || (file$1.file.fd === 2))) { + sigpipe(); + } + }; + File.ptr.prototype.Close = function() { + var $ptr, f; + f = this; + if (f === ptrType$1.nil) { + return $pkg.ErrInvalid; + } + return f.file.close(); + }; + File.prototype.Close = function() { return this.$val.Close(); }; + file.ptr.prototype.close = function() { + var $ptr, e, err, file$1; + file$1 = this; + if (file$1 === ptrType$12.nil || file$1.fd < 0) { + return new syscall.Errno(22); + } + err = $ifaceNil; + e = syscall.Close(file$1.fd); + if (!($interfaceIsEqual(e, $ifaceNil))) { + err = new PathError.ptr("close", file$1.name, e); + } + file$1.fd = -1; + runtime.SetFinalizer(file$1, $ifaceNil); + return err; + }; + file.prototype.close = function() { return this.$val.close(); }; + File.ptr.prototype.Stat = function() { + var $ptr, err, f, fs; + f = this; + if (f === ptrType$1.nil) { + return [$ifaceNil, $pkg.ErrInvalid]; + } + fs = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Int64(0, 0), 0, ptrType$13.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero())); + err = syscall.Fstat(f.file.fd, fs.sys); + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [$ifaceNil, new PathError.ptr("stat", f.file.name, err)]; + } + fillFileStatFromSys(fs, f.file.name); + return [fs, $ifaceNil]; + }; + File.prototype.Stat = function() { return this.$val.Stat(); }; + Lstat = function(name) { + var $ptr, err, fs, name; + fs = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Int64(0, 0), 0, ptrType$13.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero())); + err = syscall.Lstat(name, fs.sys); + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [$ifaceNil, new PathError.ptr("lstat", name, err)]; + } + fillFileStatFromSys(fs, name); + return [fs, $ifaceNil]; + }; + $pkg.Lstat = Lstat; + File.ptr.prototype.readdir = function(n) { + var $ptr, _i, _r, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, dirname, err, f, fi, filename, fip, lerr, n, names, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; dirname = $f.dirname; err = $f.err; f = $f.f; fi = $f.fi; filename = $f.filename; fip = $f.fip; lerr = $f.lerr; n = $f.n; names = $f.names; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + fi = sliceType$2.nil; + err = $ifaceNil; + f = this; + dirname = f.file.name; + if (dirname === "") { + dirname = "."; + } + _tuple = f.Readdirnames(n); + names = _tuple[0]; + err = _tuple[1]; + fi = $makeSlice(sliceType$2, 0, names.$length); + _ref = names; + _i = 0; + /* while (true) { */ case 1: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } + filename = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + _r = lstat(dirname + "/" + filename); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple$1 = _r; + fip = _tuple$1[0]; + lerr = _tuple$1[1]; + if (IsNotExist(lerr)) { + _i++; + /* continue; */ $s = 1; continue; + } + if (!($interfaceIsEqual(lerr, $ifaceNil))) { + _tmp = fi; + _tmp$1 = lerr; + fi = _tmp; + err = _tmp$1; + return [fi, err]; + } + fi = $append(fi, fip); + _i++; + /* } */ $s = 1; continue; case 2: + _tmp$2 = fi; + _tmp$3 = err; + fi = _tmp$2; + err = _tmp$3; + return [fi, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.readdir }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.dirname = dirname; $f.err = err; $f.f = f; $f.fi = fi; $f.filename = filename; $f.fip = fip; $f.lerr = lerr; $f.n = n; $f.names = names; $f.$s = $s; $f.$r = $r; return $f; + }; + File.prototype.readdir = function(n) { return this.$val.readdir(n); }; + File.ptr.prototype.read = function(b) { + var $ptr, _tuple, _tuple$1, b, err, f, n; + n = 0; + err = $ifaceNil; + f = this; + if (false && b.$length > 1073741824) { + b = $subslice(b, 0, 1073741824); + } + _tuple$1 = syscall.Read(f.file.fd, b); + _tuple = fixCount(_tuple$1[0], _tuple$1[1]); + n = _tuple[0]; + err = _tuple[1]; + return [n, err]; + }; + File.prototype.read = function(b) { return this.$val.read(b); }; + File.ptr.prototype.pread = function(b, off) { + var $ptr, _tuple, _tuple$1, b, err, f, n, off; + n = 0; + err = $ifaceNil; + f = this; + if (false && b.$length > 1073741824) { + b = $subslice(b, 0, 1073741824); + } + _tuple$1 = syscall.Pread(f.file.fd, b, off); + _tuple = fixCount(_tuple$1[0], _tuple$1[1]); + n = _tuple[0]; + err = _tuple[1]; + return [n, err]; + }; + File.prototype.pread = function(b, off) { return this.$val.pread(b, off); }; + File.ptr.prototype.write = function(b) { + var $ptr, _tmp, _tmp$1, _tuple, _tuple$1, b, bcap, err, err$1, f, m, n; + n = 0; + err = $ifaceNil; + f = this; + while (true) { + bcap = b; + if (false && bcap.$length > 1073741824) { + bcap = $subslice(bcap, 0, 1073741824); + } + _tuple$1 = syscall.Write(f.file.fd, bcap); + _tuple = fixCount(_tuple$1[0], _tuple$1[1]); + m = _tuple[0]; + err$1 = _tuple[1]; + n = n + (m) >> 0; + if (0 < m && m < bcap.$length || $interfaceIsEqual(err$1, new syscall.Errno(4))) { + b = $subslice(b, m); + continue; + } + if (false && !((bcap.$length === b.$length)) && $interfaceIsEqual(err$1, $ifaceNil)) { + b = $subslice(b, m); + continue; + } + _tmp = n; + _tmp$1 = err$1; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + }; + File.prototype.write = function(b) { return this.$val.write(b); }; + File.ptr.prototype.pwrite = function(b, off) { + var $ptr, _tuple, _tuple$1, b, err, f, n, off; + n = 0; + err = $ifaceNil; + f = this; + if (false && b.$length > 1073741824) { + b = $subslice(b, 0, 1073741824); + } + _tuple$1 = syscall.Pwrite(f.file.fd, b, off); + _tuple = fixCount(_tuple$1[0], _tuple$1[1]); + n = _tuple[0]; + err = _tuple[1]; + return [n, err]; + }; + File.prototype.pwrite = function(b, off) { return this.$val.pwrite(b, off); }; + File.ptr.prototype.seek = function(offset, whence) { + var $ptr, _tuple, err, f, offset, ret, whence; + ret = new $Int64(0, 0); + err = $ifaceNil; + f = this; + _tuple = syscall.Seek(f.file.fd, offset, whence); + ret = _tuple[0]; + err = _tuple[1]; + return [ret, err]; + }; + File.prototype.seek = function(offset, whence) { return this.$val.seek(offset, whence); }; + basename = function(name) { + var $ptr, i, name; + i = name.length - 1 >> 0; + while (true) { + if (!(i > 0 && (name.charCodeAt(i) === 47))) { break; } + name = name.substring(0, i); + i = i - (1) >> 0; + } + i = i - (1) >> 0; + while (true) { + if (!(i >= 0)) { break; } + if (name.charCodeAt(i) === 47) { + name = name.substring((i + 1 >> 0)); + break; + } + i = i - (1) >> 0; + } + return name; + }; + init$1 = function() { + var $ptr; + if (false) { + return; + } + $pkg.Args = runtime_args(); + }; + Exit = function(code) { + var $ptr, code; + if (code === 0) { + runtime_beforeExit(); + } + syscall.Exit(code); + }; + $pkg.Exit = Exit; + fillFileStatFromSys = function(fs, name) { + var $ptr, _1, fs, name; + fs.name = basename(name); + fs.size = fs.sys.Size; + time.Time.copy(fs.modTime, timespecToTime(fs.sys.Mtim)); + fs.mode = (((fs.sys.Mode & 511) >>> 0) >>> 0); + _1 = (fs.sys.Mode & 61440) >>> 0; + if (_1 === (24576)) { + fs.mode = (fs.mode | (67108864)) >>> 0; + } else if (_1 === (8192)) { + fs.mode = (fs.mode | (69206016)) >>> 0; + } else if (_1 === (16384)) { + fs.mode = (fs.mode | (2147483648)) >>> 0; + } else if (_1 === (4096)) { + fs.mode = (fs.mode | (33554432)) >>> 0; + } else if (_1 === (40960)) { + fs.mode = (fs.mode | (134217728)) >>> 0; + } else if (_1 === (32768)) { + } else if (_1 === (49152)) { + fs.mode = (fs.mode | (16777216)) >>> 0; + } + if (!((((fs.sys.Mode & 1024) >>> 0) === 0))) { + fs.mode = (fs.mode | (4194304)) >>> 0; + } + if (!((((fs.sys.Mode & 2048) >>> 0) === 0))) { + fs.mode = (fs.mode | (8388608)) >>> 0; + } + if (!((((fs.sys.Mode & 512) >>> 0) === 0))) { + fs.mode = (fs.mode | (1048576)) >>> 0; + } + }; + timespecToTime = function(ts) { + var $ptr, ts; + ts = $clone(ts, syscall.Timespec); + return time.Unix(ts.Sec, ts.Nsec); + }; + FileMode.prototype.String = function() { + var $ptr, _i, _i$1, _ref, _ref$1, _rune, _rune$1, buf, c, c$1, i, i$1, m, w, y, y$1; + m = this.$val; + buf = arrayType$5.zero(); + w = 0; + _ref = "dalTLDpSugct"; + _i = 0; + while (true) { + if (!(_i < _ref.length)) { break; } + _rune = $decodeRune(_ref, _i); + i = _i; + c = _rune[0]; + if (!((((m & (((y = ((31 - i >> 0) >>> 0), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0) === 0))) { + ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = (c << 24 >>> 24)); + w = w + (1) >> 0; + } + _i += _rune[1]; + } + if (w === 0) { + ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 45); + w = w + (1) >> 0; + } + _ref$1 = "rwxrwxrwx"; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.length)) { break; } + _rune$1 = $decodeRune(_ref$1, _i$1); + i$1 = _i$1; + c$1 = _rune$1[0]; + if (!((((m & (((y$1 = ((8 - i$1 >> 0) >>> 0), y$1 < 32 ? (1 << y$1) : 0) >>> 0))) >>> 0) === 0))) { + ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = (c$1 << 24 >>> 24)); + } else { + ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 45); + } + w = w + (1) >> 0; + _i$1 += _rune$1[1]; + } + return $bytesToString($subslice(new sliceType$1(buf), 0, w)); + }; + $ptrType(FileMode).prototype.String = function() { return new FileMode(this.$get()).String(); }; + FileMode.prototype.IsDir = function() { + var $ptr, m; + m = this.$val; + return !((((m & 2147483648) >>> 0) === 0)); + }; + $ptrType(FileMode).prototype.IsDir = function() { return new FileMode(this.$get()).IsDir(); }; + FileMode.prototype.IsRegular = function() { + var $ptr, m; + m = this.$val; + return ((m & 2399141888) >>> 0) === 0; + }; + $ptrType(FileMode).prototype.IsRegular = function() { return new FileMode(this.$get()).IsRegular(); }; + FileMode.prototype.Perm = function() { + var $ptr, m; + m = this.$val; + return (m & 511) >>> 0; + }; + $ptrType(FileMode).prototype.Perm = function() { return new FileMode(this.$get()).Perm(); }; + fileStat.ptr.prototype.Name = function() { + var $ptr, fs; + fs = this; + return fs.name; + }; + fileStat.prototype.Name = function() { return this.$val.Name(); }; + fileStat.ptr.prototype.IsDir = function() { + var $ptr, fs; + fs = this; + return new FileMode(fs.Mode()).IsDir(); + }; + fileStat.prototype.IsDir = function() { return this.$val.IsDir(); }; + fileStat.ptr.prototype.Size = function() { + var $ptr, fs; + fs = this; + return fs.size; + }; + fileStat.prototype.Size = function() { return this.$val.Size(); }; + fileStat.ptr.prototype.Mode = function() { + var $ptr, fs; + fs = this; + return fs.mode; + }; + fileStat.prototype.Mode = function() { return this.$val.Mode(); }; + fileStat.ptr.prototype.ModTime = function() { + var $ptr, fs; + fs = this; + return fs.modTime; + }; + fileStat.prototype.ModTime = function() { return this.$val.ModTime(); }; + fileStat.ptr.prototype.Sys = function() { + var $ptr, fs; + fs = this; + return fs.sys; + }; + fileStat.prototype.Sys = function() { return this.$val.Sys(); }; + ptrType$2.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$4.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$3.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$1.methods = [{prop: "readdirnames", name: "readdirnames", pkg: "os", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "Readdir", name: "Readdir", pkg: "", typ: $funcType([$Int], [sliceType$2, $error], false)}, {prop: "Readdirnames", name: "Readdirnames", pkg: "", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "WriteAt", name: "WriteAt", pkg: "", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "Chdir", name: "Chdir", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Chmod", name: "Chmod", pkg: "", typ: $funcType([FileMode], [$error], false)}, {prop: "Chown", name: "Chown", pkg: "", typ: $funcType([$Int, $Int], [$error], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([$Int64], [$error], false)}, {prop: "Sync", name: "Sync", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Fd", name: "Fd", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Stat", name: "Stat", pkg: "", typ: $funcType([], [FileInfo, $error], false)}, {prop: "readdir", name: "readdir", pkg: "os", typ: $funcType([$Int], [sliceType$2, $error], false)}, {prop: "read", name: "read", pkg: "os", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "pread", name: "pread", pkg: "os", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}, {prop: "write", name: "write", pkg: "os", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "pwrite", name: "pwrite", pkg: "os", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}, {prop: "seek", name: "seek", pkg: "os", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}]; + ptrType$12.methods = [{prop: "close", name: "close", pkg: "os", typ: $funcType([], [$error], false)}]; + FileMode.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsRegular", name: "IsRegular", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Perm", name: "Perm", pkg: "", typ: $funcType([], [FileMode], false)}]; + ptrType$15.methods = [{prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Mode", name: "Mode", pkg: "", typ: $funcType([], [FileMode], false)}, {prop: "ModTime", name: "ModTime", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}]; + PathError.init([{prop: "Op", name: "Op", pkg: "", typ: $String, tag: ""}, {prop: "Path", name: "Path", pkg: "", typ: $String, tag: ""}, {prop: "Err", name: "Err", pkg: "", typ: $error, tag: ""}]); + SyscallError.init([{prop: "Syscall", name: "Syscall", pkg: "", typ: $String, tag: ""}, {prop: "Err", name: "Err", pkg: "", typ: $error, tag: ""}]); + LinkError.init([{prop: "Op", name: "Op", pkg: "", typ: $String, tag: ""}, {prop: "Old", name: "Old", pkg: "", typ: $String, tag: ""}, {prop: "New", name: "New", pkg: "", typ: $String, tag: ""}, {prop: "Err", name: "Err", pkg: "", typ: $error, tag: ""}]); + File.init([{prop: "file", name: "", pkg: "os", typ: ptrType$12, tag: ""}]); + file.init([{prop: "fd", name: "fd", pkg: "os", typ: $Int, tag: ""}, {prop: "name", name: "name", pkg: "os", typ: $String, tag: ""}, {prop: "dirinfo", name: "dirinfo", pkg: "os", typ: ptrType, tag: ""}]); + dirInfo.init([{prop: "buf", name: "buf", pkg: "os", typ: sliceType$1, tag: ""}, {prop: "nbuf", name: "nbuf", pkg: "os", typ: $Int, tag: ""}, {prop: "bufp", name: "bufp", pkg: "os", typ: $Int, tag: ""}]); + FileInfo.init([{prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ModTime", name: "ModTime", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "Mode", name: "Mode", pkg: "", typ: $funcType([], [FileMode], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}]); + fileStat.init([{prop: "name", name: "name", pkg: "os", typ: $String, tag: ""}, {prop: "size", name: "size", pkg: "os", typ: $Int64, tag: ""}, {prop: "mode", name: "mode", pkg: "os", typ: FileMode, tag: ""}, {prop: "modTime", name: "modTime", pkg: "os", typ: time.Time, tag: ""}, {prop: "sys", name: "sys", pkg: "os", typ: syscall.Stat_t, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = atomic.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = syscall.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = time.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.Args = sliceType.nil; + $pkg.ErrInvalid = errors.New("invalid argument"); + $pkg.ErrPermission = errors.New("permission denied"); + $pkg.ErrExist = errors.New("file already exists"); + $pkg.ErrNotExist = errors.New("file does not exist"); + errFinished = errors.New("os: process already finished"); + $pkg.Stdin = NewFile((syscall.Stdin >>> 0), "/dev/stdin"); + $pkg.Stdout = NewFile((syscall.Stdout >>> 0), "/dev/stdout"); + $pkg.Stderr = NewFile((syscall.Stderr >>> 0), "/dev/stderr"); + lstat = Lstat; + init(); + init$1(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["fmt"] = (function() { + var $pkg = {}, $init, errors, io, math, os, reflect, strconv, sync, utf8, fmtFlags, fmt, State, Formatter, Stringer, GoStringer, buffer, pp, runeUnreader, ScanState, scanError, ss, ssave, sliceType, sliceType$1, ptrType, arrayType, arrayType$1, ptrType$1, arrayType$2, sliceType$2, ptrType$2, ptrType$5, ptrType$25, funcType, padZeroBytes, padSpaceBytes, trueBytes, falseBytes, commaSpaceBytes, nilAngleBytes, nilParenBytes, nilBytes, mapBytes, percentBangBytes, missingBytes, badIndexBytes, panicBytes, extraBytes, irparenBytes, bytesBytes, badWidthBytes, badPrecBytes, noVerbBytes, ppFree, intBits, uintptrBits, byteType, space, ssFree, complexError, boolError, _r, _r$1, init, doPrec, newPrinter, Fprintf, Sprintf, Errorf, Fprint, Fprintln, getField, tooLarge, parsenum, intFromArg, parseArgNumber, isSpace, notSpace, indexRune; + errors = $packages["errors"]; + io = $packages["io"]; + math = $packages["math"]; + os = $packages["os"]; + reflect = $packages["reflect"]; + strconv = $packages["strconv"]; + sync = $packages["sync"]; + utf8 = $packages["unicode/utf8"]; + fmtFlags = $pkg.fmtFlags = $newType(0, $kindStruct, "fmt.fmtFlags", "fmtFlags", "fmt", function(widPresent_, precPresent_, minus_, plus_, sharp_, space_, unicode_, uniQuote_, zero_, plusV_, sharpV_) { + this.$val = this; + if (arguments.length === 0) { + this.widPresent = false; + this.precPresent = false; + this.minus = false; + this.plus = false; + this.sharp = false; + this.space = false; + this.unicode = false; + this.uniQuote = false; + this.zero = false; + this.plusV = false; + this.sharpV = false; + return; + } + this.widPresent = widPresent_; + this.precPresent = precPresent_; + this.minus = minus_; + this.plus = plus_; + this.sharp = sharp_; + this.space = space_; + this.unicode = unicode_; + this.uniQuote = uniQuote_; + this.zero = zero_; + this.plusV = plusV_; + this.sharpV = sharpV_; + }); + fmt = $pkg.fmt = $newType(0, $kindStruct, "fmt.fmt", "fmt", "fmt", function(intbuf_, buf_, wid_, prec_, fmtFlags_) { + this.$val = this; + if (arguments.length === 0) { + this.intbuf = arrayType$1.zero(); + this.buf = ptrType$1.nil; + this.wid = 0; + this.prec = 0; + this.fmtFlags = new fmtFlags.ptr(false, false, false, false, false, false, false, false, false, false, false); + return; + } + this.intbuf = intbuf_; + this.buf = buf_; + this.wid = wid_; + this.prec = prec_; + this.fmtFlags = fmtFlags_; + }); + State = $pkg.State = $newType(8, $kindInterface, "fmt.State", "State", "fmt", null); + Formatter = $pkg.Formatter = $newType(8, $kindInterface, "fmt.Formatter", "Formatter", "fmt", null); + Stringer = $pkg.Stringer = $newType(8, $kindInterface, "fmt.Stringer", "Stringer", "fmt", null); + GoStringer = $pkg.GoStringer = $newType(8, $kindInterface, "fmt.GoStringer", "GoStringer", "fmt", null); + buffer = $pkg.buffer = $newType(12, $kindSlice, "fmt.buffer", "buffer", "fmt", null); + pp = $pkg.pp = $newType(0, $kindStruct, "fmt.pp", "pp", "fmt", function(n_, panicking_, erroring_, buf_, arg_, value_, reordered_, goodArgNum_, runeBuf_, fmt_) { + this.$val = this; + if (arguments.length === 0) { + this.n = 0; + this.panicking = false; + this.erroring = false; + this.buf = buffer.nil; + this.arg = $ifaceNil; + this.value = new reflect.Value.ptr(ptrType.nil, 0, 0); + this.reordered = false; + this.goodArgNum = false; + this.runeBuf = arrayType.zero(); + this.fmt = new fmt.ptr(arrayType$1.zero(), ptrType$1.nil, 0, 0, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false, false, false)); + return; + } + this.n = n_; + this.panicking = panicking_; + this.erroring = erroring_; + this.buf = buf_; + this.arg = arg_; + this.value = value_; + this.reordered = reordered_; + this.goodArgNum = goodArgNum_; + this.runeBuf = runeBuf_; + this.fmt = fmt_; + }); + runeUnreader = $pkg.runeUnreader = $newType(8, $kindInterface, "fmt.runeUnreader", "runeUnreader", "fmt", null); + ScanState = $pkg.ScanState = $newType(8, $kindInterface, "fmt.ScanState", "ScanState", "fmt", null); + scanError = $pkg.scanError = $newType(0, $kindStruct, "fmt.scanError", "scanError", "fmt", function(err_) { + this.$val = this; + if (arguments.length === 0) { + this.err = $ifaceNil; + return; + } + this.err = err_; + }); + ss = $pkg.ss = $newType(0, $kindStruct, "fmt.ss", "ss", "fmt", function(rr_, buf_, peekRune_, prevRune_, count_, atEOF_, ssave_) { + this.$val = this; + if (arguments.length === 0) { + this.rr = $ifaceNil; + this.buf = buffer.nil; + this.peekRune = 0; + this.prevRune = 0; + this.count = 0; + this.atEOF = false; + this.ssave = new ssave.ptr(false, false, false, 0, 0, 0); + return; + } + this.rr = rr_; + this.buf = buf_; + this.peekRune = peekRune_; + this.prevRune = prevRune_; + this.count = count_; + this.atEOF = atEOF_; + this.ssave = ssave_; + }); + ssave = $pkg.ssave = $newType(0, $kindStruct, "fmt.ssave", "ssave", "fmt", function(validSave_, nlIsEnd_, nlIsSpace_, argLimit_, limit_, maxWid_) { + this.$val = this; + if (arguments.length === 0) { + this.validSave = false; + this.nlIsEnd = false; + this.nlIsSpace = false; + this.argLimit = 0; + this.limit = 0; + this.maxWid = 0; + return; + } + this.validSave = validSave_; + this.nlIsEnd = nlIsEnd_; + this.nlIsSpace = nlIsSpace_; + this.argLimit = argLimit_; + this.limit = limit_; + this.maxWid = maxWid_; + }); + sliceType = $sliceType($Uint8); + sliceType$1 = $sliceType($emptyInterface); + ptrType = $ptrType(reflect.rtype); + arrayType = $arrayType($Uint8, 4); + arrayType$1 = $arrayType($Uint8, 65); + ptrType$1 = $ptrType(buffer); + arrayType$2 = $arrayType($Uint16, 2); + sliceType$2 = $sliceType(arrayType$2); + ptrType$2 = $ptrType(pp); + ptrType$5 = $ptrType(ss); + ptrType$25 = $ptrType(fmt); + funcType = $funcType([$Int32], [$Bool], false); + init = function() { + var $ptr, i; + i = 0; + while (true) { + if (!(i < 65)) { break; } + ((i < 0 || i >= padZeroBytes.$length) ? $throwRuntimeError("index out of range") : padZeroBytes.$array[padZeroBytes.$offset + i] = 48); + ((i < 0 || i >= padSpaceBytes.$length) ? $throwRuntimeError("index out of range") : padSpaceBytes.$array[padSpaceBytes.$offset + i] = 32); + i = i + (1) >> 0; + } + }; + fmt.ptr.prototype.clearflags = function() { + var $ptr, f; + f = this; + fmtFlags.copy(f.fmtFlags, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false, false, false)); + }; + fmt.prototype.clearflags = function() { return this.$val.clearflags(); }; + fmt.ptr.prototype.init = function(buf) { + var $ptr, buf, f; + f = this; + f.buf = buf; + f.clearflags(); + }; + fmt.prototype.init = function(buf) { return this.$val.init(buf); }; + fmt.ptr.prototype.computePadding = function(width) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, f, left, leftWidth, padding, rightWidth, w, width; + padding = sliceType.nil; + leftWidth = 0; + rightWidth = 0; + f = this; + left = !f.fmtFlags.minus; + w = f.wid; + if (w < 0) { + left = false; + w = -w; + } + w = w - (width) >> 0; + if (w > 0) { + if (left && f.fmtFlags.zero) { + _tmp = padZeroBytes; + _tmp$1 = w; + _tmp$2 = 0; + padding = _tmp; + leftWidth = _tmp$1; + rightWidth = _tmp$2; + return [padding, leftWidth, rightWidth]; + } + if (left) { + _tmp$3 = padSpaceBytes; + _tmp$4 = w; + _tmp$5 = 0; + padding = _tmp$3; + leftWidth = _tmp$4; + rightWidth = _tmp$5; + return [padding, leftWidth, rightWidth]; + } else { + _tmp$6 = padSpaceBytes; + _tmp$7 = 0; + _tmp$8 = w; + padding = _tmp$6; + leftWidth = _tmp$7; + rightWidth = _tmp$8; + return [padding, leftWidth, rightWidth]; + } + } + return [padding, leftWidth, rightWidth]; + }; + fmt.prototype.computePadding = function(width) { return this.$val.computePadding(width); }; + fmt.ptr.prototype.writePadding = function(n, padding) { + var $ptr, f, m, n, padding; + f = this; + while (true) { + if (!(n > 0)) { break; } + m = n; + if (m > 65) { + m = 65; + } + f.buf.Write($subslice(padding, 0, m)); + n = n - (m) >> 0; + } + }; + fmt.prototype.writePadding = function(n, padding) { return this.$val.writePadding(n, padding); }; + fmt.ptr.prototype.pad = function(b) { + var $ptr, _tuple, b, f, left, padding, right; + f = this; + if (!f.fmtFlags.widPresent || (f.wid === 0)) { + f.buf.Write(b); + return; + } + _tuple = f.computePadding(utf8.RuneCount(b)); + padding = _tuple[0]; + left = _tuple[1]; + right = _tuple[2]; + if (left > 0) { + f.writePadding(left, padding); + } + f.buf.Write(b); + if (right > 0) { + f.writePadding(right, padding); + } + }; + fmt.prototype.pad = function(b) { return this.$val.pad(b); }; + fmt.ptr.prototype.padString = function(s) { + var $ptr, _tuple, f, left, padding, right, s; + f = this; + if (!f.fmtFlags.widPresent || (f.wid === 0)) { + f.buf.WriteString(s); + return; + } + _tuple = f.computePadding(utf8.RuneCountInString(s)); + padding = _tuple[0]; + left = _tuple[1]; + right = _tuple[2]; + if (left > 0) { + f.writePadding(left, padding); + } + f.buf.WriteString(s); + if (right > 0) { + f.writePadding(right, padding); + } + }; + fmt.prototype.padString = function(s) { return this.$val.padString(s); }; + fmt.ptr.prototype.fmt_boolean = function(v) { + var $ptr, f, v; + f = this; + if (v) { + f.pad(trueBytes); + } else { + f.pad(falseBytes); + } + }; + fmt.prototype.fmt_boolean = function(v) { return this.$val.fmt_boolean(v); }; + fmt.ptr.prototype.integer = function(a, base, signedness, digits) { + var $ptr, _1, _2, a, base, buf, digits, f, i, j, negative, next, prec, runeWidth, signedness, ua, width, width$1, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + f = this; + if (f.fmtFlags.precPresent && (f.prec === 0) && (a.$high === 0 && a.$low === 0)) { + return; + } + negative = signedness && (a.$high < 0 || (a.$high === 0 && a.$low < 0)); + if (negative) { + a = new $Int64(-a.$high, -a.$low); + } + buf = $subslice(new sliceType(f.intbuf), 0); + if (f.fmtFlags.widPresent || f.fmtFlags.precPresent || f.fmtFlags.plus || f.fmtFlags.space) { + width = f.wid + f.prec >> 0; + if ((base.$high === 0 && base.$low === 16) && f.fmtFlags.sharp) { + width = width + (2) >> 0; + } + if (f.fmtFlags.unicode) { + width = width + (2) >> 0; + if (f.fmtFlags.uniQuote) { + width = width + (7) >> 0; + } + } + if (negative || f.fmtFlags.plus || f.fmtFlags.space) { + width = width + (1) >> 0; + } + if (width > 65) { + buf = $makeSlice(sliceType, width); + } + } + prec = 0; + if (f.fmtFlags.precPresent) { + prec = f.prec; + f.fmtFlags.zero = false; + } else if (f.fmtFlags.zero && f.fmtFlags.widPresent && !f.fmtFlags.minus && f.wid > 0) { + prec = f.wid; + if (negative || f.fmtFlags.plus || f.fmtFlags.space) { + prec = prec - (1) >> 0; + } + } + i = buf.$length; + ua = new $Uint64(a.$high, a.$low); + _1 = base; + if ((x = new $Uint64(0, 10), (_1.$high === x.$high && _1.$low === x.$low))) { + while (true) { + if (!((ua.$high > 0 || (ua.$high === 0 && ua.$low >= 10)))) { break; } + i = i - (1) >> 0; + next = $div64(ua, new $Uint64(0, 10), false); + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = ((x$4 = new $Uint64(0 + ua.$high, 48 + ua.$low), x$5 = $mul64(next, new $Uint64(0, 10)), new $Uint64(x$4.$high - x$5.$high, x$4.$low - x$5.$low)).$low << 24 >>> 24)); + ua = next; + } + } else if ((x$1 = new $Uint64(0, 16), (_1.$high === x$1.$high && _1.$low === x$1.$low))) { + while (true) { + if (!((ua.$high > 0 || (ua.$high === 0 && ua.$low >= 16)))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(new $Uint64(ua.$high & 0, (ua.$low & 15) >>> 0)))); + ua = $shiftRightUint64(ua, (4)); + } + } else if ((x$2 = new $Uint64(0, 8), (_1.$high === x$2.$high && _1.$low === x$2.$low))) { + while (true) { + if (!((ua.$high > 0 || (ua.$high === 0 && ua.$low >= 8)))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = ((x$6 = new $Uint64(ua.$high & 0, (ua.$low & 7) >>> 0), new $Uint64(0 + x$6.$high, 48 + x$6.$low)).$low << 24 >>> 24)); + ua = $shiftRightUint64(ua, (3)); + } + } else if ((x$3 = new $Uint64(0, 2), (_1.$high === x$3.$high && _1.$low === x$3.$low))) { + while (true) { + if (!((ua.$high > 0 || (ua.$high === 0 && ua.$low >= 2)))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = ((x$7 = new $Uint64(ua.$high & 0, (ua.$low & 1) >>> 0), new $Uint64(0 + x$7.$high, 48 + x$7.$low)).$low << 24 >>> 24)); + ua = $shiftRightUint64(ua, (1)); + } + } else { + $panic(new $String("fmt: unknown base; can't happen")); + } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(ua))); + while (true) { + if (!(i > 0 && prec > (buf.$length - i >> 0))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 48); + } + if (f.fmtFlags.sharp) { + _2 = base; + if ((x$8 = new $Uint64(0, 8), (_2.$high === x$8.$high && _2.$low === x$8.$low))) { + if (!((((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i]) === 48))) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 48); + } + } else if ((x$9 = new $Uint64(0, 16), (_2.$high === x$9.$high && _2.$low === x$9.$low))) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = ((120 + digits.charCodeAt(10) << 24 >>> 24) - 97 << 24 >>> 24)); + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 48); + } + } + if (f.fmtFlags.unicode) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 43); + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 85); + } + if (negative) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 45); + } else if (f.fmtFlags.plus) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 43); + } else if (f.fmtFlags.space) { + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 32); + } + if (f.fmtFlags.unicode && f.fmtFlags.uniQuote && (a.$high > 0 || (a.$high === 0 && a.$low >= 0)) && (a.$high < 0 || (a.$high === 0 && a.$low <= 1114111)) && strconv.IsPrint(((a.$low + ((a.$high >> 31) * 4294967296)) >> 0))) { + runeWidth = utf8.RuneLen(((a.$low + ((a.$high >> 31) * 4294967296)) >> 0)); + width$1 = (2 + runeWidth >> 0) + 1 >> 0; + $copySlice($subslice(buf, (i - width$1 >> 0)), $subslice(buf, i)); + i = i - (width$1) >> 0; + j = buf.$length - width$1 >> 0; + ((j < 0 || j >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + j] = 32); + j = j + (1) >> 0; + ((j < 0 || j >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + j] = 39); + j = j + (1) >> 0; + utf8.EncodeRune($subslice(buf, j), ((a.$low + ((a.$high >> 31) * 4294967296)) >> 0)); + j = j + (runeWidth) >> 0; + ((j < 0 || j >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + j] = 39); + } + f.pad($subslice(buf, i)); + }; + fmt.prototype.integer = function(a, base, signedness, digits) { return this.$val.integer(a, base, signedness, digits); }; + fmt.ptr.prototype.truncate = function(s) { + var $ptr, _i, _ref, _rune, f, i, n, s; + f = this; + if (f.fmtFlags.precPresent && f.prec < utf8.RuneCountInString(s)) { + n = f.prec; + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.length)) { break; } + _rune = $decodeRune(_ref, _i); + i = _i; + if (n === 0) { + s = s.substring(0, i); + break; + } + n = n - (1) >> 0; + _i += _rune[1]; + } + } + return s; + }; + fmt.prototype.truncate = function(s) { return this.$val.truncate(s); }; + fmt.ptr.prototype.fmt_s = function(s) { + var $ptr, f, s; + f = this; + s = f.truncate(s); + f.padString(s); + }; + fmt.prototype.fmt_s = function(s) { return this.$val.fmt_s(s); }; + fmt.ptr.prototype.fmt_sbx = function(s, b, digits) { + var $ptr, b, buf, c, digits, f, i, n, s, x; + f = this; + n = b.$length; + if (b === sliceType.nil) { + n = s.length; + } + x = (digits.charCodeAt(10) - 97 << 24 >>> 24) + 120 << 24 >>> 24; + buf = sliceType.nil; + i = 0; + while (true) { + if (!(i < n)) { break; } + if (i > 0 && f.fmtFlags.space) { + buf = $append(buf, 32); + } + if (f.fmtFlags.sharp && (f.fmtFlags.space || (i === 0))) { + buf = $append(buf, 48, x); + } + c = 0; + if (b === sliceType.nil) { + c = s.charCodeAt(i); + } else { + c = ((i < 0 || i >= b.$length) ? $throwRuntimeError("index out of range") : b.$array[b.$offset + i]); + } + buf = $append(buf, digits.charCodeAt((c >>> 4 << 24 >>> 24)), digits.charCodeAt(((c & 15) >>> 0))); + i = i + (1) >> 0; + } + f.pad(buf); + }; + fmt.prototype.fmt_sbx = function(s, b, digits) { return this.$val.fmt_sbx(s, b, digits); }; + fmt.ptr.prototype.fmt_sx = function(s, digits) { + var $ptr, digits, f, s; + f = this; + if (f.fmtFlags.precPresent && f.prec < s.length) { + s = s.substring(0, f.prec); + } + f.fmt_sbx(s, sliceType.nil, digits); + }; + fmt.prototype.fmt_sx = function(s, digits) { return this.$val.fmt_sx(s, digits); }; + fmt.ptr.prototype.fmt_bx = function(b, digits) { + var $ptr, b, digits, f; + f = this; + if (f.fmtFlags.precPresent && f.prec < b.$length) { + b = $subslice(b, 0, f.prec); + } + f.fmt_sbx("", b, digits); + }; + fmt.prototype.fmt_bx = function(b, digits) { return this.$val.fmt_bx(b, digits); }; + fmt.ptr.prototype.fmt_q = function(s) { + var $ptr, f, quoted, s; + f = this; + s = f.truncate(s); + quoted = ""; + if (f.fmtFlags.sharp && strconv.CanBackquote(s)) { + quoted = "`" + s + "`"; + } else { + if (f.fmtFlags.plus) { + quoted = strconv.QuoteToASCII(s); + } else { + quoted = strconv.Quote(s); + } + } + f.padString(quoted); + }; + fmt.prototype.fmt_q = function(s) { return this.$val.fmt_q(s); }; + fmt.ptr.prototype.fmt_qc = function(c) { + var $ptr, c, f, quoted; + f = this; + quoted = sliceType.nil; + if (f.fmtFlags.plus) { + quoted = strconv.AppendQuoteRuneToASCII($subslice(new sliceType(f.intbuf), 0, 0), ((c.$low + ((c.$high >> 31) * 4294967296)) >> 0)); + } else { + quoted = strconv.AppendQuoteRune($subslice(new sliceType(f.intbuf), 0, 0), ((c.$low + ((c.$high >> 31) * 4294967296)) >> 0)); + } + f.pad(quoted); + }; + fmt.prototype.fmt_qc = function(c) { return this.$val.fmt_qc(c); }; + doPrec = function(f, def) { + var $ptr, def, f; + if (f.fmtFlags.precPresent) { + return f.prec; + } + return def; + }; + fmt.ptr.prototype.formatFloat = function(v, verb, prec, n) { + var $ptr, f, n, num, prec, v, verb, $deferred; + /* */ var $err = null; try { $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + f = this; + num = strconv.AppendFloat($subslice(new sliceType(f.intbuf), 0, 1), v, verb, prec, n); + if (((1 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 1]) === 45) || ((1 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 1]) === 43)) { + num = $subslice(num, 1); + } else { + (0 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 0] = 43); + } + if (math.IsInf(v, 0)) { + if (f.fmtFlags.zero) { + $deferred.push([(function() { + var $ptr; + f.fmtFlags.zero = true; + }), []]); + f.fmtFlags.zero = false; + } + } + if (f.fmtFlags.zero && f.fmtFlags.widPresent && f.wid > num.$length) { + if (f.fmtFlags.space && v >= 0) { + f.buf.WriteByte(32); + f.wid = f.wid - (1) >> 0; + } else if (f.fmtFlags.plus || v < 0) { + f.buf.WriteByte((0 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 0])); + f.wid = f.wid - (1) >> 0; + } + f.pad($subslice(num, 1)); + return; + } + if (f.fmtFlags.space && ((0 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 0]) === 43)) { + (0 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 0] = 32); + f.pad(num); + return; + } + if (f.fmtFlags.plus || ((0 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 0]) === 45) || math.IsInf(v, 0)) { + f.pad(num); + return; + } + f.pad($subslice(num, 1)); + /* */ } catch(err) { $err = err; } finally { $callDeferred($deferred, $err); } + }; + fmt.prototype.formatFloat = function(v, verb, prec, n) { return this.$val.formatFloat(v, verb, prec, n); }; + fmt.ptr.prototype.fmt_e64 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 101, doPrec(f, 6), 64); + }; + fmt.prototype.fmt_e64 = function(v) { return this.$val.fmt_e64(v); }; + fmt.ptr.prototype.fmt_E64 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 69, doPrec(f, 6), 64); + }; + fmt.prototype.fmt_E64 = function(v) { return this.$val.fmt_E64(v); }; + fmt.ptr.prototype.fmt_f64 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 102, doPrec(f, 6), 64); + }; + fmt.prototype.fmt_f64 = function(v) { return this.$val.fmt_f64(v); }; + fmt.ptr.prototype.fmt_g64 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 103, doPrec(f, -1), 64); + }; + fmt.prototype.fmt_g64 = function(v) { return this.$val.fmt_g64(v); }; + fmt.ptr.prototype.fmt_G64 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 71, doPrec(f, -1), 64); + }; + fmt.prototype.fmt_G64 = function(v) { return this.$val.fmt_G64(v); }; + fmt.ptr.prototype.fmt_fb64 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 98, 0, 64); + }; + fmt.prototype.fmt_fb64 = function(v) { return this.$val.fmt_fb64(v); }; + fmt.ptr.prototype.fmt_e32 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 101, doPrec(f, 6), 32); + }; + fmt.prototype.fmt_e32 = function(v) { return this.$val.fmt_e32(v); }; + fmt.ptr.prototype.fmt_E32 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 69, doPrec(f, 6), 32); + }; + fmt.prototype.fmt_E32 = function(v) { return this.$val.fmt_E32(v); }; + fmt.ptr.prototype.fmt_f32 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 102, doPrec(f, 6), 32); + }; + fmt.prototype.fmt_f32 = function(v) { return this.$val.fmt_f32(v); }; + fmt.ptr.prototype.fmt_g32 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 103, doPrec(f, -1), 32); + }; + fmt.prototype.fmt_g32 = function(v) { return this.$val.fmt_g32(v); }; + fmt.ptr.prototype.fmt_G32 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 71, doPrec(f, -1), 32); + }; + fmt.prototype.fmt_G32 = function(v) { return this.$val.fmt_G32(v); }; + fmt.ptr.prototype.fmt_fb32 = function(v) { + var $ptr, f, v; + f = this; + f.formatFloat(v, 98, 0, 32); + }; + fmt.prototype.fmt_fb32 = function(v) { return this.$val.fmt_fb32(v); }; + fmt.ptr.prototype.fmt_c64 = function(v, verb) { + var $ptr, f, v, verb; + f = this; + f.fmt_complex(v.$real, v.$imag, 32, verb); + }; + fmt.prototype.fmt_c64 = function(v, verb) { return this.$val.fmt_c64(v, verb); }; + fmt.ptr.prototype.fmt_c128 = function(v, verb) { + var $ptr, f, v, verb; + f = this; + f.fmt_complex(v.$real, v.$imag, 64, verb); + }; + fmt.prototype.fmt_c128 = function(v, verb) { return this.$val.fmt_c128(v, verb); }; + fmt.ptr.prototype.fmt_complex = function(r, j, size, verb) { + var $ptr, _3, f, i, j, oldPlus, oldSpace, oldWid, r, size, verb; + f = this; + f.buf.WriteByte(40); + oldPlus = f.fmtFlags.plus; + oldSpace = f.fmtFlags.space; + oldWid = f.wid; + i = 0; + while (true) { + _3 = verb; + if (_3 === (98)) { + f.formatFloat(r, 98, 0, size); + } else if (_3 === (101)) { + f.formatFloat(r, 101, doPrec(f, 6), size); + } else if (_3 === (69)) { + f.formatFloat(r, 69, doPrec(f, 6), size); + } else if ((_3 === (102)) || (_3 === (70))) { + f.formatFloat(r, 102, doPrec(f, 6), size); + } else if (_3 === (103)) { + f.formatFloat(r, 103, doPrec(f, -1), size); + } else if (_3 === (71)) { + f.formatFloat(r, 71, doPrec(f, -1), size); + } + if (!((i === 0))) { + break; + } + f.fmtFlags.plus = true; + f.fmtFlags.space = false; + f.wid = oldWid; + r = j; + i = i + (1) >> 0; + } + f.fmtFlags.space = oldSpace; + f.fmtFlags.plus = oldPlus; + f.wid = oldWid; + f.buf.Write(irparenBytes); + }; + fmt.prototype.fmt_complex = function(r, j, size, verb) { return this.$val.fmt_complex(r, j, size, verb); }; + $ptrType(buffer).prototype.Write = function(p) { + var $ptr, _tmp, _tmp$1, b, err, n, p; + n = 0; + err = $ifaceNil; + b = this; + b.$set($appendSlice(b.$get(), p)); + _tmp = p.$length; + _tmp$1 = $ifaceNil; + n = _tmp; + err = _tmp$1; + return [n, err]; + }; + $ptrType(buffer).prototype.WriteString = function(s) { + var $ptr, _tmp, _tmp$1, b, err, n, s; + n = 0; + err = $ifaceNil; + b = this; + b.$set($appendSlice(b.$get(), s)); + _tmp = s.length; + _tmp$1 = $ifaceNil; + n = _tmp; + err = _tmp$1; + return [n, err]; + }; + $ptrType(buffer).prototype.WriteByte = function(c) { + var $ptr, b, c; + b = this; + b.$set($append(b.$get(), c)); + return $ifaceNil; + }; + $ptrType(buffer).prototype.WriteRune = function(r) { + var $ptr, b, bp, n, r, w, x; + bp = this; + if (r < 128) { + bp.$set($append(bp.$get(), (r << 24 >>> 24))); + return $ifaceNil; + } + b = bp.$get(); + n = b.$length; + while (true) { + if (!((n + 4 >> 0) > b.$capacity)) { break; } + b = $append(b, 0); + } + w = utf8.EncodeRune((x = $subslice(b, n, (n + 4 >> 0)), $subslice(new sliceType(x.$array), x.$offset, x.$offset + x.$length)), r); + bp.$set($subslice(b, 0, (n + w >> 0))); + return $ifaceNil; + }; + newPrinter = function() { + var $ptr, _r$2, p, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r$2 = ppFree.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + p = $assertType(_r$2, ptrType$2); + p.panicking = false; + p.erroring = false; + p.fmt.init((p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p)))); + return p; + /* */ } return; } if ($f === undefined) { $f = { $blk: newPrinter }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.ptr.prototype.free = function() { + var $ptr, p; + p = this; + if (p.buf.$capacity > 1024) { + return; + } + p.buf = $subslice(p.buf, 0, 0); + p.arg = $ifaceNil; + p.value = new reflect.Value.ptr(ptrType.nil, 0, 0); + ppFree.Put(p); + }; + pp.prototype.free = function() { return this.$val.free(); }; + pp.ptr.prototype.Width = function() { + var $ptr, _tmp, _tmp$1, ok, p, wid; + wid = 0; + ok = false; + p = this; + _tmp = p.fmt.wid; + _tmp$1 = p.fmt.fmtFlags.widPresent; + wid = _tmp; + ok = _tmp$1; + return [wid, ok]; + }; + pp.prototype.Width = function() { return this.$val.Width(); }; + pp.ptr.prototype.Precision = function() { + var $ptr, _tmp, _tmp$1, ok, p, prec; + prec = 0; + ok = false; + p = this; + _tmp = p.fmt.prec; + _tmp$1 = p.fmt.fmtFlags.precPresent; + prec = _tmp; + ok = _tmp$1; + return [prec, ok]; + }; + pp.prototype.Precision = function() { return this.$val.Precision(); }; + pp.ptr.prototype.Flag = function(b) { + var $ptr, _1, b, p; + p = this; + _1 = b; + if (_1 === (45)) { + return p.fmt.fmtFlags.minus; + } else if (_1 === (43)) { + return p.fmt.fmtFlags.plus; + } else if (_1 === (35)) { + return p.fmt.fmtFlags.sharp; + } else if (_1 === (32)) { + return p.fmt.fmtFlags.space; + } else if (_1 === (48)) { + return p.fmt.fmtFlags.zero; + } + return false; + }; + pp.prototype.Flag = function(b) { return this.$val.Flag(b); }; + pp.ptr.prototype.add = function(c) { + var $ptr, c, p; + p = this; + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteRune(c); + }; + pp.prototype.add = function(c) { return this.$val.add(c); }; + pp.ptr.prototype.Write = function(b) { + var $ptr, _tuple, b, err, p, ret; + ret = 0; + err = $ifaceNil; + p = this; + _tuple = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(b); + ret = _tuple[0]; + err = _tuple[1]; + return [ret, err]; + }; + pp.prototype.Write = function(b) { return this.$val.Write(b); }; + Fprintf = function(w, format, a) { + var $ptr, _r$2, _r$3, _tuple, a, err, format, n, p, w, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; a = $f.a; err = $f.err; format = $f.format; n = $f.n; p = $f.p; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + _r$2 = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + p = _r$2; + $r = p.doPrintf(format, a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r$3 = w.Write((x = p.buf, $subslice(new sliceType(x.$array), x.$offset, x.$offset + x.$length))); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + n = _tuple[0]; + err = _tuple[1]; + p.free(); + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Fprintf }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.format = format; $f.n = n; $f.p = p; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Fprintf = Fprintf; + Sprintf = function(format, a) { + var $ptr, _r$2, a, format, p, s, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; a = $f.a; format = $f.format; p = $f.p; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r$2 = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + p = _r$2; + $r = p.doPrintf(format, a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + s = $bytesToString(p.buf); + p.free(); + return s; + /* */ } return; } if ($f === undefined) { $f = { $blk: Sprintf }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.a = a; $f.format = format; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Sprintf = Sprintf; + Errorf = function(format, a) { + var $ptr, _r$2, _r$3, a, format, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; a = $f.a; format = $f.format; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r$2 = Sprintf(format, a); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = errors.New(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ $s = 3; case 3: + return _r$3; + /* */ } return; } if ($f === undefined) { $f = { $blk: Errorf }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.a = a; $f.format = format; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Errorf = Errorf; + Fprint = function(w, a) { + var $ptr, _r$2, _r$3, _tuple, a, err, n, p, w, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; p = $f.p; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + _r$2 = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + p = _r$2; + $r = p.doPrint(a, false, false); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r$3 = w.Write((x = p.buf, $subslice(new sliceType(x.$array), x.$offset, x.$offset + x.$length))); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + n = _tuple[0]; + err = _tuple[1]; + p.free(); + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Fprint }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Fprint = Fprint; + Fprintln = function(w, a) { + var $ptr, _r$2, _r$3, _tuple, a, err, n, p, w, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; p = $f.p; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + _r$2 = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + p = _r$2; + $r = p.doPrint(a, true, true); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r$3 = w.Write((x = p.buf, $subslice(new sliceType(x.$array), x.$offset, x.$offset + x.$length))); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + n = _tuple[0]; + err = _tuple[1]; + p.free(); + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Fprintln }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Fprintln = Fprintln; + getField = function(v, i) { + var $ptr, _r$2, _r$3, i, v, val, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; i = $f.i; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _r$2 = v.Field(i); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + val = _r$2; + /* */ if ((val.Kind() === 20) && !val.IsNil()) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if ((val.Kind() === 20) && !val.IsNil()) { */ case 2: + _r$3 = val.Elem(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + val = _r$3; + /* } */ case 3: + return val; + /* */ } return; } if ($f === undefined) { $f = { $blk: getField }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.i = i; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; + }; + tooLarge = function(x) { + var $ptr, x; + return x > 1000000 || x < -1000000; + }; + parsenum = function(s, start, end) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, end, isnum, newi, num, s, start; + num = 0; + isnum = false; + newi = 0; + if (start >= end) { + _tmp = 0; + _tmp$1 = false; + _tmp$2 = end; + num = _tmp; + isnum = _tmp$1; + newi = _tmp$2; + return [num, isnum, newi]; + } + newi = start; + while (true) { + if (!(newi < end && 48 <= s.charCodeAt(newi) && s.charCodeAt(newi) <= 57)) { break; } + if (tooLarge(num)) { + _tmp$3 = 0; + _tmp$4 = false; + _tmp$5 = end; + num = _tmp$3; + isnum = _tmp$4; + newi = _tmp$5; + return [num, isnum, newi]; + } + num = ($imul(num, 10)) + ((s.charCodeAt(newi) - 48 << 24 >>> 24) >> 0) >> 0; + isnum = true; + newi = newi + (1) >> 0; + } + return [num, isnum, newi]; + }; + pp.ptr.prototype.unknownType = function(v) { + var $ptr, _r$2, _r$3, p, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; p = $f.p; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + p = this; + if (!v.IsValid()) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); + return; + } + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(63); + _r$2 = v.Type().String(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(63); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.unknownType }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.p = p; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.unknownType = function(v) { return this.$val.unknownType(v); }; + pp.ptr.prototype.badVerb = function(verb) { + var $ptr, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, p, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; p = $f.p; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + p.erroring = true; + p.add(37); + p.add(33); + p.add(verb); + p.add(40); + /* */ if (!($interfaceIsEqual(p.arg, $ifaceNil))) { $s = 2; continue; } + /* */ if (p.value.IsValid()) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (!($interfaceIsEqual(p.arg, $ifaceNil))) { */ case 2: + _r$2 = reflect.TypeOf(p.arg).String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$2); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + p.add(61); + _r$4 = p.printArg(p.arg, 118, 0); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$4; + $s = 5; continue; + /* } else if (p.value.IsValid()) { */ case 3: + _r$5 = p.value.Type().String(); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _r$6 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$5); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _r$6; + p.add(61); + _r$7 = p.printValue(p.value, 118, 0); /* */ $s = 11; case 11: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + _r$7; + $s = 5; continue; + /* } else { */ case 4: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); + /* } */ case 5: + case 1: + p.add(41); + p.erroring = false; + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.badVerb }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f.p = p; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.badVerb = function(verb) { return this.$val.badVerb(verb); }; + pp.ptr.prototype.fmtBool = function(v, verb) { + var $ptr, _2, p, v, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _2 = $f._2; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + _2 = verb; + /* */ if ((_2 === (116)) || (_2 === (118))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if ((_2 === (116)) || (_2 === (118))) { */ case 2: + p.fmt.fmt_boolean(v); + $s = 4; continue; + /* } else { */ case 3: + $r = p.badVerb(verb); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 4: + case 1: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtBool }; } $f.$ptr = $ptr; $f._2 = _2; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.fmtBool = function(v, verb) { return this.$val.fmtBool(v, verb); }; + pp.ptr.prototype.fmtC = function(c) { + var $ptr, c, p, r, w, x; + p = this; + r = ((c.$low + ((c.$high >> 31) * 4294967296)) >> 0); + if (!((x = new $Int64(0, r), (x.$high === c.$high && x.$low === c.$low)))) { + r = 65533; + } + w = utf8.EncodeRune($subslice(new sliceType(p.runeBuf), 0, 4), r); + p.fmt.pad($subslice(new sliceType(p.runeBuf), 0, w)); + }; + pp.prototype.fmtC = function(c) { return this.$val.fmtC(c); }; + pp.ptr.prototype.fmtInt64 = function(v, verb) { + var $ptr, _3, p, v, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _3 = $f._3; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + _3 = verb; + /* */ if (_3 === (98)) { $s = 2; continue; } + /* */ if (_3 === (99)) { $s = 3; continue; } + /* */ if ((_3 === (100)) || (_3 === (118))) { $s = 4; continue; } + /* */ if (_3 === (111)) { $s = 5; continue; } + /* */ if (_3 === (113)) { $s = 6; continue; } + /* */ if (_3 === (120)) { $s = 7; continue; } + /* */ if (_3 === (85)) { $s = 8; continue; } + /* */ if (_3 === (88)) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (_3 === (98)) { */ case 2: + p.fmt.integer(v, new $Uint64(0, 2), true, "0123456789abcdef"); + $s = 11; continue; + /* } else if (_3 === (99)) { */ case 3: + p.fmtC(v); + $s = 11; continue; + /* } else if ((_3 === (100)) || (_3 === (118))) { */ case 4: + p.fmt.integer(v, new $Uint64(0, 10), true, "0123456789abcdef"); + $s = 11; continue; + /* } else if (_3 === (111)) { */ case 5: + p.fmt.integer(v, new $Uint64(0, 8), true, "0123456789abcdef"); + $s = 11; continue; + /* } else if (_3 === (113)) { */ case 6: + /* */ if ((0 < v.$high || (0 === v.$high && 0 <= v.$low)) && (v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if ((0 < v.$high || (0 === v.$high && 0 <= v.$low)) && (v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { */ case 12: + p.fmt.fmt_qc(v); + $s = 14; continue; + /* } else { */ case 13: + $r = p.badVerb(verb); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 14: + $s = 11; continue; + /* } else if (_3 === (120)) { */ case 7: + p.fmt.integer(v, new $Uint64(0, 16), true, "0123456789abcdef"); + $s = 11; continue; + /* } else if (_3 === (85)) { */ case 8: + p.fmtUnicode(v); + $s = 11; continue; + /* } else if (_3 === (88)) { */ case 9: + p.fmt.integer(v, new $Uint64(0, 16), true, "0123456789ABCDEF"); + $s = 11; continue; + /* } else { */ case 10: + $r = p.badVerb(verb); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 11: + case 1: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtInt64 }; } $f.$ptr = $ptr; $f._3 = _3; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.fmtInt64 = function(v, verb) { return this.$val.fmtInt64(v, verb); }; + pp.ptr.prototype.fmt0x64 = function(v, leading0x) { + var $ptr, leading0x, p, sharp, v; + p = this; + sharp = p.fmt.fmtFlags.sharp; + p.fmt.fmtFlags.sharp = leading0x; + p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 16), false, "0123456789abcdef"); + p.fmt.fmtFlags.sharp = sharp; + }; + pp.prototype.fmt0x64 = function(v, leading0x) { return this.$val.fmt0x64(v, leading0x); }; + pp.ptr.prototype.fmtUnicode = function(v) { + var $ptr, p, prec, precPresent, sharp, v; + p = this; + precPresent = p.fmt.fmtFlags.precPresent; + sharp = p.fmt.fmtFlags.sharp; + p.fmt.fmtFlags.sharp = false; + prec = p.fmt.prec; + if (!precPresent) { + p.fmt.prec = 4; + p.fmt.fmtFlags.precPresent = true; + } + p.fmt.fmtFlags.unicode = true; + p.fmt.fmtFlags.uniQuote = sharp; + p.fmt.integer(v, new $Uint64(0, 16), false, "0123456789ABCDEF"); + p.fmt.fmtFlags.unicode = false; + p.fmt.fmtFlags.uniQuote = false; + p.fmt.prec = prec; + p.fmt.fmtFlags.precPresent = precPresent; + p.fmt.fmtFlags.sharp = sharp; + }; + pp.prototype.fmtUnicode = function(v) { return this.$val.fmtUnicode(v); }; + pp.ptr.prototype.fmtUint64 = function(v, verb) { + var $ptr, _4, p, v, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _4 = $f._4; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + _4 = verb; + /* */ if (_4 === (98)) { $s = 2; continue; } + /* */ if (_4 === (99)) { $s = 3; continue; } + /* */ if (_4 === (100)) { $s = 4; continue; } + /* */ if (_4 === (118)) { $s = 5; continue; } + /* */ if (_4 === (111)) { $s = 6; continue; } + /* */ if (_4 === (113)) { $s = 7; continue; } + /* */ if (_4 === (120)) { $s = 8; continue; } + /* */ if (_4 === (88)) { $s = 9; continue; } + /* */ if (_4 === (85)) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (_4 === (98)) { */ case 2: + p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 2), false, "0123456789abcdef"); + $s = 12; continue; + /* } else if (_4 === (99)) { */ case 3: + p.fmtC(new $Int64(v.$high, v.$low)); + $s = 12; continue; + /* } else if (_4 === (100)) { */ case 4: + p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 10), false, "0123456789abcdef"); + $s = 12; continue; + /* } else if (_4 === (118)) { */ case 5: + if (p.fmt.fmtFlags.sharpV) { + p.fmt0x64(v, true); + } else { + p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 10), false, "0123456789abcdef"); + } + $s = 12; continue; + /* } else if (_4 === (111)) { */ case 6: + p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 8), false, "0123456789abcdef"); + $s = 12; continue; + /* } else if (_4 === (113)) { */ case 7: + /* */ if ((0 < v.$high || (0 === v.$high && 0 <= v.$low)) && (v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if ((0 < v.$high || (0 === v.$high && 0 <= v.$low)) && (v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { */ case 13: + p.fmt.fmt_qc(new $Int64(v.$high, v.$low)); + $s = 15; continue; + /* } else { */ case 14: + $r = p.badVerb(verb); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 15: + $s = 12; continue; + /* } else if (_4 === (120)) { */ case 8: + p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 16), false, "0123456789abcdef"); + $s = 12; continue; + /* } else if (_4 === (88)) { */ case 9: + p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 16), false, "0123456789ABCDEF"); + $s = 12; continue; + /* } else if (_4 === (85)) { */ case 10: + p.fmtUnicode(new $Int64(v.$high, v.$low)); + $s = 12; continue; + /* } else { */ case 11: + $r = p.badVerb(verb); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 12: + case 1: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtUint64 }; } $f.$ptr = $ptr; $f._4 = _4; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.fmtUint64 = function(v, verb) { return this.$val.fmtUint64(v, verb); }; + pp.ptr.prototype.fmtFloat32 = function(v, verb) { + var $ptr, _5, p, v, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _5 = $f._5; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + _5 = verb; + /* */ if (_5 === (98)) { $s = 2; continue; } + /* */ if (_5 === (101)) { $s = 3; continue; } + /* */ if (_5 === (69)) { $s = 4; continue; } + /* */ if ((_5 === (102)) || (_5 === (70))) { $s = 5; continue; } + /* */ if ((_5 === (103)) || (_5 === (118))) { $s = 6; continue; } + /* */ if (_5 === (71)) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (_5 === (98)) { */ case 2: + p.fmt.fmt_fb32(v); + $s = 9; continue; + /* } else if (_5 === (101)) { */ case 3: + p.fmt.fmt_e32(v); + $s = 9; continue; + /* } else if (_5 === (69)) { */ case 4: + p.fmt.fmt_E32(v); + $s = 9; continue; + /* } else if ((_5 === (102)) || (_5 === (70))) { */ case 5: + p.fmt.fmt_f32(v); + $s = 9; continue; + /* } else if ((_5 === (103)) || (_5 === (118))) { */ case 6: + p.fmt.fmt_g32(v); + $s = 9; continue; + /* } else if (_5 === (71)) { */ case 7: + p.fmt.fmt_G32(v); + $s = 9; continue; + /* } else { */ case 8: + $r = p.badVerb(verb); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 9: + case 1: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtFloat32 }; } $f.$ptr = $ptr; $f._5 = _5; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.fmtFloat32 = function(v, verb) { return this.$val.fmtFloat32(v, verb); }; + pp.ptr.prototype.fmtFloat64 = function(v, verb) { + var $ptr, _6, p, v, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _6 = $f._6; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + _6 = verb; + /* */ if (_6 === (98)) { $s = 2; continue; } + /* */ if (_6 === (101)) { $s = 3; continue; } + /* */ if (_6 === (69)) { $s = 4; continue; } + /* */ if ((_6 === (102)) || (_6 === (70))) { $s = 5; continue; } + /* */ if ((_6 === (103)) || (_6 === (118))) { $s = 6; continue; } + /* */ if (_6 === (71)) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (_6 === (98)) { */ case 2: + p.fmt.fmt_fb64(v); + $s = 9; continue; + /* } else if (_6 === (101)) { */ case 3: + p.fmt.fmt_e64(v); + $s = 9; continue; + /* } else if (_6 === (69)) { */ case 4: + p.fmt.fmt_E64(v); + $s = 9; continue; + /* } else if ((_6 === (102)) || (_6 === (70))) { */ case 5: + p.fmt.fmt_f64(v); + $s = 9; continue; + /* } else if ((_6 === (103)) || (_6 === (118))) { */ case 6: + p.fmt.fmt_g64(v); + $s = 9; continue; + /* } else if (_6 === (71)) { */ case 7: + p.fmt.fmt_G64(v); + $s = 9; continue; + /* } else { */ case 8: + $r = p.badVerb(verb); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 9: + case 1: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtFloat64 }; } $f.$ptr = $ptr; $f._6 = _6; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.fmtFloat64 = function(v, verb) { return this.$val.fmtFloat64(v, verb); }; + pp.ptr.prototype.fmtComplex64 = function(v, verb) { + var $ptr, _7, p, v, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _7 = $f._7; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + _7 = verb; + /* */ if ((_7 === (98)) || (_7 === (101)) || (_7 === (69)) || (_7 === (102)) || (_7 === (70)) || (_7 === (103)) || (_7 === (71))) { $s = 2; continue; } + /* */ if (_7 === (118)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if ((_7 === (98)) || (_7 === (101)) || (_7 === (69)) || (_7 === (102)) || (_7 === (70)) || (_7 === (103)) || (_7 === (71))) { */ case 2: + p.fmt.fmt_c64(v, verb); + $s = 5; continue; + /* } else if (_7 === (118)) { */ case 3: + p.fmt.fmt_c64(v, 103); + $s = 5; continue; + /* } else { */ case 4: + $r = p.badVerb(verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 5: + case 1: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtComplex64 }; } $f.$ptr = $ptr; $f._7 = _7; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.fmtComplex64 = function(v, verb) { return this.$val.fmtComplex64(v, verb); }; + pp.ptr.prototype.fmtComplex128 = function(v, verb) { + var $ptr, _8, p, v, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _8 = $f._8; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + _8 = verb; + /* */ if ((_8 === (98)) || (_8 === (101)) || (_8 === (69)) || (_8 === (102)) || (_8 === (70)) || (_8 === (103)) || (_8 === (71))) { $s = 2; continue; } + /* */ if (_8 === (118)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if ((_8 === (98)) || (_8 === (101)) || (_8 === (69)) || (_8 === (102)) || (_8 === (70)) || (_8 === (103)) || (_8 === (71))) { */ case 2: + p.fmt.fmt_c128(v, verb); + $s = 5; continue; + /* } else if (_8 === (118)) { */ case 3: + p.fmt.fmt_c128(v, 103); + $s = 5; continue; + /* } else { */ case 4: + $r = p.badVerb(verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 5: + case 1: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtComplex128 }; } $f.$ptr = $ptr; $f._8 = _8; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.fmtComplex128 = function(v, verb) { return this.$val.fmtComplex128(v, verb); }; + pp.ptr.prototype.fmtString = function(v, verb) { + var $ptr, _9, p, v, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _9 = $f._9; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + _9 = verb; + /* */ if (_9 === (118)) { $s = 2; continue; } + /* */ if (_9 === (115)) { $s = 3; continue; } + /* */ if (_9 === (120)) { $s = 4; continue; } + /* */ if (_9 === (88)) { $s = 5; continue; } + /* */ if (_9 === (113)) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if (_9 === (118)) { */ case 2: + if (p.fmt.fmtFlags.sharpV) { + p.fmt.fmt_q(v); + } else { + p.fmt.fmt_s(v); + } + $s = 8; continue; + /* } else if (_9 === (115)) { */ case 3: + p.fmt.fmt_s(v); + $s = 8; continue; + /* } else if (_9 === (120)) { */ case 4: + p.fmt.fmt_sx(v, "0123456789abcdef"); + $s = 8; continue; + /* } else if (_9 === (88)) { */ case 5: + p.fmt.fmt_sx(v, "0123456789ABCDEF"); + $s = 8; continue; + /* } else if (_9 === (113)) { */ case 6: + p.fmt.fmt_q(v); + $s = 8; continue; + /* } else { */ case 7: + $r = p.badVerb(verb); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 8: + case 1: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtString }; } $f.$ptr = $ptr; $f._9 = _9; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.fmtString = function(v, verb) { return this.$val.fmtString(v, verb); }; + pp.ptr.prototype.fmtBytes = function(v, verb, typ, depth) { + var $ptr, _10, _i, _r$2, _r$3, _r$4, _r$5, _r$6, _ref, c, depth, i, p, typ, v, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _10 = $f._10; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _ref = $f._ref; c = $f.c; depth = $f.depth; i = $f.i; p = $f.p; typ = $f.typ; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + /* */ if ((verb === 118) || (verb === 100)) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ((verb === 118) || (verb === 100)) { */ case 1: + /* */ if (p.fmt.fmtFlags.sharpV) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (p.fmt.fmtFlags.sharpV) { */ case 3: + /* */ if (v === sliceType.nil) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if (v === sliceType.nil) { */ case 6: + /* */ if ($interfaceIsEqual(typ, $ifaceNil)) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if ($interfaceIsEqual(typ, $ifaceNil)) { */ case 8: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("[]byte(nil)"); + $s = 10; continue; + /* } else { */ case 9: + _r$2 = typ.String(); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$2); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilParenBytes); + /* } */ case 10: + return; + /* } */ case 7: + /* */ if ($interfaceIsEqual(typ, $ifaceNil)) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if ($interfaceIsEqual(typ, $ifaceNil)) { */ case 13: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(bytesBytes); + $s = 15; continue; + /* } else { */ case 14: + _r$4 = typ.String(); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$5 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$4); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _r$5; + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); + /* } */ case 15: + $s = 5; continue; + /* } else { */ case 4: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(91); + /* } */ case 5: + _ref = v; + _i = 0; + /* while (true) { */ case 18: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 19; continue; } + i = _i; + c = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (i > 0) { + if (p.fmt.fmtFlags.sharpV) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(commaSpaceBytes); + } else { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); + } + } + _r$6 = p.printArg(new $Uint8(c), 118, depth + 1 >> 0); /* */ $s = 20; case 20: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _r$6; + _i++; + /* } */ $s = 18; continue; case 19: + if (p.fmt.fmtFlags.sharpV) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); + } else { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); + } + return; + /* } */ case 2: + _10 = verb; + /* */ if (_10 === (115)) { $s = 22; continue; } + /* */ if (_10 === (120)) { $s = 23; continue; } + /* */ if (_10 === (88)) { $s = 24; continue; } + /* */ if (_10 === (113)) { $s = 25; continue; } + /* */ $s = 26; continue; + /* if (_10 === (115)) { */ case 22: + p.fmt.fmt_s($bytesToString(v)); + $s = 27; continue; + /* } else if (_10 === (120)) { */ case 23: + p.fmt.fmt_bx(v, "0123456789abcdef"); + $s = 27; continue; + /* } else if (_10 === (88)) { */ case 24: + p.fmt.fmt_bx(v, "0123456789ABCDEF"); + $s = 27; continue; + /* } else if (_10 === (113)) { */ case 25: + p.fmt.fmt_q($bytesToString(v)); + $s = 27; continue; + /* } else { */ case 26: + $r = p.badVerb(verb); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 27: + case 21: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtBytes }; } $f.$ptr = $ptr; $f._10 = _10; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._ref = _ref; $f.c = c; $f.depth = depth; $f.i = i; $f.p = p; $f.typ = typ; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.fmtBytes = function(v, verb, typ, depth) { return this.$val.fmtBytes(v, verb, typ, depth); }; + pp.ptr.prototype.fmtPointer = function(value, verb) { + var $ptr, _11, _12, _r$2, _r$3, p, u, use0x64, value, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _11 = $f._11; _12 = $f._12; _r$2 = $f._r$2; _r$3 = $f._r$3; p = $f.p; u = $f.u; use0x64 = $f.use0x64; value = $f.value; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + value = value; + p = this; + use0x64 = true; + _11 = verb; + /* */ if ((_11 === (112)) || (_11 === (118))) { $s = 2; continue; } + /* */ if ((_11 === (98)) || (_11 === (100)) || (_11 === (111)) || (_11 === (120)) || (_11 === (88))) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if ((_11 === (112)) || (_11 === (118))) { */ case 2: + $s = 5; continue; + /* } else if ((_11 === (98)) || (_11 === (100)) || (_11 === (111)) || (_11 === (120)) || (_11 === (88))) { */ case 3: + use0x64 = false; + $s = 5; continue; + /* } else { */ case 4: + $r = p.badVerb(verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return; + /* } */ case 5: + case 1: + u = 0; + _12 = value.Kind(); + /* */ if ((_12 === (18)) || (_12 === (19)) || (_12 === (21)) || (_12 === (22)) || (_12 === (23)) || (_12 === (26))) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if ((_12 === (18)) || (_12 === (19)) || (_12 === (21)) || (_12 === (22)) || (_12 === (23)) || (_12 === (26))) { */ case 8: + u = value.Pointer(); + $s = 10; continue; + /* } else { */ case 9: + $r = p.badVerb(verb); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return; + /* } */ case 10: + case 7: + /* */ if (p.fmt.fmtFlags.sharpV) { $s = 12; continue; } + /* */ if ((verb === 118) && (u === 0)) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if (p.fmt.fmtFlags.sharpV) { */ case 12: + p.add(40); + _r$2 = value.Type().String(); /* */ $s = 16; case 16: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$2); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + p.add(41); + p.add(40); + if (u === 0) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilBytes); + } else { + p.fmt0x64(new $Uint64(0, u.constructor === Number ? u : 1), true); + } + p.add(41); + $s = 15; continue; + /* } else if ((verb === 118) && (u === 0)) { */ case 13: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); + $s = 15; continue; + /* } else { */ case 14: + /* */ if (use0x64) { $s = 18; continue; } + /* */ $s = 19; continue; + /* if (use0x64) { */ case 18: + p.fmt0x64(new $Uint64(0, u.constructor === Number ? u : 1), !p.fmt.fmtFlags.sharp); + $s = 20; continue; + /* } else { */ case 19: + $r = p.fmtUint64(new $Uint64(0, u.constructor === Number ? u : 1), verb); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 20: + /* } */ case 15: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtPointer }; } $f.$ptr = $ptr; $f._11 = _11; $f._12 = _12; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.p = p; $f.u = u; $f.use0x64 = use0x64; $f.value = value; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.fmtPointer = function(value, verb) { return this.$val.fmtPointer(value, verb); }; + pp.ptr.prototype.catchPanic = function(arg, verb) { + var $ptr, _r$2, _r$3, arg, err, p, v, verb, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; arg = $f.arg; err = $f.err; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + err = $recover(); + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: + _r$2 = reflect.ValueOf(arg); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + v = _r$2; + if ((v.Kind() === 22) && v.IsNil()) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); + return; + } + if (p.panicking) { + $panic(err); + } + p.fmt.clearflags(); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(percentBangBytes); + p.add(verb); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(panicBytes); + p.panicking = true; + _r$3 = p.printArg(err, 118, 0); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + p.panicking = false; + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); + /* } */ case 2: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.catchPanic }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.arg = arg; $f.err = err; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.catchPanic = function(arg, verb) { return this.$val.catchPanic(arg, verb); }; + pp.ptr.prototype.clearSpecialFlags = function() { + var $ptr, p, plusV, sharpV; + plusV = false; + sharpV = false; + p = this; + plusV = p.fmt.fmtFlags.plusV; + if (plusV) { + p.fmt.fmtFlags.plus = true; + p.fmt.fmtFlags.plusV = false; + } + sharpV = p.fmt.fmtFlags.sharpV; + if (sharpV) { + p.fmt.fmtFlags.sharp = true; + p.fmt.fmtFlags.sharpV = false; + } + return [plusV, sharpV]; + }; + pp.prototype.clearSpecialFlags = function() { return this.$val.clearSpecialFlags(); }; + pp.ptr.prototype.restoreSpecialFlags = function(plusV, sharpV) { + var $ptr, p, plusV, sharpV; + p = this; + if (plusV) { + p.fmt.fmtFlags.plus = false; + p.fmt.fmtFlags.plusV = true; + } + if (sharpV) { + p.fmt.fmtFlags.sharp = false; + p.fmt.fmtFlags.sharpV = true; + } + }; + pp.prototype.restoreSpecialFlags = function(plusV, sharpV) { return this.$val.restoreSpecialFlags(plusV, sharpV); }; + pp.ptr.prototype.handleMethods = function(verb, depth) { + var $ptr, _13, _r$2, _r$3, _r$4, _r$5, _r$6, _ref, _tuple, _tuple$1, _tuple$2, depth, formatter, handled, ok, ok$1, p, stringer, v, v$1, verb, $s, $deferred, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _13 = $f._13; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; depth = $f.depth; formatter = $f.formatter; handled = $f.handled; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; stringer = $f.stringer; v = $f.v; v$1 = $f.v$1; verb = $f.verb; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + handled = false; + p = this; + if (p.erroring) { + return handled; + } + _tuple = $assertType(p.arg, Formatter, true); + formatter = _tuple[0]; + ok = _tuple[1]; + /* */ if (ok) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (ok) { */ case 1: + handled = true; + _tuple$1 = p.clearSpecialFlags(); + $deferred.push([$methodVal(p, "restoreSpecialFlags"), [_tuple$1[0], _tuple$1[1]]]); + $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); + $r = formatter.Format(p, verb); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return handled; + /* } */ case 2: + /* */ if (p.fmt.fmtFlags.sharpV) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (p.fmt.fmtFlags.sharpV) { */ case 4: + _tuple$2 = $assertType(p.arg, GoStringer, true); + stringer = _tuple$2[0]; + ok$1 = _tuple$2[1]; + /* */ if (ok$1) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (ok$1) { */ case 7: + handled = true; + $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); + _r$2 = stringer.GoString(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $r = p.fmt.fmt_s(_r$2); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return handled; + /* } */ case 8: + $s = 6; continue; + /* } else { */ case 5: + _13 = verb; + /* */ if ((_13 === (118)) || (_13 === (115)) || (_13 === (120)) || (_13 === (88)) || (_13 === (113))) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if ((_13 === (118)) || (_13 === (115)) || (_13 === (120)) || (_13 === (88)) || (_13 === (113))) { */ case 12: + _ref = p.arg; + /* */ if ($assertType(_ref, $error, true)[1]) { $s = 14; continue; } + /* */ if ($assertType(_ref, Stringer, true)[1]) { $s = 15; continue; } + /* */ $s = 16; continue; + /* if ($assertType(_ref, $error, true)[1]) { */ case 14: + v = _ref; + handled = true; + $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); + _r$3 = v.Error(); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$4 = p.printArg(new $String(_r$3), verb, depth); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$4; + return handled; + /* } else if ($assertType(_ref, Stringer, true)[1]) { */ case 15: + v$1 = _ref; + handled = true; + $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); + _r$5 = v$1.String(); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _r$6 = p.printArg(new $String(_r$5), verb, depth); /* */ $s = 20; case 20: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _r$6; + return handled; + /* } */ case 16: + /* } */ case 13: + case 11: + /* } */ case 6: + handled = false; + return handled; + /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return handled; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: pp.ptr.prototype.handleMethods }; } $f.$ptr = $ptr; $f._13 = _13; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.depth = depth; $f.formatter = formatter; $f.handled = handled; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.stringer = stringer; $f.v = v; $f.v$1 = v$1; $f.verb = verb; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } + }; + pp.prototype.handleMethods = function(verb, depth) { return this.$val.handleMethods(verb, depth); }; + pp.ptr.prototype.printArg = function(arg, verb, depth) { + var $ptr, _14, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, arg, depth, f, f$1, f$10, f$11, f$12, f$13, f$14, f$15, f$16, f$17, f$18, f$19, f$2, f$3, f$4, f$5, f$6, f$7, f$8, f$9, handled, p, verb, wasString, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _14 = $f._14; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _ref = $f._ref; arg = $f.arg; depth = $f.depth; f = $f.f; f$1 = $f.f$1; f$10 = $f.f$10; f$11 = $f.f$11; f$12 = $f.f$12; f$13 = $f.f$13; f$14 = $f.f$14; f$15 = $f.f$15; f$16 = $f.f$16; f$17 = $f.f$17; f$18 = $f.f$18; f$19 = $f.f$19; f$2 = $f.f$2; f$3 = $f.f$3; f$4 = $f.f$4; f$5 = $f.f$5; f$6 = $f.f$6; f$7 = $f.f$7; f$8 = $f.f$8; f$9 = $f.f$9; handled = $f.handled; p = $f.p; verb = $f.verb; wasString = $f.wasString; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + wasString = false; + p = this; + p.arg = arg; + p.value = new reflect.Value.ptr(ptrType.nil, 0, 0); + /* */ if ($interfaceIsEqual(arg, $ifaceNil)) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ($interfaceIsEqual(arg, $ifaceNil)) { */ case 1: + /* */ if ((verb === 84) || (verb === 118)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if ((verb === 84) || (verb === 118)) { */ case 3: + p.fmt.pad(nilAngleBytes); + $s = 5; continue; + /* } else { */ case 4: + $r = p.badVerb(verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 5: + wasString = false; + return wasString; + /* } */ case 2: + _14 = verb; + /* */ if (_14 === (84)) { $s = 8; continue; } + /* */ if (_14 === (112)) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (_14 === (84)) { */ case 8: + _r$2 = reflect.TypeOf(arg).String(); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = p.printArg(new $String(_r$2), 115, 0); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + wasString = false; + return wasString; + /* } else if (_14 === (112)) { */ case 9: + _r$4 = reflect.ValueOf(arg); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + $r = p.fmtPointer(_r$4, verb); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + wasString = false; + return wasString; + /* } */ case 10: + case 7: + _ref = arg; + /* */ if ($assertType(_ref, $Bool, true)[1]) { $s = 15; continue; } + /* */ if ($assertType(_ref, $Float32, true)[1]) { $s = 16; continue; } + /* */ if ($assertType(_ref, $Float64, true)[1]) { $s = 17; continue; } + /* */ if ($assertType(_ref, $Complex64, true)[1]) { $s = 18; continue; } + /* */ if ($assertType(_ref, $Complex128, true)[1]) { $s = 19; continue; } + /* */ if ($assertType(_ref, $Int, true)[1]) { $s = 20; continue; } + /* */ if ($assertType(_ref, $Int8, true)[1]) { $s = 21; continue; } + /* */ if ($assertType(_ref, $Int16, true)[1]) { $s = 22; continue; } + /* */ if ($assertType(_ref, $Int32, true)[1]) { $s = 23; continue; } + /* */ if ($assertType(_ref, $Int64, true)[1]) { $s = 24; continue; } + /* */ if ($assertType(_ref, $Uint, true)[1]) { $s = 25; continue; } + /* */ if ($assertType(_ref, $Uint8, true)[1]) { $s = 26; continue; } + /* */ if ($assertType(_ref, $Uint16, true)[1]) { $s = 27; continue; } + /* */ if ($assertType(_ref, $Uint32, true)[1]) { $s = 28; continue; } + /* */ if ($assertType(_ref, $Uint64, true)[1]) { $s = 29; continue; } + /* */ if ($assertType(_ref, $Uintptr, true)[1]) { $s = 30; continue; } + /* */ if ($assertType(_ref, $String, true)[1]) { $s = 31; continue; } + /* */ if ($assertType(_ref, sliceType, true)[1]) { $s = 32; continue; } + /* */ if ($assertType(_ref, reflect.Value, true)[1]) { $s = 33; continue; } + /* */ $s = 34; continue; + /* if ($assertType(_ref, $Bool, true)[1]) { */ case 15: + f = _ref.$val; + $r = p.fmtBool(f, verb); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Float32, true)[1]) { */ case 16: + f$1 = _ref.$val; + $r = p.fmtFloat32(f$1, verb); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Float64, true)[1]) { */ case 17: + f$2 = _ref.$val; + $r = p.fmtFloat64(f$2, verb); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Complex64, true)[1]) { */ case 18: + f$3 = _ref.$val; + $r = p.fmtComplex64(f$3, verb); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Complex128, true)[1]) { */ case 19: + f$4 = _ref.$val; + $r = p.fmtComplex128(f$4, verb); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Int, true)[1]) { */ case 20: + f$5 = _ref.$val; + $r = p.fmtInt64(new $Int64(0, f$5), verb); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Int8, true)[1]) { */ case 21: + f$6 = _ref.$val; + $r = p.fmtInt64(new $Int64(0, f$6), verb); /* */ $s = 42; case 42: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Int16, true)[1]) { */ case 22: + f$7 = _ref.$val; + $r = p.fmtInt64(new $Int64(0, f$7), verb); /* */ $s = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Int32, true)[1]) { */ case 23: + f$8 = _ref.$val; + $r = p.fmtInt64(new $Int64(0, f$8), verb); /* */ $s = 44; case 44: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Int64, true)[1]) { */ case 24: + f$9 = _ref.$val; + $r = p.fmtInt64(f$9, verb); /* */ $s = 45; case 45: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Uint, true)[1]) { */ case 25: + f$10 = _ref.$val; + $r = p.fmtUint64(new $Uint64(0, f$10), verb); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Uint8, true)[1]) { */ case 26: + f$11 = _ref.$val; + $r = p.fmtUint64(new $Uint64(0, f$11), verb); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Uint16, true)[1]) { */ case 27: + f$12 = _ref.$val; + $r = p.fmtUint64(new $Uint64(0, f$12), verb); /* */ $s = 48; case 48: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Uint32, true)[1]) { */ case 28: + f$13 = _ref.$val; + $r = p.fmtUint64(new $Uint64(0, f$13), verb); /* */ $s = 49; case 49: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Uint64, true)[1]) { */ case 29: + f$14 = _ref.$val; + $r = p.fmtUint64(f$14, verb); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $Uintptr, true)[1]) { */ case 30: + f$15 = _ref.$val; + $r = p.fmtUint64(new $Uint64(0, f$15.constructor === Number ? f$15 : 1), verb); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 35; continue; + /* } else if ($assertType(_ref, $String, true)[1]) { */ case 31: + f$16 = _ref.$val; + $r = p.fmtString(f$16, verb); /* */ $s = 52; case 52: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + wasString = (verb === 115) || (verb === 118); + $s = 35; continue; + /* } else if ($assertType(_ref, sliceType, true)[1]) { */ case 32: + f$17 = _ref.$val; + $r = p.fmtBytes(f$17, verb, $ifaceNil, depth); /* */ $s = 53; case 53: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + wasString = verb === 115; + $s = 35; continue; + /* } else if ($assertType(_ref, reflect.Value, true)[1]) { */ case 33: + f$18 = _ref.$val; + _r$5 = p.printReflectValue(f$18, verb, depth); /* */ $s = 54; case 54: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + wasString = _r$5; + /* */ $s = 55; case 55: + return wasString; + /* } else { */ case 34: + f$19 = _ref; + _r$6 = p.handleMethods(verb, depth); /* */ $s = 56; case 56: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + handled = _r$6; + if (handled) { + wasString = false; + return wasString; + } + _r$7 = reflect.ValueOf(arg); /* */ $s = 57; case 57: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + _r$8 = p.printReflectValue(_r$7, verb, depth); /* */ $s = 58; case 58: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + wasString = _r$8; + /* */ $s = 59; case 59: + return wasString; + /* } */ case 35: + p.arg = $ifaceNil; + return wasString; + /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printArg }; } $f.$ptr = $ptr; $f._14 = _14; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._ref = _ref; $f.arg = arg; $f.depth = depth; $f.f = f; $f.f$1 = f$1; $f.f$10 = f$10; $f.f$11 = f$11; $f.f$12 = f$12; $f.f$13 = f$13; $f.f$14 = f$14; $f.f$15 = f$15; $f.f$16 = f$16; $f.f$17 = f$17; $f.f$18 = f$18; $f.f$19 = f$19; $f.f$2 = f$2; $f.f$3 = f$3; $f.f$4 = f$4; $f.f$5 = f$5; $f.f$6 = f$6; $f.f$7 = f$7; $f.f$8 = f$8; $f.f$9 = f$9; $f.handled = handled; $f.p = p; $f.verb = verb; $f.wasString = wasString; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.printArg = function(arg, verb, depth) { return this.$val.printArg(arg, verb, depth); }; + pp.ptr.prototype.printValue = function(value, verb, depth) { + var $ptr, _15, _r$2, _r$3, _r$4, _r$5, _r$6, depth, handled, p, value, verb, wasString, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _15 = $f._15; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; depth = $f.depth; handled = $f.handled; p = $f.p; value = $f.value; verb = $f.verb; wasString = $f.wasString; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + wasString = false; + value = value; + p = this; + /* */ if (!value.IsValid()) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!value.IsValid()) { */ case 1: + /* */ if ((verb === 84) || (verb === 118)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if ((verb === 84) || (verb === 118)) { */ case 3: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); + $s = 5; continue; + /* } else { */ case 4: + $r = p.badVerb(verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 5: + wasString = false; + return wasString; + /* } */ case 2: + _15 = verb; + /* */ if (_15 === (84)) { $s = 8; continue; } + /* */ if (_15 === (112)) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (_15 === (84)) { */ case 8: + _r$2 = value.Type().String(); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = p.printArg(new $String(_r$2), 115, 0); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + wasString = false; + return wasString; + /* } else if (_15 === (112)) { */ case 9: + $r = p.fmtPointer(value, verb); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + wasString = false; + return wasString; + /* } */ case 10: + case 7: + p.arg = $ifaceNil; + /* */ if (value.CanInterface()) { $s = 14; continue; } + /* */ $s = 15; continue; + /* if (value.CanInterface()) { */ case 14: + _r$4 = value.Interface(); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + p.arg = _r$4; + /* } */ case 15: + _r$5 = p.handleMethods(verb, depth); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + handled = _r$5; + if (handled) { + wasString = false; + return wasString; + } + _r$6 = p.printReflectValue(value, verb, depth); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + wasString = _r$6; + /* */ $s = 19; case 19: + return wasString; + /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printValue }; } $f.$ptr = $ptr; $f._15 = _15; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f.depth = depth; $f.handled = handled; $f.p = p; $f.value = value; $f.verb = verb; $f.wasString = wasString; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.printValue = function(value, verb, depth) { return this.$val.printValue(value, verb, depth); }; + pp.ptr.prototype.printReflectValue = function(value, verb, depth) { + var $ptr, _16, _17, _i, _i$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$25, _r$26, _r$27, _r$28, _r$29, _r$3, _r$30, _r$31, _r$32, _r$33, _r$34, _r$35, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _v, a, bytes, depth, f, f$1, i, i$1, i$2, i$3, key, keys, oldValue, p, t, typ, v, v$1, value, value$1, verb, wasString, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _16 = $f._16; _17 = $f._17; _i = $f._i; _i$1 = $f._i$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$18 = $f._r$18; _r$19 = $f._r$19; _r$2 = $f._r$2; _r$20 = $f._r$20; _r$21 = $f._r$21; _r$22 = $f._r$22; _r$23 = $f._r$23; _r$24 = $f._r$24; _r$25 = $f._r$25; _r$26 = $f._r$26; _r$27 = $f._r$27; _r$28 = $f._r$28; _r$29 = $f._r$29; _r$3 = $f._r$3; _r$30 = $f._r$30; _r$31 = $f._r$31; _r$32 = $f._r$32; _r$33 = $f._r$33; _r$34 = $f._r$34; _r$35 = $f._r$35; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _v = $f._v; a = $f.a; bytes = $f.bytes; depth = $f.depth; f = $f.f; f$1 = $f.f$1; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; key = $f.key; keys = $f.keys; oldValue = $f.oldValue; p = $f.p; t = $f.t; typ = $f.typ; v = $f.v; v$1 = $f.v$1; value = $f.value; value$1 = $f.value$1; verb = $f.verb; wasString = $f.wasString; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + wasString = false; + value = value; + p = this; + oldValue = p.value; + p.value = value; + f = value; + _16 = f.Kind(); + /* */ if (_16 === (0)) { $s = 2; continue; } + /* */ if (_16 === (1)) { $s = 3; continue; } + /* */ if ((_16 === (2)) || (_16 === (3)) || (_16 === (4)) || (_16 === (5)) || (_16 === (6))) { $s = 4; continue; } + /* */ if ((_16 === (7)) || (_16 === (8)) || (_16 === (9)) || (_16 === (10)) || (_16 === (11)) || (_16 === (12))) { $s = 5; continue; } + /* */ if ((_16 === (13)) || (_16 === (14))) { $s = 6; continue; } + /* */ if ((_16 === (15)) || (_16 === (16))) { $s = 7; continue; } + /* */ if (_16 === (24)) { $s = 8; continue; } + /* */ if (_16 === (21)) { $s = 9; continue; } + /* */ if (_16 === (25)) { $s = 10; continue; } + /* */ if (_16 === (20)) { $s = 11; continue; } + /* */ if ((_16 === (17)) || (_16 === (23))) { $s = 12; continue; } + /* */ if (_16 === (22)) { $s = 13; continue; } + /* */ if ((_16 === (18)) || (_16 === (19)) || (_16 === (26))) { $s = 14; continue; } + /* */ $s = 15; continue; + /* if (_16 === (0)) { */ case 2: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); + $s = 16; continue; + /* } else if (_16 === (1)) { */ case 3: + $r = p.fmtBool(f.Bool(), verb); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 16; continue; + /* } else if ((_16 === (2)) || (_16 === (3)) || (_16 === (4)) || (_16 === (5)) || (_16 === (6))) { */ case 4: + $r = p.fmtInt64(f.Int(), verb); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 16; continue; + /* } else if ((_16 === (7)) || (_16 === (8)) || (_16 === (9)) || (_16 === (10)) || (_16 === (11)) || (_16 === (12))) { */ case 5: + $r = p.fmtUint64(f.Uint(), verb); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 16; continue; + /* } else if ((_16 === (13)) || (_16 === (14))) { */ case 6: + _r$2 = f.Type().Size(); /* */ $s = 23; case 23: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ if (_r$2 === 4) { $s = 20; continue; } + /* */ $s = 21; continue; + /* if (_r$2 === 4) { */ case 20: + $r = p.fmtFloat32($fround(f.Float()), verb); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 22; continue; + /* } else { */ case 21: + $r = p.fmtFloat64(f.Float(), verb); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 22: + $s = 16; continue; + /* } else if ((_16 === (15)) || (_16 === (16))) { */ case 7: + _r$3 = f.Type().Size(); /* */ $s = 29; case 29: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (_r$3 === 8) { $s = 26; continue; } + /* */ $s = 27; continue; + /* if (_r$3 === 8) { */ case 26: + $r = p.fmtComplex64((x = f.Complex(), new $Complex64(x.$real, x.$imag)), verb); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 28; continue; + /* } else { */ case 27: + $r = p.fmtComplex128(f.Complex(), verb); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 28: + $s = 16; continue; + /* } else if (_16 === (24)) { */ case 8: + _r$4 = f.String(); /* */ $s = 32; case 32: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + $r = p.fmtString(_r$4, verb); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 16; continue; + /* } else if (_16 === (21)) { */ case 9: + /* */ if (p.fmt.fmtFlags.sharpV) { $s = 34; continue; } + /* */ $s = 35; continue; + /* if (p.fmt.fmtFlags.sharpV) { */ case 34: + _r$5 = f.Type().String(); /* */ $s = 37; case 37: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _r$6 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$5); /* */ $s = 38; case 38: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _r$6; + if (f.IsNil()) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); + /* break; */ $s = 1; continue; + } + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); + $s = 36; continue; + /* } else { */ case 35: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(mapBytes); + /* } */ case 36: + _r$7 = f.MapKeys(); /* */ $s = 39; case 39: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + keys = _r$7; + _ref = keys; + _i = 0; + /* while (true) { */ case 40: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 41; continue; } + i = _i; + key = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (i > 0) { + if (p.fmt.fmtFlags.sharpV) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(commaSpaceBytes); + } else { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); + } + } + _r$8 = p.printValue(key, verb, depth + 1 >> 0); /* */ $s = 42; case 42: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + _r$8; + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(58); + _r$9 = f.MapIndex(key); /* */ $s = 43; case 43: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + _r$10 = p.printValue(_r$9, verb, depth + 1 >> 0); /* */ $s = 44; case 44: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } + _r$10; + _i++; + /* } */ $s = 40; continue; case 41: + if (p.fmt.fmtFlags.sharpV) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); + } else { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); + } + $s = 16; continue; + /* } else if (_16 === (25)) { */ case 10: + /* */ if (p.fmt.fmtFlags.sharpV) { $s = 45; continue; } + /* */ $s = 46; continue; + /* if (p.fmt.fmtFlags.sharpV) { */ case 45: + _r$11 = value.Type().String(); /* */ $s = 47; case 47: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } + _r$12 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$11); /* */ $s = 48; case 48: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } + _r$12; + /* } */ case 46: + p.add(123); + v = f; + t = v.Type(); + i$1 = 0; + /* while (true) { */ case 49: + /* if (!(i$1 < v.NumField())) { break; } */ if(!(i$1 < v.NumField())) { $s = 50; continue; } + if (i$1 > 0) { + if (p.fmt.fmtFlags.sharpV) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(commaSpaceBytes); + } else { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); + } + } + /* */ if (p.fmt.fmtFlags.plusV || p.fmt.fmtFlags.sharpV) { $s = 51; continue; } + /* */ $s = 52; continue; + /* if (p.fmt.fmtFlags.plusV || p.fmt.fmtFlags.sharpV) { */ case 51: + _r$13 = t.Field(i$1); /* */ $s = 53; case 53: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } + f$1 = $clone(_r$13, reflect.StructField); + if (!(f$1.Name === "")) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(f$1.Name); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(58); + } + /* } */ case 52: + _r$14 = getField(v, i$1); /* */ $s = 54; case 54: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } + _r$15 = p.printValue(_r$14, verb, depth + 1 >> 0); /* */ $s = 55; case 55: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } + _r$15; + i$1 = i$1 + (1) >> 0; + /* } */ $s = 49; continue; case 50: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); + $s = 16; continue; + /* } else if (_16 === (20)) { */ case 11: + _r$16 = f.Elem(); /* */ $s = 56; case 56: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } + value$1 = _r$16; + /* */ if (!value$1.IsValid()) { $s = 57; continue; } + /* */ $s = 58; continue; + /* if (!value$1.IsValid()) { */ case 57: + /* */ if (p.fmt.fmtFlags.sharpV) { $s = 60; continue; } + /* */ $s = 61; continue; + /* if (p.fmt.fmtFlags.sharpV) { */ case 60: + _r$17 = f.Type().String(); /* */ $s = 63; case 63: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } + _r$18 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$17); /* */ $s = 64; case 64: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } + _r$18; + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilParenBytes); + $s = 62; continue; + /* } else { */ case 61: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); + /* } */ case 62: + $s = 59; continue; + /* } else { */ case 58: + _r$19 = p.printValue(value$1, verb, depth + 1 >> 0); /* */ $s = 65; case 65: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } + wasString = _r$19; + /* } */ case 59: + $s = 16; continue; + /* } else if ((_16 === (17)) || (_16 === (23))) { */ case 12: + typ = f.Type(); + _r$20 = typ.Elem(); /* */ $s = 69; case 69: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } + _r$21 = _r$20.Kind(); /* */ $s = 70; case 70: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } + if (!(_r$21 === 8)) { _v = false; $s = 68; continue s; } + _r$22 = typ.Elem(); /* */ $s = 71; case 71: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } + _v = $interfaceIsEqual(_r$22, byteType) || (verb === 115) || (verb === 113) || (verb === 120); case 68: + /* */ if (_v) { $s = 66; continue; } + /* */ $s = 67; continue; + /* if (_v) { */ case 66: + bytes = sliceType.nil; + /* */ if (f.Kind() === 23) { $s = 72; continue; } + /* */ if (f.CanAddr()) { $s = 73; continue; } + /* */ $s = 74; continue; + /* if (f.Kind() === 23) { */ case 72: + _r$23 = f.Bytes(); /* */ $s = 76; case 76: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } + bytes = _r$23; + $s = 75; continue; + /* } else if (f.CanAddr()) { */ case 73: + _r$24 = f.Slice(0, f.Len()); /* */ $s = 77; case 77: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } + _r$25 = _r$24.Bytes(); /* */ $s = 78; case 78: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } + bytes = _r$25; + $s = 75; continue; + /* } else { */ case 74: + bytes = $makeSlice(sliceType, f.Len()); + _ref$1 = bytes; + _i$1 = 0; + /* while (true) { */ case 79: + /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 80; continue; } + i$2 = _i$1; + _r$26 = f.Index(i$2); /* */ $s = 81; case 81: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } + _r$27 = _r$26.Uint(); /* */ $s = 82; case 82: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } + ((i$2 < 0 || i$2 >= bytes.$length) ? $throwRuntimeError("index out of range") : bytes.$array[bytes.$offset + i$2] = (_r$27.$low << 24 >>> 24)); + _i$1++; + /* } */ $s = 79; continue; case 80: + /* } */ case 75: + $r = p.fmtBytes(bytes, verb, typ, depth); /* */ $s = 83; case 83: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + wasString = verb === 115; + /* break; */ $s = 1; continue; + /* } */ case 67: + /* */ if (p.fmt.fmtFlags.sharpV) { $s = 84; continue; } + /* */ $s = 85; continue; + /* if (p.fmt.fmtFlags.sharpV) { */ case 84: + _r$28 = value.Type().String(); /* */ $s = 87; case 87: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } + _r$29 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$28); /* */ $s = 88; case 88: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } + _r$29; + if ((f.Kind() === 23) && f.IsNil()) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); + /* break; */ $s = 1; continue; + } + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); + $s = 86; continue; + /* } else { */ case 85: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(91); + /* } */ case 86: + i$3 = 0; + /* while (true) { */ case 89: + /* if (!(i$3 < f.Len())) { break; } */ if(!(i$3 < f.Len())) { $s = 90; continue; } + if (i$3 > 0) { + if (p.fmt.fmtFlags.sharpV) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(commaSpaceBytes); + } else { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); + } + } + _r$30 = f.Index(i$3); /* */ $s = 91; case 91: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } + _r$31 = p.printValue(_r$30, verb, depth + 1 >> 0); /* */ $s = 92; case 92: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } + _r$31; + i$3 = i$3 + (1) >> 0; + /* } */ $s = 89; continue; case 90: + if (p.fmt.fmtFlags.sharpV) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); + } else { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); + } + $s = 16; continue; + /* } else if (_16 === (22)) { */ case 13: + v$1 = f.Pointer(); + /* */ if (!((v$1 === 0)) && (depth === 0)) { $s = 93; continue; } + /* */ $s = 94; continue; + /* if (!((v$1 === 0)) && (depth === 0)) { */ case 93: + _r$32 = f.Elem(); /* */ $s = 96; case 96: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } + a = _r$32; + _17 = a.Kind(); + /* */ if ((_17 === (17)) || (_17 === (23))) { $s = 97; continue; } + /* */ if (_17 === (25)) { $s = 98; continue; } + /* */ if (_17 === (21)) { $s = 99; continue; } + /* */ $s = 100; continue; + /* if ((_17 === (17)) || (_17 === (23))) { */ case 97: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(38); + _r$33 = p.printValue(a, verb, depth + 1 >> 0); /* */ $s = 101; case 101: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } + _r$33; + /* break BigSwitch; */ $s = 1; continue s; + $s = 100; continue; + /* } else if (_17 === (25)) { */ case 98: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(38); + _r$34 = p.printValue(a, verb, depth + 1 >> 0); /* */ $s = 102; case 102: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; } + _r$34; + /* break BigSwitch; */ $s = 1; continue s; + $s = 100; continue; + /* } else if (_17 === (21)) { */ case 99: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(38); + _r$35 = p.printValue(a, verb, depth + 1 >> 0); /* */ $s = 103; case 103: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; } + _r$35; + /* break BigSwitch; */ $s = 1; continue s; + /* } */ case 100: + case 95: + /* } */ case 94: + $r = p.fmtPointer(value, verb); /* */ $s = 104; case 104: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 16; continue; + /* } else if ((_16 === (18)) || (_16 === (19)) || (_16 === (26))) { */ case 14: + $r = p.fmtPointer(value, verb); /* */ $s = 105; case 105: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 16; continue; + /* } else { */ case 15: + $r = p.unknownType(f); /* */ $s = 106; case 106: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 16: + case 1: + p.value = oldValue; + wasString = wasString; + return wasString; + /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printReflectValue }; } $f.$ptr = $ptr; $f._16 = _16; $f._17 = _17; $f._i = _i; $f._i$1 = _i$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$18 = _r$18; $f._r$19 = _r$19; $f._r$2 = _r$2; $f._r$20 = _r$20; $f._r$21 = _r$21; $f._r$22 = _r$22; $f._r$23 = _r$23; $f._r$24 = _r$24; $f._r$25 = _r$25; $f._r$26 = _r$26; $f._r$27 = _r$27; $f._r$28 = _r$28; $f._r$29 = _r$29; $f._r$3 = _r$3; $f._r$30 = _r$30; $f._r$31 = _r$31; $f._r$32 = _r$32; $f._r$33 = _r$33; $f._r$34 = _r$34; $f._r$35 = _r$35; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._v = _v; $f.a = a; $f.bytes = bytes; $f.depth = depth; $f.f = f; $f.f$1 = f$1; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.key = key; $f.keys = keys; $f.oldValue = oldValue; $f.p = p; $f.t = t; $f.typ = typ; $f.v = v; $f.v$1 = v$1; $f.value = value; $f.value$1 = value$1; $f.verb = verb; $f.wasString = wasString; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.printReflectValue = function(value, verb, depth) { return this.$val.printReflectValue(value, verb, depth); }; + intFromArg = function(a, argNum) { + var $ptr, _18, _r$2, _tuple, a, argNum, isInt, n, n$1, newArgNum, num, v, x, x$1, x$2, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _18 = $f._18; _r$2 = $f._r$2; _tuple = $f._tuple; a = $f.a; argNum = $f.argNum; isInt = $f.isInt; n = $f.n; n$1 = $f.n$1; newArgNum = $f.newArgNum; num = $f.num; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + num = 0; + isInt = false; + newArgNum = 0; + newArgNum = argNum; + /* */ if (argNum < a.$length) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (argNum < a.$length) { */ case 1: + _tuple = $assertType(((argNum < 0 || argNum >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + argNum]), $Int, true); + num = _tuple[0]; + isInt = _tuple[1]; + /* */ if (!isInt) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (!isInt) { */ case 3: + _r$2 = reflect.ValueOf(((argNum < 0 || argNum >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + argNum])); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + v = _r$2; + _18 = v.Kind(); + if ((_18 === (2)) || (_18 === (3)) || (_18 === (4)) || (_18 === (5)) || (_18 === (6))) { + n = v.Int(); + if ((x = new $Int64(0, ((n.$low + ((n.$high >> 31) * 4294967296)) >> 0)), (x.$high === n.$high && x.$low === n.$low))) { + num = ((n.$low + ((n.$high >> 31) * 4294967296)) >> 0); + isInt = true; + } + } else if ((_18 === (7)) || (_18 === (8)) || (_18 === (9)) || (_18 === (10)) || (_18 === (11)) || (_18 === (12))) { + n$1 = v.Uint(); + if ((x$1 = new $Int64(n$1.$high, n$1.$low), (x$1.$high > 0 || (x$1.$high === 0 && x$1.$low >= 0))) && (x$2 = new $Uint64(0, (n$1.$low >> 0)), (x$2.$high === n$1.$high && x$2.$low === n$1.$low))) { + num = (n$1.$low >> 0); + isInt = true; + } + } + case 5: + /* } */ case 4: + newArgNum = argNum + 1 >> 0; + if (tooLarge(num)) { + num = 0; + isInt = false; + } + /* } */ case 2: + return [num, isInt, newArgNum]; + /* */ } return; } if ($f === undefined) { $f = { $blk: intFromArg }; } $f.$ptr = $ptr; $f._18 = _18; $f._r$2 = _r$2; $f._tuple = _tuple; $f.a = a; $f.argNum = argNum; $f.isInt = isInt; $f.n = n; $f.n$1 = n$1; $f.newArgNum = newArgNum; $f.num = num; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; + }; + parseArgNumber = function(format) { + var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, format, i, index, newi, ok, ok$1, wid, width; + index = 0; + wid = 0; + ok = false; + if (format.length < 3) { + _tmp = 0; + _tmp$1 = 1; + _tmp$2 = false; + index = _tmp; + wid = _tmp$1; + ok = _tmp$2; + return [index, wid, ok]; + } + i = 1; + while (true) { + if (!(i < format.length)) { break; } + if (format.charCodeAt(i) === 93) { + _tuple = parsenum(format, 1, i); + width = _tuple[0]; + ok$1 = _tuple[1]; + newi = _tuple[2]; + if (!ok$1 || !((newi === i))) { + _tmp$3 = 0; + _tmp$4 = i + 1 >> 0; + _tmp$5 = false; + index = _tmp$3; + wid = _tmp$4; + ok = _tmp$5; + return [index, wid, ok]; + } + _tmp$6 = width - 1 >> 0; + _tmp$7 = i + 1 >> 0; + _tmp$8 = true; + index = _tmp$6; + wid = _tmp$7; + ok = _tmp$8; + return [index, wid, ok]; + } + i = i + (1) >> 0; + } + _tmp$9 = 0; + _tmp$10 = 1; + _tmp$11 = false; + index = _tmp$9; + wid = _tmp$10; + ok = _tmp$11; + return [index, wid, ok]; + }; + pp.ptr.prototype.argNumber = function(argNum, format, i, numArgs) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tuple, argNum, format, found, i, index, newArgNum, newi, numArgs, ok, p, wid; + newArgNum = 0; + newi = 0; + found = false; + p = this; + if (format.length <= i || !((format.charCodeAt(i) === 91))) { + _tmp = argNum; + _tmp$1 = i; + _tmp$2 = false; + newArgNum = _tmp; + newi = _tmp$1; + found = _tmp$2; + return [newArgNum, newi, found]; + } + p.reordered = true; + _tuple = parseArgNumber(format.substring(i)); + index = _tuple[0]; + wid = _tuple[1]; + ok = _tuple[2]; + if (ok && 0 <= index && index < numArgs) { + _tmp$3 = index; + _tmp$4 = i + wid >> 0; + _tmp$5 = true; + newArgNum = _tmp$3; + newi = _tmp$4; + found = _tmp$5; + return [newArgNum, newi, found]; + } + p.goodArgNum = false; + _tmp$6 = argNum; + _tmp$7 = i + wid >> 0; + _tmp$8 = ok; + newArgNum = _tmp$6; + newi = _tmp$7; + found = _tmp$8; + return [newArgNum, newi, found]; + }; + pp.prototype.argNumber = function(argNum, format, i, numArgs) { return this.$val.argNumber(argNum, format, i, numArgs); }; + pp.ptr.prototype.doPrintf = function(format, a) { + var $ptr, _19, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, a, afterIndex, arg, arg$1, argNum, c, end, format, i, lasti, p, w, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _19 = $f._19; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; a = $f.a; afterIndex = $f.afterIndex; arg = $f.arg; arg$1 = $f.arg$1; argNum = $f.argNum; c = $f.c; end = $f.end; format = $f.format; i = $f.i; lasti = $f.lasti; p = $f.p; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + end = format.length; + argNum = 0; + afterIndex = false; + p.reordered = false; + i = 0; + /* while (true) { */ case 1: + /* if (!(i < end)) { break; } */ if(!(i < end)) { $s = 2; continue; } + p.goodArgNum = true; + lasti = i; + while (true) { + if (!(i < end && !((format.charCodeAt(i) === 37)))) { break; } + i = i + (1) >> 0; + } + if (i > lasti) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(format.substring(lasti, i)); + } + if (i >= end) { + /* break; */ $s = 2; continue; + } + i = i + (1) >> 0; + p.fmt.clearflags(); + F: + while (true) { + if (!(i < end)) { break; } + _19 = format.charCodeAt(i); + if (_19 === (35)) { + p.fmt.fmtFlags.sharp = true; + } else if (_19 === (48)) { + p.fmt.fmtFlags.zero = true; + } else if (_19 === (43)) { + p.fmt.fmtFlags.plus = true; + } else if (_19 === (45)) { + p.fmt.fmtFlags.minus = true; + } else if (_19 === (32)) { + p.fmt.fmtFlags.space = true; + } else { + break F; + } + i = i + (1) >> 0; + } + _tuple = p.argNumber(argNum, format, i, a.$length); + argNum = _tuple[0]; + i = _tuple[1]; + afterIndex = _tuple[2]; + /* */ if (i < end && (format.charCodeAt(i) === 42)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (i < end && (format.charCodeAt(i) === 42)) { */ case 3: + i = i + (1) >> 0; + _r$2 = intFromArg(a, argNum); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$1 = _r$2; + p.fmt.wid = _tuple$1[0]; + p.fmt.fmtFlags.widPresent = _tuple$1[1]; + argNum = _tuple$1[2]; + if (!p.fmt.fmtFlags.widPresent) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(badWidthBytes); + } + if (p.fmt.wid < 0) { + p.fmt.wid = -p.fmt.wid; + p.fmt.fmtFlags.minus = true; + } + afterIndex = false; + $s = 5; continue; + /* } else { */ case 4: + _tuple$2 = parsenum(format, i, end); + p.fmt.wid = _tuple$2[0]; + p.fmt.fmtFlags.widPresent = _tuple$2[1]; + i = _tuple$2[2]; + if (afterIndex && p.fmt.fmtFlags.widPresent) { + p.goodArgNum = false; + } + /* } */ case 5: + /* */ if ((i + 1 >> 0) < end && (format.charCodeAt(i) === 46)) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if ((i + 1 >> 0) < end && (format.charCodeAt(i) === 46)) { */ case 7: + i = i + (1) >> 0; + if (afterIndex) { + p.goodArgNum = false; + } + _tuple$3 = p.argNumber(argNum, format, i, a.$length); + argNum = _tuple$3[0]; + i = _tuple$3[1]; + afterIndex = _tuple$3[2]; + /* */ if (i < end && (format.charCodeAt(i) === 42)) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (i < end && (format.charCodeAt(i) === 42)) { */ case 9: + i = i + (1) >> 0; + _r$3 = intFromArg(a, argNum); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple$4 = _r$3; + p.fmt.prec = _tuple$4[0]; + p.fmt.fmtFlags.precPresent = _tuple$4[1]; + argNum = _tuple$4[2]; + if (p.fmt.prec < 0) { + p.fmt.prec = 0; + p.fmt.fmtFlags.precPresent = false; + } + if (!p.fmt.fmtFlags.precPresent) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(badPrecBytes); + } + afterIndex = false; + $s = 11; continue; + /* } else { */ case 10: + _tuple$5 = parsenum(format, i, end); + p.fmt.prec = _tuple$5[0]; + p.fmt.fmtFlags.precPresent = _tuple$5[1]; + i = _tuple$5[2]; + if (!p.fmt.fmtFlags.precPresent) { + p.fmt.prec = 0; + p.fmt.fmtFlags.precPresent = true; + } + /* } */ case 11: + /* } */ case 8: + if (!afterIndex) { + _tuple$6 = p.argNumber(argNum, format, i, a.$length); + argNum = _tuple$6[0]; + i = _tuple$6[1]; + afterIndex = _tuple$6[2]; + } + /* */ if (i >= end) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if (i >= end) { */ case 13: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(noVerbBytes); + /* continue; */ $s = 1; continue; + /* } */ case 14: + _tuple$7 = utf8.DecodeRuneInString(format.substring(i)); + c = _tuple$7[0]; + w = _tuple$7[1]; + i = i + (w) >> 0; + /* */ if (c === 37) { $s = 15; continue; } + /* */ $s = 16; continue; + /* if (c === 37) { */ case 15: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(37); + /* continue; */ $s = 1; continue; + /* } */ case 16: + /* */ if (!p.goodArgNum) { $s = 17; continue; } + /* */ if (argNum >= a.$length) { $s = 18; continue; } + /* */ $s = 19; continue; + /* if (!p.goodArgNum) { */ case 17: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(percentBangBytes); + p.add(c); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(badIndexBytes); + /* continue; */ $s = 1; continue; + $s = 19; continue; + /* } else if (argNum >= a.$length) { */ case 18: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(percentBangBytes); + p.add(c); + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(missingBytes); + /* continue; */ $s = 1; continue; + /* } */ case 19: + arg = ((argNum < 0 || argNum >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + argNum]); + argNum = argNum + (1) >> 0; + if (c === 118) { + if (p.fmt.fmtFlags.sharp) { + p.fmt.fmtFlags.sharp = false; + p.fmt.fmtFlags.sharpV = true; + } + if (p.fmt.fmtFlags.plus) { + p.fmt.fmtFlags.plus = false; + p.fmt.fmtFlags.plusV = true; + } + } + _r$4 = p.printArg(arg, c, 0); /* */ $s = 20; case 20: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$4; + /* } */ $s = 1; continue; case 2: + /* */ if (!p.reordered && argNum < a.$length) { $s = 21; continue; } + /* */ $s = 22; continue; + /* if (!p.reordered && argNum < a.$length) { */ case 21: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(extraBytes); + /* while (true) { */ case 23: + /* if (!(argNum < a.$length)) { break; } */ if(!(argNum < a.$length)) { $s = 24; continue; } + arg$1 = ((argNum < 0 || argNum >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + argNum]); + /* */ if (!($interfaceIsEqual(arg$1, $ifaceNil))) { $s = 25; continue; } + /* */ $s = 26; continue; + /* if (!($interfaceIsEqual(arg$1, $ifaceNil))) { */ case 25: + _r$5 = reflect.TypeOf(arg$1).String(); /* */ $s = 27; case 27: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _r$6 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$5); /* */ $s = 28; case 28: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _r$6; + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(61); + /* } */ case 26: + _r$7 = p.printArg(arg$1, 118, 0); /* */ $s = 29; case 29: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + _r$7; + if ((argNum + 1 >> 0) < a.$length) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(commaSpaceBytes); + } + argNum = argNum + (1) >> 0; + /* } */ $s = 23; continue; case 24: + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); + /* } */ case 22: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrintf }; } $f.$ptr = $ptr; $f._19 = _19; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f.a = a; $f.afterIndex = afterIndex; $f.arg = arg; $f.arg$1 = arg$1; $f.argNum = argNum; $f.c = c; $f.end = end; $f.format = format; $f.i = i; $f.lasti = lasti; $f.p = p; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.doPrintf = function(format, a) { return this.$val.doPrintf(format, a); }; + pp.ptr.prototype.doPrint = function(a, addspace, addnewline) { + var $ptr, _r$2, _r$3, _v, a, addnewline, addspace, arg, argNum, isString, p, prevString, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _v = $f._v; a = $f.a; addnewline = $f.addnewline; addspace = $f.addspace; arg = $f.arg; argNum = $f.argNum; isString = $f.isString; p = $f.p; prevString = $f.prevString; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + prevString = false; + argNum = 0; + /* while (true) { */ case 1: + /* if (!(argNum < a.$length)) { break; } */ if(!(argNum < a.$length)) { $s = 2; continue; } + p.fmt.clearflags(); + arg = ((argNum < 0 || argNum >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + argNum]); + /* */ if (argNum > 0) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (argNum > 0) { */ case 3: + if (!(!($interfaceIsEqual(arg, $ifaceNil)))) { _v = false; $s = 5; continue s; } + _r$2 = reflect.TypeOf(arg).Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v = _r$2 === 24; case 5: + isString = _v; + if (addspace || !isString && !prevString) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); + } + /* } */ case 4: + _r$3 = p.printArg(arg, 118, 0); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + prevString = _r$3; + argNum = argNum + (1) >> 0; + /* } */ $s = 1; continue; case 2: + if (addnewline) { + (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(10); + } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrint }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._v = _v; $f.a = a; $f.addnewline = addnewline; $f.addspace = addspace; $f.arg = arg; $f.argNum = argNum; $f.isString = isString; $f.p = p; $f.prevString = prevString; $f.$s = $s; $f.$r = $r; return $f; + }; + pp.prototype.doPrint = function(a, addspace, addnewline) { return this.$val.doPrint(a, addspace, addnewline); }; + ss.ptr.prototype.Read = function(buf) { + var $ptr, _tmp, _tmp$1, buf, err, n, s; + n = 0; + err = $ifaceNil; + s = this; + _tmp = 0; + _tmp$1 = errors.New("ScanState's Read should not be called. Use ReadRune"); + n = _tmp; + err = _tmp$1; + return [n, err]; + }; + ss.prototype.Read = function(buf) { return this.$val.Read(buf); }; + ss.ptr.prototype.ReadRune = function() { + var $ptr, _r$2, _tuple, err, r, s, size, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _tuple = $f._tuple; err = $f.err; r = $f.r; s = $f.s; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = 0; + size = 0; + err = $ifaceNil; + s = this; + if (s.peekRune >= 0) { + s.count = s.count + (1) >> 0; + r = s.peekRune; + size = utf8.RuneLen(r); + s.prevRune = r; + s.peekRune = -1; + return [r, size, err]; + } + if (s.atEOF || s.ssave.nlIsEnd && (s.prevRune === 10) || s.count >= s.ssave.argLimit) { + err = io.EOF; + return [r, size, err]; + } + _r$2 = s.rr.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple = _r$2; + r = _tuple[0]; + size = _tuple[1]; + err = _tuple[2]; + if ($interfaceIsEqual(err, $ifaceNil)) { + s.count = s.count + (1) >> 0; + s.prevRune = r; + } else if ($interfaceIsEqual(err, io.EOF)) { + s.atEOF = true; + } + return [r, size, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.ReadRune }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._tuple = _tuple; $f.err = err; $f.r = r; $f.s = s; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; + }; + ss.prototype.ReadRune = function() { return this.$val.ReadRune(); }; + ss.ptr.prototype.Width = function() { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, ok, s, wid; + wid = 0; + ok = false; + s = this; + if (s.ssave.maxWid === 1073741824) { + _tmp = 0; + _tmp$1 = false; + wid = _tmp; + ok = _tmp$1; + return [wid, ok]; + } + _tmp$2 = s.ssave.maxWid; + _tmp$3 = true; + wid = _tmp$2; + ok = _tmp$3; + return [wid, ok]; + }; + ss.prototype.Width = function() { return this.$val.Width(); }; + ss.ptr.prototype.getRune = function() { + var $ptr, _r$2, _tuple, err, r, s, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _tuple = $f._tuple; err = $f.err; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = 0; + s = this; + _r$2 = s.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple = _r$2; + r = _tuple[0]; + err = _tuple[2]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + if ($interfaceIsEqual(err, io.EOF)) { + r = -1; + return r; + } + s.error(err); + } + return r; + /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.getRune }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._tuple = _tuple; $f.err = err; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; + }; + ss.prototype.getRune = function() { return this.$val.getRune(); }; + ss.ptr.prototype.UnreadRune = function() { + var $ptr, _r$2, _tuple, ok, s, u, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _tuple = $f._tuple; ok = $f.ok; s = $f.s; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + s = this; + _tuple = $assertType(s.rr, runeUnreader, true); + u = _tuple[0]; + ok = _tuple[1]; + /* */ if (ok) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (ok) { */ case 1: + _r$2 = u.UnreadRune(); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$2; + $s = 3; continue; + /* } else { */ case 2: + s.peekRune = s.prevRune; + /* } */ case 3: + s.prevRune = -1; + s.count = s.count - (1) >> 0; + return $ifaceNil; + /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.UnreadRune }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._tuple = _tuple; $f.ok = ok; $f.s = s; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; + }; + ss.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; + ss.ptr.prototype.error = function(err) { + var $ptr, err, s, x; + s = this; + $panic((x = new scanError.ptr(err), new x.constructor.elem(x))); + }; + ss.prototype.error = function(err) { return this.$val.error(err); }; + ss.ptr.prototype.errorString = function(err) { + var $ptr, err, s, x; + s = this; + $panic((x = new scanError.ptr(errors.New(err)), new x.constructor.elem(x))); + }; + ss.prototype.errorString = function(err) { return this.$val.errorString(err); }; + ss.ptr.prototype.Token = function(skipSpace, f) { + var $ptr, _r$2, err, f, s, skipSpace, tok, $s, $deferred, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; err = $f.err; f = $f.f; s = $f.s; skipSpace = $f.skipSpace; tok = $f.tok; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + err = [err]; + tok = sliceType.nil; + err[0] = $ifaceNil; + s = this; + $deferred.push([(function(err) { return function() { + var $ptr, _tuple, e, ok, se; + e = $recover(); + if (!($interfaceIsEqual(e, $ifaceNil))) { + _tuple = $assertType(e, scanError, true); + se = $clone(_tuple[0], scanError); + ok = _tuple[1]; + if (ok) { + err[0] = se.err; + } else { + $panic(e); + } + } + }; })(err), []]); + if (f === $throwNilPointerError) { + f = notSpace; + } + s.buf = $subslice(s.buf, 0, 0); + _r$2 = s.token(skipSpace, f); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + tok = _r$2; + return [tok, err[0]]; + /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [tok, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: ss.ptr.prototype.Token }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.err = err; $f.f = f; $f.s = s; $f.skipSpace = skipSpace; $f.tok = tok; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } + }; + ss.prototype.Token = function(skipSpace, f) { return this.$val.Token(skipSpace, f); }; + isSpace = function(r) { + var $ptr, _i, _ref, r, rng, rx; + if (r >= 65536) { + return false; + } + rx = (r << 16 >>> 16); + _ref = space; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + rng = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), arrayType$2); + if (rx < rng[0]) { + return false; + } + if (rx <= rng[1]) { + return true; + } + _i++; + } + return false; + }; + notSpace = function(r) { + var $ptr, r; + return !isSpace(r); + }; + ss.ptr.prototype.SkipSpace = function() { + var $ptr, s, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + s = this; + $r = s.skipSpace(false); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.SkipSpace }; } $f.$ptr = $ptr; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; + }; + ss.prototype.SkipSpace = function() { return this.$val.SkipSpace(); }; + ss.ptr.prototype.free = function(old) { + var $ptr, old, s; + old = $clone(old, ssave); + s = this; + if (old.validSave) { + ssave.copy(s.ssave, old); + return; + } + if (s.buf.$capacity > 1024) { + return; + } + s.buf = $subslice(s.buf, 0, 0); + s.rr = $ifaceNil; + ssFree.Put(s); + }; + ss.prototype.free = function(old) { return this.$val.free(old); }; + ss.ptr.prototype.skipSpace = function(stopAtNewline) { + var $ptr, _r$2, _r$3, _r$4, _v, r, s, stopAtNewline, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _v = $f._v; r = $f.r; s = $f.s; stopAtNewline = $f.stopAtNewline; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + s = this; + /* while (true) { */ case 1: + _r$2 = s.getRune(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + r = _r$2; + if (r === -1) { + return; + } + if (!(r === 13)) { _v = false; $s = 6; continue s; } + _r$3 = s.peek("\n"); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _v = _r$3; case 6: + /* */ if (_v) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_v) { */ case 4: + /* continue; */ $s = 1; continue; + /* } */ case 5: + /* */ if (r === 10) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (r === 10) { */ case 8: + if (stopAtNewline) { + /* break; */ $s = 2; continue; + } + if (s.ssave.nlIsSpace) { + /* continue; */ $s = 1; continue; + } + s.errorString("unexpected newline"); + return; + /* } */ case 9: + /* */ if (!isSpace(r)) { $s = 10; continue; } + /* */ $s = 11; continue; + /* if (!isSpace(r)) { */ case 10: + _r$4 = s.UnreadRune(); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$4; + /* break; */ $s = 2; continue; + /* } */ case 11: + /* } */ $s = 1; continue; case 2: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.skipSpace }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._v = _v; $f.r = r; $f.s = s; $f.stopAtNewline = stopAtNewline; $f.$s = $s; $f.$r = $r; return $f; + }; + ss.prototype.skipSpace = function(stopAtNewline) { return this.$val.skipSpace(stopAtNewline); }; + ss.ptr.prototype.token = function(skipSpace, f) { + var $ptr, _r$2, _r$3, _r$4, f, r, s, skipSpace, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; f = $f.f; r = $f.r; s = $f.s; skipSpace = $f.skipSpace; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + s = this; + /* */ if (skipSpace) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (skipSpace) { */ case 1: + $r = s.skipSpace(false); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + /* while (true) { */ case 4: + _r$2 = s.getRune(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + r = _r$2; + if (r === -1) { + /* break; */ $s = 5; continue; + } + _r$3 = f(r); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (!_r$3) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (!_r$3) { */ case 7: + _r$4 = s.UnreadRune(); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$4; + /* break; */ $s = 5; continue; + /* } */ case 8: + (s.$ptr_buf || (s.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, s))).WriteRune(r); + /* } */ $s = 4; continue; case 5: + return (x = s.buf, $subslice(new sliceType(x.$array), x.$offset, x.$offset + x.$length)); + /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.token }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.f = f; $f.r = r; $f.s = s; $f.skipSpace = skipSpace; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + ss.prototype.token = function(skipSpace, f) { return this.$val.token(skipSpace, f); }; + indexRune = function(s, r) { + var $ptr, _i, _ref, _rune, c, i, r, s; + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.length)) { break; } + _rune = $decodeRune(_ref, _i); + i = _i; + c = _rune[0]; + if (c === r) { + return i; + } + _i += _rune[1]; + } + return -1; + }; + ss.ptr.prototype.peek = function(ok) { + var $ptr, _r$2, _r$3, ok, r, s, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; ok = $f.ok; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + s = this; + _r$2 = s.getRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + r = _r$2; + /* */ if (!((r === -1))) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!((r === -1))) { */ case 2: + _r$3 = s.UnreadRune(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + /* } */ case 3: + return indexRune(ok, r) >= 0; + /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.peek }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.ok = ok; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; + }; + ss.prototype.peek = function(ok) { return this.$val.peek(ok); }; + ptrType$25.methods = [{prop: "clearflags", name: "clearflags", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "init", name: "init", pkg: "fmt", typ: $funcType([ptrType$1], [], false)}, {prop: "computePadding", name: "computePadding", pkg: "fmt", typ: $funcType([$Int], [sliceType, $Int, $Int], false)}, {prop: "writePadding", name: "writePadding", pkg: "fmt", typ: $funcType([$Int, sliceType], [], false)}, {prop: "pad", name: "pad", pkg: "fmt", typ: $funcType([sliceType], [], false)}, {prop: "padString", name: "padString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmt_boolean", name: "fmt_boolean", pkg: "fmt", typ: $funcType([$Bool], [], false)}, {prop: "integer", name: "integer", pkg: "fmt", typ: $funcType([$Int64, $Uint64, $Bool, $String], [], false)}, {prop: "truncate", name: "truncate", pkg: "fmt", typ: $funcType([$String], [$String], false)}, {prop: "fmt_s", name: "fmt_s", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmt_sbx", name: "fmt_sbx", pkg: "fmt", typ: $funcType([$String, sliceType, $String], [], false)}, {prop: "fmt_sx", name: "fmt_sx", pkg: "fmt", typ: $funcType([$String, $String], [], false)}, {prop: "fmt_bx", name: "fmt_bx", pkg: "fmt", typ: $funcType([sliceType, $String], [], false)}, {prop: "fmt_q", name: "fmt_q", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmt_qc", name: "fmt_qc", pkg: "fmt", typ: $funcType([$Int64], [], false)}, {prop: "formatFloat", name: "formatFloat", pkg: "fmt", typ: $funcType([$Float64, $Uint8, $Int, $Int], [], false)}, {prop: "fmt_e64", name: "fmt_e64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_E64", name: "fmt_E64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_f64", name: "fmt_f64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_g64", name: "fmt_g64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_G64", name: "fmt_G64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_fb64", name: "fmt_fb64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_e32", name: "fmt_e32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_E32", name: "fmt_E32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_f32", name: "fmt_f32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_g32", name: "fmt_g32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_G32", name: "fmt_G32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_fb32", name: "fmt_fb32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_c64", name: "fmt_c64", pkg: "fmt", typ: $funcType([$Complex64, $Int32], [], false)}, {prop: "fmt_c128", name: "fmt_c128", pkg: "fmt", typ: $funcType([$Complex128, $Int32], [], false)}, {prop: "fmt_complex", name: "fmt_complex", pkg: "fmt", typ: $funcType([$Float64, $Float64, $Int, $Int32], [], false)}]; + ptrType$1.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [$error], false)}, {prop: "WriteRune", name: "WriteRune", pkg: "", typ: $funcType([$Int32], [$error], false)}]; + ptrType$2.methods = [{prop: "free", name: "free", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Precision", name: "Precision", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Flag", name: "Flag", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "add", name: "add", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "unknownType", name: "unknownType", pkg: "fmt", typ: $funcType([reflect.Value], [], false)}, {prop: "badVerb", name: "badVerb", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "fmtBool", name: "fmtBool", pkg: "fmt", typ: $funcType([$Bool, $Int32], [], false)}, {prop: "fmtC", name: "fmtC", pkg: "fmt", typ: $funcType([$Int64], [], false)}, {prop: "fmtInt64", name: "fmtInt64", pkg: "fmt", typ: $funcType([$Int64, $Int32], [], false)}, {prop: "fmt0x64", name: "fmt0x64", pkg: "fmt", typ: $funcType([$Uint64, $Bool], [], false)}, {prop: "fmtUnicode", name: "fmtUnicode", pkg: "fmt", typ: $funcType([$Int64], [], false)}, {prop: "fmtUint64", name: "fmtUint64", pkg: "fmt", typ: $funcType([$Uint64, $Int32], [], false)}, {prop: "fmtFloat32", name: "fmtFloat32", pkg: "fmt", typ: $funcType([$Float32, $Int32], [], false)}, {prop: "fmtFloat64", name: "fmtFloat64", pkg: "fmt", typ: $funcType([$Float64, $Int32], [], false)}, {prop: "fmtComplex64", name: "fmtComplex64", pkg: "fmt", typ: $funcType([$Complex64, $Int32], [], false)}, {prop: "fmtComplex128", name: "fmtComplex128", pkg: "fmt", typ: $funcType([$Complex128, $Int32], [], false)}, {prop: "fmtString", name: "fmtString", pkg: "fmt", typ: $funcType([$String, $Int32], [], false)}, {prop: "fmtBytes", name: "fmtBytes", pkg: "fmt", typ: $funcType([sliceType, $Int32, reflect.Type, $Int], [], false)}, {prop: "fmtPointer", name: "fmtPointer", pkg: "fmt", typ: $funcType([reflect.Value, $Int32], [], false)}, {prop: "catchPanic", name: "catchPanic", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32], [], false)}, {prop: "clearSpecialFlags", name: "clearSpecialFlags", pkg: "fmt", typ: $funcType([], [$Bool, $Bool], false)}, {prop: "restoreSpecialFlags", name: "restoreSpecialFlags", pkg: "fmt", typ: $funcType([$Bool, $Bool], [], false)}, {prop: "handleMethods", name: "handleMethods", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Bool], false)}, {prop: "printArg", name: "printArg", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32, $Int], [$Bool], false)}, {prop: "printValue", name: "printValue", pkg: "fmt", typ: $funcType([reflect.Value, $Int32, $Int], [$Bool], false)}, {prop: "printReflectValue", name: "printReflectValue", pkg: "fmt", typ: $funcType([reflect.Value, $Int32, $Int], [$Bool], false)}, {prop: "argNumber", name: "argNumber", pkg: "fmt", typ: $funcType([$Int, $String, $Int, $Int], [$Int, $Int, $Bool], false)}, {prop: "doPrintf", name: "doPrintf", pkg: "fmt", typ: $funcType([$String, sliceType$1], [], false)}, {prop: "doPrint", name: "doPrint", pkg: "fmt", typ: $funcType([sliceType$1, $Bool, $Bool], [], false)}]; + ptrType$5.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "getRune", name: "getRune", pkg: "fmt", typ: $funcType([], [$Int32], false)}, {prop: "mustReadRune", name: "mustReadRune", pkg: "fmt", typ: $funcType([], [$Int32], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "error", name: "error", pkg: "fmt", typ: $funcType([$error], [], false)}, {prop: "errorString", name: "errorString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "Token", name: "Token", pkg: "", typ: $funcType([$Bool, funcType], [sliceType, $error], false)}, {prop: "SkipSpace", name: "SkipSpace", pkg: "", typ: $funcType([], [], false)}, {prop: "free", name: "free", pkg: "fmt", typ: $funcType([ssave], [], false)}, {prop: "skipSpace", name: "skipSpace", pkg: "fmt", typ: $funcType([$Bool], [], false)}, {prop: "token", name: "token", pkg: "fmt", typ: $funcType([$Bool, funcType], [sliceType], false)}, {prop: "consume", name: "consume", pkg: "fmt", typ: $funcType([$String, $Bool], [$Bool], false)}, {prop: "peek", name: "peek", pkg: "fmt", typ: $funcType([$String], [$Bool], false)}, {prop: "notEOF", name: "notEOF", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "accept", name: "accept", pkg: "fmt", typ: $funcType([$String], [$Bool], false)}, {prop: "okVerb", name: "okVerb", pkg: "fmt", typ: $funcType([$Int32, $String, $String], [$Bool], false)}, {prop: "scanBool", name: "scanBool", pkg: "fmt", typ: $funcType([$Int32], [$Bool], false)}, {prop: "getBase", name: "getBase", pkg: "fmt", typ: $funcType([$Int32], [$Int, $String], false)}, {prop: "scanNumber", name: "scanNumber", pkg: "fmt", typ: $funcType([$String, $Bool], [$String], false)}, {prop: "scanRune", name: "scanRune", pkg: "fmt", typ: $funcType([$Int], [$Int64], false)}, {prop: "scanBasePrefix", name: "scanBasePrefix", pkg: "fmt", typ: $funcType([], [$Int, $String, $Bool], false)}, {prop: "scanInt", name: "scanInt", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Int64], false)}, {prop: "scanUint", name: "scanUint", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Uint64], false)}, {prop: "floatToken", name: "floatToken", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "complexTokens", name: "complexTokens", pkg: "fmt", typ: $funcType([], [$String, $String], false)}, {prop: "convertFloat", name: "convertFloat", pkg: "fmt", typ: $funcType([$String, $Int], [$Float64], false)}, {prop: "scanComplex", name: "scanComplex", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Complex128], false)}, {prop: "convertString", name: "convertString", pkg: "fmt", typ: $funcType([$Int32], [$String], false)}, {prop: "quotedString", name: "quotedString", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "hexByte", name: "hexByte", pkg: "fmt", typ: $funcType([], [$Uint8, $Bool], false)}, {prop: "hexString", name: "hexString", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "scanOne", name: "scanOne", pkg: "fmt", typ: $funcType([$Int32, $emptyInterface], [], false)}, {prop: "doScan", name: "doScan", pkg: "fmt", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "advance", name: "advance", pkg: "fmt", typ: $funcType([$String], [$Int], false)}, {prop: "doScanf", name: "doScanf", pkg: "fmt", typ: $funcType([$String, sliceType$1], [$Int, $error], false)}]; + fmtFlags.init([{prop: "widPresent", name: "widPresent", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "precPresent", name: "precPresent", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "minus", name: "minus", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "plus", name: "plus", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "sharp", name: "sharp", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "space", name: "space", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "unicode", name: "unicode", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "uniQuote", name: "uniQuote", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "zero", name: "zero", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "plusV", name: "plusV", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "sharpV", name: "sharpV", pkg: "fmt", typ: $Bool, tag: ""}]); + fmt.init([{prop: "intbuf", name: "intbuf", pkg: "fmt", typ: arrayType$1, tag: ""}, {prop: "buf", name: "buf", pkg: "fmt", typ: ptrType$1, tag: ""}, {prop: "wid", name: "wid", pkg: "fmt", typ: $Int, tag: ""}, {prop: "prec", name: "prec", pkg: "fmt", typ: $Int, tag: ""}, {prop: "fmtFlags", name: "", pkg: "fmt", typ: fmtFlags, tag: ""}]); + State.init([{prop: "Flag", name: "Flag", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "Precision", name: "Precision", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); + Formatter.init([{prop: "Format", name: "Format", pkg: "", typ: $funcType([State, $Int32], [], false)}]); + Stringer.init([{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); + GoStringer.init([{prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]); + buffer.init($Uint8); + pp.init([{prop: "n", name: "n", pkg: "fmt", typ: $Int, tag: ""}, {prop: "panicking", name: "panicking", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "erroring", name: "erroring", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "buf", name: "buf", pkg: "fmt", typ: buffer, tag: ""}, {prop: "arg", name: "arg", pkg: "fmt", typ: $emptyInterface, tag: ""}, {prop: "value", name: "value", pkg: "fmt", typ: reflect.Value, tag: ""}, {prop: "reordered", name: "reordered", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "goodArgNum", name: "goodArgNum", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "runeBuf", name: "runeBuf", pkg: "fmt", typ: arrayType, tag: ""}, {prop: "fmt", name: "fmt", pkg: "fmt", typ: fmt, tag: ""}]); + runeUnreader.init([{prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}]); + ScanState.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "SkipSpace", name: "SkipSpace", pkg: "", typ: $funcType([], [], false)}, {prop: "Token", name: "Token", pkg: "", typ: $funcType([$Bool, funcType], [sliceType, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}]); + scanError.init([{prop: "err", name: "err", pkg: "fmt", typ: $error, tag: ""}]); + ss.init([{prop: "rr", name: "rr", pkg: "fmt", typ: io.RuneReader, tag: ""}, {prop: "buf", name: "buf", pkg: "fmt", typ: buffer, tag: ""}, {prop: "peekRune", name: "peekRune", pkg: "fmt", typ: $Int32, tag: ""}, {prop: "prevRune", name: "prevRune", pkg: "fmt", typ: $Int32, tag: ""}, {prop: "count", name: "count", pkg: "fmt", typ: $Int, tag: ""}, {prop: "atEOF", name: "atEOF", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "ssave", name: "", pkg: "fmt", typ: ssave, tag: ""}]); + ssave.init([{prop: "validSave", name: "validSave", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "nlIsEnd", name: "nlIsEnd", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "nlIsSpace", name: "nlIsSpace", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "argLimit", name: "argLimit", pkg: "fmt", typ: $Int, tag: ""}, {prop: "limit", name: "limit", pkg: "fmt", typ: $Int, tag: ""}, {prop: "maxWid", name: "maxWid", pkg: "fmt", typ: $Int, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = math.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = os.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = reflect.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strconv.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf8.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + padZeroBytes = $makeSlice(sliceType, 65); + padSpaceBytes = $makeSlice(sliceType, 65); + trueBytes = new sliceType($stringToBytes("true")); + falseBytes = new sliceType($stringToBytes("false")); + commaSpaceBytes = new sliceType($stringToBytes(", ")); + nilAngleBytes = new sliceType($stringToBytes("")); + nilParenBytes = new sliceType($stringToBytes("(nil)")); + nilBytes = new sliceType($stringToBytes("nil")); + mapBytes = new sliceType($stringToBytes("map[")); + percentBangBytes = new sliceType($stringToBytes("%!")); + missingBytes = new sliceType($stringToBytes("(MISSING)")); + badIndexBytes = new sliceType($stringToBytes("(BADINDEX)")); + panicBytes = new sliceType($stringToBytes("(PANIC=")); + extraBytes = new sliceType($stringToBytes("%!(EXTRA ")); + irparenBytes = new sliceType($stringToBytes("i)")); + bytesBytes = new sliceType($stringToBytes("[]byte{")); + badWidthBytes = new sliceType($stringToBytes("%!(BADWIDTH)")); + badPrecBytes = new sliceType($stringToBytes("%!(BADPREC)")); + noVerbBytes = new sliceType($stringToBytes("%!(NOVERB)")); + ppFree = new sync.Pool.ptr(0, 0, sliceType$1.nil, (function() { + var $ptr; + return new pp.ptr(0, false, false, buffer.nil, $ifaceNil, new reflect.Value.ptr(ptrType.nil, 0, 0), false, false, arrayType.zero(), new fmt.ptr(arrayType$1.zero(), ptrType$1.nil, 0, 0, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false, false, false))); + })); + _r = reflect.TypeOf(new $Int(0)).Bits(); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + intBits = _r; + _r$1 = reflect.TypeOf(new $Uintptr(0)).Bits(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + uintptrBits = _r$1; + byteType = reflect.TypeOf(new $Uint8(0)); + space = new sliceType$2([$toNativeArray($kindUint16, [9, 13]), $toNativeArray($kindUint16, [32, 32]), $toNativeArray($kindUint16, [133, 133]), $toNativeArray($kindUint16, [160, 160]), $toNativeArray($kindUint16, [5760, 5760]), $toNativeArray($kindUint16, [8192, 8202]), $toNativeArray($kindUint16, [8232, 8233]), $toNativeArray($kindUint16, [8239, 8239]), $toNativeArray($kindUint16, [8287, 8287]), $toNativeArray($kindUint16, [12288, 12288])]); + ssFree = new sync.Pool.ptr(0, 0, sliceType$1.nil, (function() { + var $ptr; + return new ss.ptr($ifaceNil, buffer.nil, 0, 0, 0, false, new ssave.ptr(false, false, false, 0, 0, 0)); + })); + complexError = errors.New("syntax error scanning complex number"); + boolError = errors.New("syntax error scanning boolean"); + init(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["math/rand"] = (function() { + var $pkg = {}, $init, nosync, math, Source, Rand, lockedSource, rngSource, arrayType, sliceType, ptrType, sliceType$1, ptrType$2, ptrType$3, ke, we, fe, kn, wn, fn, globalRand, rng_cooked, absInt32, NewSource, New, seedrand; + nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; + math = $packages["math"]; + Source = $pkg.Source = $newType(8, $kindInterface, "rand.Source", "Source", "math/rand", null); + Rand = $pkg.Rand = $newType(0, $kindStruct, "rand.Rand", "Rand", "math/rand", function(src_) { + this.$val = this; + if (arguments.length === 0) { + this.src = $ifaceNil; + return; + } + this.src = src_; + }); + lockedSource = $pkg.lockedSource = $newType(0, $kindStruct, "rand.lockedSource", "lockedSource", "math/rand", function(lk_, src_) { + this.$val = this; + if (arguments.length === 0) { + this.lk = new nosync.Mutex.ptr(false); + this.src = $ifaceNil; + return; + } + this.lk = lk_; + this.src = src_; + }); + rngSource = $pkg.rngSource = $newType(0, $kindStruct, "rand.rngSource", "rngSource", "math/rand", function(tap_, feed_, vec_) { + this.$val = this; + if (arguments.length === 0) { + this.tap = 0; + this.feed = 0; + this.vec = arrayType.zero(); + return; + } + this.tap = tap_; + this.feed = feed_; + this.vec = vec_; + }); + arrayType = $arrayType($Int64, 607); + sliceType = $sliceType($Int); + ptrType = $ptrType(Rand); + sliceType$1 = $sliceType($Uint8); + ptrType$2 = $ptrType(lockedSource); + ptrType$3 = $ptrType(rngSource); + Rand.ptr.prototype.ExpFloat64 = function() { + var $ptr, _r, _r$1, _r$2, _r$3, i, j, r, x, x$1, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; i = $f.i; j = $f.j; r = $f.r; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + /* while (true) { */ case 1: + _r = r.Uint32(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + j = _r; + i = (j & 255) >>> 0; + x = j * ((i < 0 || i >= we.length) ? $throwRuntimeError("index out of range") : we[i]); + if (j < ((i < 0 || i >= ke.length) ? $throwRuntimeError("index out of range") : ke[i])) { + return x; + } + /* */ if (i === 0) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (i === 0) { */ case 4: + _r$1 = r.Float64(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = math.Log(_r$1); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ $s = 8; case 8: + return 7.69711747013105 - _r$2; + /* } */ case 5: + _r$3 = r.Float64(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if ($fround(((i < 0 || i >= fe.length) ? $throwRuntimeError("index out of range") : fe[i]) + $fround($fround(_r$3) * ($fround((x$1 = i - 1 >>> 0, ((x$1 < 0 || x$1 >= fe.length) ? $throwRuntimeError("index out of range") : fe[x$1])) - ((i < 0 || i >= fe.length) ? $throwRuntimeError("index out of range") : fe[i]))))) < $fround(math.Exp(-x))) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if ($fround(((i < 0 || i >= fe.length) ? $throwRuntimeError("index out of range") : fe[i]) + $fround($fround(_r$3) * ($fround((x$1 = i - 1 >>> 0, ((x$1 < 0 || x$1 >= fe.length) ? $throwRuntimeError("index out of range") : fe[x$1])) - ((i < 0 || i >= fe.length) ? $throwRuntimeError("index out of range") : fe[i]))))) < $fround(math.Exp(-x))) { */ case 9: + return x; + /* } */ case 10: + /* } */ $s = 1; continue; case 2: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.ExpFloat64 }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.i = i; $f.j = j; $f.r = r; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.ExpFloat64 = function() { return this.$val.ExpFloat64(); }; + absInt32 = function(i) { + var $ptr, i; + if (i < 0) { + return (-i >>> 0); + } + return (i >>> 0); + }; + Rand.ptr.prototype.NormFloat64 = function() { + var $ptr, _r, _r$1, _r$2, _r$3, _r$4, _r$5, i, j, r, x, x$1, y, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; i = $f.i; j = $f.j; r = $f.r; x = $f.x; x$1 = $f.x$1; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + /* while (true) { */ case 1: + _r = r.Uint32(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + j = (_r >> 0); + i = j & 127; + x = j * ((i < 0 || i >= wn.length) ? $throwRuntimeError("index out of range") : wn[i]); + if (absInt32(j) < ((i < 0 || i >= kn.length) ? $throwRuntimeError("index out of range") : kn[i])) { + return x; + } + /* */ if (i === 0) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (i === 0) { */ case 4: + /* while (true) { */ case 6: + _r$1 = r.Float64(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$2 = math.Log(_r$1); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + x = -_r$2 * 0.29047645161474317; + _r$3 = r.Float64(); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$4 = math.Log(_r$3); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + y = -_r$4; + if (y + y >= x * x) { + /* break; */ $s = 7; continue; + } + /* } */ $s = 6; continue; case 7: + if (j > 0) { + return 3.442619855899 + x; + } + return -3.442619855899 - x; + /* } */ case 5: + _r$5 = r.Float64(); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + /* */ if ($fround(((i < 0 || i >= fn.length) ? $throwRuntimeError("index out of range") : fn[i]) + $fround($fround(_r$5) * ($fround((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= fn.length) ? $throwRuntimeError("index out of range") : fn[x$1])) - ((i < 0 || i >= fn.length) ? $throwRuntimeError("index out of range") : fn[i]))))) < $fround(math.Exp(-0.5 * x * x))) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if ($fround(((i < 0 || i >= fn.length) ? $throwRuntimeError("index out of range") : fn[i]) + $fround($fround(_r$5) * ($fround((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= fn.length) ? $throwRuntimeError("index out of range") : fn[x$1])) - ((i < 0 || i >= fn.length) ? $throwRuntimeError("index out of range") : fn[i]))))) < $fround(math.Exp(-0.5 * x * x))) { */ case 12: + return x; + /* } */ case 13: + /* } */ $s = 1; continue; case 2: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.NormFloat64 }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.i = i; $f.j = j; $f.r = r; $f.x = x; $f.x$1 = x$1; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.NormFloat64 = function() { return this.$val.NormFloat64(); }; + NewSource = function(seed) { + var $ptr, rng, seed; + rng = new rngSource.ptr(0, 0, arrayType.zero()); + rng.Seed(seed); + return rng; + }; + $pkg.NewSource = NewSource; + New = function(src) { + var $ptr, src; + return new Rand.ptr(src); + }; + $pkg.New = New; + Rand.ptr.prototype.Seed = function(seed) { + var $ptr, r, seed, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + $r = r.src.Seed(seed); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Seed }; } $f.$ptr = $ptr; $f.r = r; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Seed = function(seed) { return this.$val.Seed(seed); }; + Rand.ptr.prototype.Int63 = function() { + var $ptr, _r, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + _r = r.src.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int63 }; } $f.$ptr = $ptr; $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Int63 = function() { return this.$val.Int63(); }; + Rand.ptr.prototype.Uint32 = function() { + var $ptr, _r, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + _r = r.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return ($shiftRightInt64(_r, 31).$low >>> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Uint32 }; } $f.$ptr = $ptr; $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Uint32 = function() { return this.$val.Uint32(); }; + Rand.ptr.prototype.Int31 = function() { + var $ptr, _r, r, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; r = $f.r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + _r = r.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return ((x = $shiftRightInt64(_r, 32), x.$low + ((x.$high >> 31) * 4294967296)) >> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int31 }; } $f.$ptr = $ptr; $f._r = _r; $f.r = r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Int31 = function() { return this.$val.Int31(); }; + Rand.ptr.prototype.Int = function() { + var $ptr, _r, r, u, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; r = $f.r; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + _r = r.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + u = (_r.$low >>> 0); + return (((u << 1 >>> 0) >>> 1 >>> 0) >> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int }; } $f.$ptr = $ptr; $f._r = _r; $f.r = r; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Int = function() { return this.$val.Int(); }; + Rand.ptr.prototype.Int63n = function(n) { + var $ptr, _r, _r$1, _r$2, max, n, r, v, x, x$1, x$2, x$3, x$4, x$5, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; max = $f.max; n = $f.n; r = $f.r; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + if ((n.$high < 0 || (n.$high === 0 && n.$low <= 0))) { + $panic(new $String("invalid argument to Int63n")); + } + /* */ if ((x = (x$1 = new $Int64(n.$high - 0, n.$low - 1), new $Int64(n.$high & x$1.$high, (n.$low & x$1.$low) >>> 0)), (x.$high === 0 && x.$low === 0))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ((x = (x$1 = new $Int64(n.$high - 0, n.$low - 1), new $Int64(n.$high & x$1.$high, (n.$low & x$1.$low) >>> 0)), (x.$high === 0 && x.$low === 0))) { */ case 1: + _r = r.Int63(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return (x$2 = _r, x$3 = new $Int64(n.$high - 0, n.$low - 1), new $Int64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)); + /* } */ case 2: + max = (x$4 = (x$5 = $div64(new $Uint64(2147483648, 0), new $Uint64(n.$high, n.$low), true), new $Uint64(2147483647 - x$5.$high, 4294967295 - x$5.$low)), new $Int64(x$4.$high, x$4.$low)); + _r$1 = r.Int63(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + v = _r$1; + /* while (true) { */ case 6: + /* if (!((v.$high > max.$high || (v.$high === max.$high && v.$low > max.$low)))) { break; } */ if(!((v.$high > max.$high || (v.$high === max.$high && v.$low > max.$low)))) { $s = 7; continue; } + _r$2 = r.Int63(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + v = _r$2; + /* } */ $s = 6; continue; case 7: + return $div64(v, n, true); + /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int63n }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.max = max; $f.n = n; $f.r = r; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Int63n = function(n) { return this.$val.Int63n(n); }; + Rand.ptr.prototype.Int31n = function(n) { + var $ptr, _r, _r$1, _r$2, _r$3, _r$4, max, n, r, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; max = $f.max; n = $f.n; r = $f.r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + if (n <= 0) { + $panic(new $String("invalid argument to Int31n")); + } + /* */ if ((n & ((n - 1 >> 0))) === 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ((n & ((n - 1 >> 0))) === 0) { */ case 1: + _r = r.Int31(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return _r & ((n - 1 >> 0)); + /* } */ case 2: + max = ((2147483647 - (_r$1 = 2147483648 % (n >>> 0), _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) >>> 0) >> 0); + _r$2 = r.Int31(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + v = _r$2; + /* while (true) { */ case 6: + /* if (!(v > max)) { break; } */ if(!(v > max)) { $s = 7; continue; } + _r$3 = r.Int31(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + v = _r$3; + /* } */ $s = 6; continue; case 7: + return (_r$4 = v % n, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); + /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int31n }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.max = max; $f.n = n; $f.r = r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Int31n = function(n) { return this.$val.Int31n(n); }; + Rand.ptr.prototype.Intn = function(n) { + var $ptr, _r, _r$1, n, r, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; n = $f.n; r = $f.r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + if (n <= 0) { + $panic(new $String("invalid argument to Intn")); + } + /* */ if (n <= 2147483647) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (n <= 2147483647) { */ case 1: + _r = r.Int31n((n >> 0)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return (_r >> 0); + /* } */ case 2: + _r$1 = r.Int63n(new $Int64(0, n)); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 6; case 6: + return ((x = _r$1, x.$low + ((x.$high >> 31) * 4294967296)) >> 0); + /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Intn }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.n = n; $f.r = r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Intn = function(n) { return this.$val.Intn(n); }; + Rand.ptr.prototype.Float64 = function() { + var $ptr, _r, f, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; f = $f.f; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + /* again: */ case 1: + _r = r.Int63(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + f = $flatten64(_r) / 9.223372036854776e+18; + /* */ if (f === 1) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (f === 1) { */ case 3: + /* goto again */ $s = 1; continue; + /* } */ case 4: + return f; + /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Float64 }; } $f.$ptr = $ptr; $f._r = _r; $f.f = f; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Float64 = function() { return this.$val.Float64(); }; + Rand.ptr.prototype.Float32 = function() { + var $ptr, _r, f, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; f = $f.f; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + /* again: */ case 1: + _r = r.Float64(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + f = $fround(_r); + /* */ if (f === 1) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (f === 1) { */ case 3: + /* goto again */ $s = 1; continue; + /* } */ case 4: + return f; + /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Float32 }; } $f.$ptr = $ptr; $f._r = _r; $f.f = f; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Float32 = function() { return this.$val.Float32(); }; + Rand.ptr.prototype.Perm = function(n) { + var $ptr, _r, i, j, m, n, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; j = $f.j; m = $f.m; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + m = $makeSlice(sliceType, n); + i = 0; + /* while (true) { */ case 1: + /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } + _r = r.Intn(i + 1 >> 0); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + j = _r; + ((i < 0 || i >= m.$length) ? $throwRuntimeError("index out of range") : m.$array[m.$offset + i] = ((j < 0 || j >= m.$length) ? $throwRuntimeError("index out of range") : m.$array[m.$offset + j])); + ((j < 0 || j >= m.$length) ? $throwRuntimeError("index out of range") : m.$array[m.$offset + j] = i); + i = i + (1) >> 0; + /* } */ $s = 1; continue; case 2: + return m; + /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Perm }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.j = j; $f.m = m; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Perm = function(n) { return this.$val.Perm(n); }; + Rand.ptr.prototype.Read = function(p) { + var $ptr, _r, _tmp, _tmp$1, err, i, j, n, p, r, val, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; err = $f.err; i = $f.i; j = $f.j; n = $f.n; p = $f.p; r = $f.r; val = $f.val; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + r = this; + i = 0; + /* while (true) { */ case 1: + /* if (!(i < p.$length)) { break; } */ if(!(i < p.$length)) { $s = 2; continue; } + _r = r.src.Int63(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + val = _r; + j = 0; + while (true) { + if (!((i + j >> 0) < p.$length && j < 7)) { break; } + (x = i + j >> 0, ((x < 0 || x >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x] = (val.$low << 24 >>> 24))); + val = $shiftRightInt64(val, (8)); + j = j + (1) >> 0; + } + i = i + (7) >> 0; + /* } */ $s = 1; continue; case 2: + _tmp = p.$length; + _tmp$1 = $ifaceNil; + n = _tmp; + err = _tmp$1; + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Read }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.err = err; $f.i = i; $f.j = j; $f.n = n; $f.p = p; $f.r = r; $f.val = val; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Rand.prototype.Read = function(p) { return this.$val.Read(p); }; + lockedSource.ptr.prototype.Int63 = function() { + var $ptr, _r, n, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = new $Int64(0, 0); + r = this; + r.lk.Lock(); + _r = r.src.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + n = _r; + r.lk.Unlock(); + return n; + /* */ } return; } if ($f === undefined) { $f = { $blk: lockedSource.ptr.prototype.Int63 }; } $f.$ptr = $ptr; $f._r = _r; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + lockedSource.prototype.Int63 = function() { return this.$val.Int63(); }; + lockedSource.ptr.prototype.Seed = function(seed) { + var $ptr, r, seed, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = this; + r.lk.Lock(); + $r = r.src.Seed(seed); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + r.lk.Unlock(); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: lockedSource.ptr.prototype.Seed }; } $f.$ptr = $ptr; $f.r = r; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; + }; + lockedSource.prototype.Seed = function(seed) { return this.$val.Seed(seed); }; + seedrand = function(x) { + var $ptr, _q, _r, hi, lo, x; + hi = (_q = x / 44488, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + lo = (_r = x % 44488, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); + x = ($imul(48271, lo)) - ($imul(3399, hi)) >> 0; + if (x < 0) { + x = x + (2147483647) >> 0; + } + return x; + }; + rngSource.ptr.prototype.Seed = function(seed) { + var $ptr, i, rng, seed, u, x, x$1, x$2, x$3, x$4, x$5; + rng = this; + rng.tap = 0; + rng.feed = 334; + seed = $div64(seed, new $Int64(0, 2147483647), true); + if ((seed.$high < 0 || (seed.$high === 0 && seed.$low < 0))) { + seed = (x = new $Int64(0, 2147483647), new $Int64(seed.$high + x.$high, seed.$low + x.$low)); + } + if ((seed.$high === 0 && seed.$low === 0)) { + seed = new $Int64(0, 89482311); + } + x$1 = ((seed.$low + ((seed.$high >> 31) * 4294967296)) >> 0); + i = -20; + while (true) { + if (!(i < 607)) { break; } + x$1 = seedrand(x$1); + if (i >= 0) { + u = new $Int64(0, 0); + u = $shiftLeft64(new $Int64(0, x$1), 40); + x$1 = seedrand(x$1); + u = (x$2 = $shiftLeft64(new $Int64(0, x$1), 20), new $Int64(u.$high ^ x$2.$high, (u.$low ^ x$2.$low) >>> 0)); + x$1 = seedrand(x$1); + u = (x$3 = new $Int64(0, x$1), new $Int64(u.$high ^ x$3.$high, (u.$low ^ x$3.$low) >>> 0)); + u = (x$4 = ((i < 0 || i >= rng_cooked.length) ? $throwRuntimeError("index out of range") : rng_cooked[i]), new $Int64(u.$high ^ x$4.$high, (u.$low ^ x$4.$low) >>> 0)); + (x$5 = rng.vec, ((i < 0 || i >= x$5.length) ? $throwRuntimeError("index out of range") : x$5[i] = new $Int64(u.$high & 2147483647, (u.$low & 4294967295) >>> 0))); + } + i = i + (1) >> 0; + } + }; + rngSource.prototype.Seed = function(seed) { return this.$val.Seed(seed); }; + rngSource.ptr.prototype.Int63 = function() { + var $ptr, rng, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + rng = this; + rng.tap = rng.tap - (1) >> 0; + if (rng.tap < 0) { + rng.tap = rng.tap + (607) >> 0; + } + rng.feed = rng.feed - (1) >> 0; + if (rng.feed < 0) { + rng.feed = rng.feed + (607) >> 0; + } + x$7 = (x = (x$1 = (x$2 = rng.vec, x$3 = rng.feed, ((x$3 < 0 || x$3 >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[x$3])), x$4 = (x$5 = rng.vec, x$6 = rng.tap, ((x$6 < 0 || x$6 >= x$5.length) ? $throwRuntimeError("index out of range") : x$5[x$6])), new $Int64(x$1.$high + x$4.$high, x$1.$low + x$4.$low)), new $Int64(x.$high & 2147483647, (x.$low & 4294967295) >>> 0)); + (x$8 = rng.vec, x$9 = rng.feed, ((x$9 < 0 || x$9 >= x$8.length) ? $throwRuntimeError("index out of range") : x$8[x$9] = x$7)); + return x$7; + }; + rngSource.prototype.Int63 = function() { return this.$val.Int63(); }; + ptrType.methods = [{prop: "ExpFloat64", name: "ExpFloat64", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "NormFloat64", name: "NormFloat64", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint32", name: "Uint32", pkg: "", typ: $funcType([], [$Uint32], false)}, {prop: "Int31", name: "Int31", pkg: "", typ: $funcType([], [$Int32], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Int63n", name: "Int63n", pkg: "", typ: $funcType([$Int64], [$Int64], false)}, {prop: "Int31n", name: "Int31n", pkg: "", typ: $funcType([$Int32], [$Int32], false)}, {prop: "Intn", name: "Intn", pkg: "", typ: $funcType([$Int], [$Int], false)}, {prop: "Float64", name: "Float64", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Float32", name: "Float32", pkg: "", typ: $funcType([], [$Float32], false)}, {prop: "Perm", name: "Perm", pkg: "", typ: $funcType([$Int], [sliceType], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]; + ptrType$2.methods = [{prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}]; + ptrType$3.methods = [{prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}]; + Source.init([{prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}]); + Rand.init([{prop: "src", name: "src", pkg: "math/rand", typ: Source, tag: ""}]); + lockedSource.init([{prop: "lk", name: "lk", pkg: "math/rand", typ: nosync.Mutex, tag: ""}, {prop: "src", name: "src", pkg: "math/rand", typ: Source, tag: ""}]); + rngSource.init([{prop: "tap", name: "tap", pkg: "math/rand", typ: $Int, tag: ""}, {prop: "feed", name: "feed", pkg: "math/rand", typ: $Int, tag: ""}, {prop: "vec", name: "vec", pkg: "math/rand", typ: arrayType, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = nosync.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = math.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + ke = $toNativeArray($kindUint32, [3801129273, 0, 2615860924, 3279400049, 3571300752, 3733536696, 3836274812, 3906990442, 3958562475, 3997804264, 4028649213, 4053523342, 4074002619, 4091154507, 4105727352, 4118261130, 4129155133, 4138710916, 4147160435, 4154685009, 4161428406, 4167506077, 4173011791, 4178022498, 4182601930, 4186803325, 4190671498, 4194244443, 4197554582, 4200629752, 4203493986, 4206168142, 4208670408, 4211016720, 4213221098, 4215295924, 4217252177, 4219099625, 4220846988, 4222502074, 4224071896, 4225562770, 4226980400, 4228329951, 4229616109, 4230843138, 4232014925, 4233135020, 4234206673, 4235232866, 4236216336, 4237159604, 4238064994, 4238934652, 4239770563, 4240574564, 4241348362, 4242093539, 4242811568, 4243503822, 4244171579, 4244816032, 4245438297, 4246039419, 4246620374, 4247182079, 4247725394, 4248251127, 4248760037, 4249252839, 4249730206, 4250192773, 4250641138, 4251075867, 4251497493, 4251906522, 4252303431, 4252688672, 4253062674, 4253425844, 4253778565, 4254121205, 4254454110, 4254777611, 4255092022, 4255397640, 4255694750, 4255983622, 4256264513, 4256537670, 4256803325, 4257061702, 4257313014, 4257557464, 4257795244, 4258026541, 4258251531, 4258470383, 4258683258, 4258890309, 4259091685, 4259287526, 4259477966, 4259663135, 4259843154, 4260018142, 4260188212, 4260353470, 4260514019, 4260669958, 4260821380, 4260968374, 4261111028, 4261249421, 4261383632, 4261513736, 4261639802, 4261761900, 4261880092, 4261994441, 4262105003, 4262211835, 4262314988, 4262414513, 4262510454, 4262602857, 4262691764, 4262777212, 4262859239, 4262937878, 4263013162, 4263085118, 4263153776, 4263219158, 4263281289, 4263340187, 4263395872, 4263448358, 4263497660, 4263543789, 4263586755, 4263626565, 4263663224, 4263696735, 4263727099, 4263754314, 4263778377, 4263799282, 4263817020, 4263831582, 4263842955, 4263851124, 4263856071, 4263857776, 4263856218, 4263851370, 4263843206, 4263831695, 4263816804, 4263798497, 4263776735, 4263751476, 4263722676, 4263690284, 4263654251, 4263614520, 4263571032, 4263523724, 4263472530, 4263417377, 4263358192, 4263294892, 4263227394, 4263155608, 4263079437, 4262998781, 4262913534, 4262823581, 4262728804, 4262629075, 4262524261, 4262414220, 4262298801, 4262177846, 4262051187, 4261918645, 4261780032, 4261635148, 4261483780, 4261325704, 4261160681, 4260988457, 4260808763, 4260621313, 4260425802, 4260221905, 4260009277, 4259787550, 4259556329, 4259315195, 4259063697, 4258801357, 4258527656, 4258242044, 4257943926, 4257632664, 4257307571, 4256967906, 4256612870, 4256241598, 4255853155, 4255446525, 4255020608, 4254574202, 4254106002, 4253614578, 4253098370, 4252555662, 4251984571, 4251383021, 4250748722, 4250079132, 4249371435, 4248622490, 4247828790, 4246986404, 4246090910, 4245137315, 4244119963, 4243032411, 4241867296, 4240616155, 4239269214, 4237815118, 4236240596, 4234530035, 4232664930, 4230623176, 4228378137, 4225897409, 4223141146, 4220059768, 4216590757, 4212654085, 4208145538, 4202926710, 4196809522, 4189531420, 4180713890, 4169789475, 4155865042, 4137444620, 4111806704, 4073393724, 4008685917, 3873074895]); + we = $toNativeArray($kindFloat32, [2.0249555365836613e-09, 1.4866739783681027e-11, 2.4409616689036184e-11, 3.1968806074589295e-11, 3.844677007314168e-11, 4.42282044321729e-11, 4.951644302919611e-11, 5.443358958023836e-11, 5.905943789574764e-11, 6.34494193296753e-11, 6.764381416113352e-11, 7.167294535648239e-11, 7.556032188826833e-11, 7.932458162551725e-11, 8.298078890689453e-11, 8.654132271912474e-11, 9.001651507523079e-11, 9.341507428706208e-11, 9.674443190998971e-11, 1.0001099254308699e-10, 1.0322031424037093e-10, 1.0637725422757427e-10, 1.0948611461891744e-10, 1.1255067711157807e-10, 1.1557434870246297e-10, 1.1856014781042035e-10, 1.2151082917633005e-10, 1.2442885610752796e-10, 1.2731647680563896e-10, 1.3017574518325858e-10, 1.330085347417409e-10, 1.3581656632677408e-10, 1.386014220061682e-10, 1.413645728254309e-10, 1.4410737880776736e-10, 1.4683107507629245e-10, 1.4953686899854546e-10, 1.522258291641876e-10, 1.5489899640730442e-10, 1.575573282952547e-10, 1.6020171300645814e-10, 1.628330109637588e-10, 1.6545202707884954e-10, 1.68059510752272e-10, 1.7065616975120435e-10, 1.73242697965037e-10, 1.758197337720091e-10, 1.783878739169964e-10, 1.8094774290045024e-10, 1.834998542005195e-10, 1.8604476292871652e-10, 1.8858298256319017e-10, 1.9111498494872592e-10, 1.9364125580789704e-10, 1.9616222535212557e-10, 1.9867835154840918e-10, 2.011900368525943e-10, 2.0369768372052732e-10, 2.062016807302669e-10, 2.0870240258208383e-10, 2.1120022397624894e-10, 2.136955057352452e-10, 2.1618855317040442e-10, 2.1867974098199738e-10, 2.2116936060356807e-10, 2.2365774510202385e-10, 2.2614519978869652e-10, 2.2863201609713002e-10, 2.3111849933865614e-10, 2.3360494094681883e-10, 2.3609159072179864e-10, 2.3857874009713953e-10, 2.4106666662859766e-10, 2.4355562011635357e-10, 2.460458781161634e-10, 2.485376904282077e-10, 2.5103127909709144e-10, 2.5352694943414633e-10, 2.560248957284017e-10, 2.585253955356137e-10, 2.610286709003873e-10, 2.6353494386732734e-10, 2.6604446423661443e-10, 2.6855745405285347e-10, 2.71074163116225e-10, 2.7359478571575835e-10, 2.7611959940720965e-10, 2.786487707240326e-10, 2.8118254946640775e-10, 2.8372118543451563e-10, 2.8626484516180994e-10, 2.8881380620404684e-10, 2.9136826285025563e-10, 2.9392840938946563e-10, 2.96494523377433e-10, 2.990667713476114e-10, 3.016454031001814e-10, 3.042306406797479e-10, 3.068226783753403e-10, 3.09421765987139e-10, 3.12028125559749e-10, 3.1464195138219964e-10, 3.17263521010247e-10, 3.1989300097734485e-10, 3.225306410836737e-10, 3.2517669112941405e-10, 3.2783134540359526e-10, 3.3049485370639786e-10, 3.3316743808242677e-10, 3.3584937608743815e-10, 3.385408342548857e-10, 3.4124211789610115e-10, 3.4395342130011386e-10, 3.4667499426710435e-10, 3.494071143528288e-10, 3.521500313574677e-10, 3.54903967325626e-10, 3.576691720574843e-10, 3.6044595086437425e-10, 3.632345535464765e-10, 3.660352021483959e-10, 3.688482297370399e-10, 3.716738583570134e-10, 3.7451239331964814e-10, 3.773641121807003e-10, 3.802292924959261e-10, 3.831082673322328e-10, 3.8600128648980103e-10, 3.8890865527996255e-10, 3.9183070676962473e-10, 3.9476774627011935e-10, 3.977200790927782e-10, 4.006880383045086e-10, 4.0367195697221803e-10, 4.066721681628138e-10, 4.0968900494320337e-10, 4.127228558914453e-10, 4.15774054074447e-10, 4.188429603146915e-10, 4.2192993543466173e-10, 4.25035395767992e-10, 4.2815970213716525e-10, 4.313032986313914e-10, 4.3446651831757777e-10, 4.376498607960855e-10, 4.408536868893975e-10, 4.4407846844229937e-10, 4.4732464954400086e-10, 4.5059267428371186e-10, 4.538830145062178e-10, 4.5719619756745544e-10, 4.605326675566346e-10, 4.638929240741163e-10, 4.672775499869886e-10, 4.706869893844612e-10, 4.74121908400349e-10, 4.775827511238617e-10, 4.810701836888143e-10, 4.845848167178701e-10, 4.881271498113904e-10, 4.916979601254923e-10, 4.952977472605369e-10, 4.989272883726414e-10, 5.025872495956207e-10, 5.062783525744408e-10, 5.100013189540675e-10, 5.13756870379467e-10, 5.175458395179078e-10, 5.21369003525507e-10, 5.252272505806843e-10, 5.29121357839557e-10, 5.330522134805449e-10, 5.3702081670437e-10, 5.41028055689452e-10, 5.450749851476644e-10, 5.491624932574268e-10, 5.532918012640664e-10, 5.574638528571541e-10, 5.616799247931681e-10, 5.659410717839819e-10, 5.702485705860738e-10, 5.746036979559221e-10, 5.790077306500052e-10, 5.83462111958255e-10, 5.879682296594524e-10, 5.925275825546805e-10, 5.971417249561739e-10, 6.01812211176167e-10, 6.065408175714992e-10, 6.113292094767075e-10, 6.16179329782085e-10, 6.21092954844471e-10, 6.260721940876124e-10, 6.311191569352559e-10, 6.362359528111483e-10, 6.414249686947926e-10, 6.466885360545405e-10, 6.520292639144998e-10, 6.574497612987784e-10, 6.629528592760892e-10, 6.685415554485985e-10, 6.742187919073217e-10, 6.799880103436351e-10, 6.858525969377638e-10, 6.918161599145378e-10, 6.978825850545434e-10, 7.040559801829716e-10, 7.103406751696184e-10, 7.167412219288849e-10, 7.232625609532306e-10, 7.2990985477972e-10, 7.366885990123251e-10, 7.436047333442275e-10, 7.506645305355164e-10, 7.57874762946642e-10, 7.652426470272644e-10, 7.727759543385559e-10, 7.804830115532013e-10, 7.883728114777e-10, 7.964550685635174e-10, 8.047402189070851e-10, 8.132396422944055e-10, 8.219657177122031e-10, 8.309318788590758e-10, 8.401527806789488e-10, 8.496445214056791e-10, 8.594246980742071e-10, 8.695127395874636e-10, 8.799300732498239e-10, 8.90700457834015e-10, 9.01850316648023e-10, 9.134091816243028e-10, 9.254100818978372e-10, 9.37890431984556e-10, 9.508922538259412e-10, 9.64463842123564e-10, 9.78660263939446e-10, 9.935448019859905e-10, 1.0091912860943353e-09, 1.0256859805934937e-09, 1.0431305819125214e-09, 1.0616465484503124e-09, 1.0813799855569073e-09, 1.1025096391392708e-09, 1.1252564435793033e-09, 1.149898620766976e-09, 1.176793218427008e-09, 1.2064089727203964e-09, 1.2393785997488749e-09, 1.2765849488616254e-09, 1.319313880365769e-09, 1.36954347862428e-09, 1.4305497897382224e-09, 1.5083649884672923e-09, 1.6160853766322703e-09, 1.7921247819074893e-09]); + fe = $toNativeArray($kindFloat32, [1, 0.9381436705589294, 0.900469958782196, 0.8717043399810791, 0.847785472869873, 0.8269932866096497, 0.8084216713905334, 0.7915276288986206, 0.7759568691253662, 0.7614634037017822, 0.7478685975074768, 0.7350381016731262, 0.7228676676750183, 0.7112747430801392, 0.7001926302909851, 0.6895664930343628, 0.6793505549430847, 0.669506311416626, 0.6600008606910706, 0.6508058309555054, 0.6418967247009277, 0.633251965045929, 0.62485271692276, 0.6166821718215942, 0.608725368976593, 0.6009689569473267, 0.5934008955955505, 0.5860103368759155, 0.5787873864173889, 0.5717230439186096, 0.5648092031478882, 0.5580382943153381, 0.5514034032821655, 0.5448982119560242, 0.5385168790817261, 0.5322538614273071, 0.526104211807251, 0.5200631618499756, 0.5141264200210571, 0.5082897543907166, 0.5025495290756226, 0.4969019889831543, 0.4913438558578491, 0.4858720004558563, 0.48048335313796997, 0.4751752018928528, 0.4699448347091675, 0.4647897481918335, 0.4597076177597046, 0.4546961486339569, 0.4497532546520233, 0.44487687945365906, 0.4400651156902313, 0.4353161156177521, 0.4306281507015228, 0.42599955201148987, 0.42142874002456665, 0.4169141948223114, 0.4124544560909271, 0.40804818272590637, 0.4036940038204193, 0.39939069747924805, 0.3951369822025299, 0.39093172550201416, 0.38677382469177246, 0.38266217708587646, 0.378595769405365, 0.37457355856895447, 0.37059465050697327, 0.366658091545105, 0.362762987613678, 0.358908474445343, 0.35509374737739563, 0.35131800174713135, 0.3475804924964905, 0.34388044476509094, 0.34021714329719543, 0.33658990263938904, 0.3329980671405792, 0.3294409513473511, 0.32591795921325684, 0.32242849469184875, 0.3189719021320343, 0.3155476748943329, 0.31215524673461914, 0.3087940812110901, 0.30546361207962036, 0.30216339230537415, 0.29889291524887085, 0.29565170407295227, 0.2924392819404602, 0.2892552316188812, 0.28609907627105713, 0.2829704284667969, 0.27986884117126465, 0.2767939269542694, 0.2737452983856201, 0.2707225978374481, 0.26772540807724, 0.26475343108177185, 0.2618062496185303, 0.258883535861969, 0.2559850215911865, 0.25311028957366943, 0.25025907158851624, 0.24743106961250305, 0.2446259707212448, 0.24184346199035645, 0.23908329010009766, 0.23634515702724457, 0.2336287796497345, 0.23093391954898834, 0.22826029360294342, 0.22560766339302063, 0.22297576069831848, 0.22036437690258026, 0.21777324378490448, 0.21520215272903442, 0.212650865316391, 0.21011915802955627, 0.20760682225227356, 0.20511364936828613, 0.20263944566249847, 0.20018397271633148, 0.19774706661701202, 0.1953285187482834, 0.19292815029621124, 0.19054576754570007, 0.18818120658397675, 0.18583425879478455, 0.18350479006767273, 0.18119260668754578, 0.17889754474163055, 0.17661945521831512, 0.17435817420482635, 0.1721135377883911, 0.16988539695739746, 0.16767361760139465, 0.16547803580760956, 0.16329853236675262, 0.16113494336605072, 0.1589871346950531, 0.15685498714447021, 0.15473836660385132, 0.15263713896274567, 0.1505511850118637, 0.1484803706407547, 0.14642459154129028, 0.1443837285041809, 0.14235764741897583, 0.1403462439775467, 0.13834942877292633, 0.136367067694664, 0.13439907133579254, 0.1324453204870224, 0.1305057406425476, 0.12858019769191742, 0.12666863203048706, 0.12477091699838638, 0.12288697808980942, 0.1210167184472084, 0.11916005611419678, 0.11731690168380737, 0.11548716574907303, 0.11367076635360718, 0.11186762899160385, 0.11007767915725708, 0.1083008274435997, 0.10653700679540634, 0.10478614270687103, 0.1030481606721878, 0.10132300108671188, 0.0996105819940567, 0.09791085124015808, 0.09622374176979065, 0.09454918652772903, 0.09288713335990906, 0.09123751521110535, 0.08960027992725372, 0.08797537535429001, 0.08636274188756943, 0.0847623273730278, 0.08317409455776215, 0.08159798383712769, 0.08003395050764084, 0.07848194986581802, 0.07694194465875626, 0.07541389018297195, 0.07389774918556213, 0.07239348441362381, 0.070901058614254, 0.06942043453454971, 0.06795158982276917, 0.06649449467658997, 0.06504911929368973, 0.06361543387174606, 0.06219341605901718, 0.06078304722905159, 0.0593843050301075, 0.05799717456102371, 0.05662164092063904, 0.05525768920779228, 0.05390531197190285, 0.05256449431180954, 0.05123523622751236, 0.04991753399372101, 0.04861138388514519, 0.047316793352365494, 0.04603376239538193, 0.044762298464775085, 0.04350241273641586, 0.04225412383675575, 0.04101744294166565, 0.039792392402887344, 0.03857899457216263, 0.03737728297710419, 0.03618728369474411, 0.03500903770327568, 0.03384258225560188, 0.0326879620552063, 0.031545232981443405, 0.030414443463087082, 0.0292956605553627, 0.028188949450850487, 0.027094384655356407, 0.02601204626262188, 0.024942025542259216, 0.023884421214461327, 0.022839335724711418, 0.021806888282299042, 0.020787203684449196, 0.019780423492193222, 0.018786700442433357, 0.017806200310587883, 0.016839107498526573, 0.015885621309280396, 0.014945968054234982, 0.01402039173990488, 0.013109165243804455, 0.012212592177093029, 0.011331013403832912, 0.010464809834957123, 0.009614413604140282, 0.008780314587056637, 0.007963077165186405, 0.007163353264331818, 0.0063819061033427715, 0.005619642324745655, 0.004877655766904354, 0.004157294984906912, 0.003460264764726162, 0.0027887988835573196, 0.0021459676790982485, 0.001536299823783338, 0.0009672692976891994, 0.0004541343660093844]); + kn = $toNativeArray($kindUint32, [1991057938, 0, 1611602771, 1826899878, 1918584482, 1969227037, 2001281515, 2023368125, 2039498179, 2051788381, 2061460127, 2069267110, 2075699398, 2081089314, 2085670119, 2089610331, 2093034710, 2096037586, 2098691595, 2101053571, 2103168620, 2105072996, 2106796166, 2108362327, 2109791536, 2111100552, 2112303493, 2113412330, 2114437283, 2115387130, 2116269447, 2117090813, 2117856962, 2118572919, 2119243101, 2119871411, 2120461303, 2121015852, 2121537798, 2122029592, 2122493434, 2122931299, 2123344971, 2123736059, 2124106020, 2124456175, 2124787725, 2125101763, 2125399283, 2125681194, 2125948325, 2126201433, 2126441213, 2126668298, 2126883268, 2127086657, 2127278949, 2127460589, 2127631985, 2127793506, 2127945490, 2128088244, 2128222044, 2128347141, 2128463758, 2128572095, 2128672327, 2128764606, 2128849065, 2128925811, 2128994934, 2129056501, 2129110560, 2129157136, 2129196237, 2129227847, 2129251929, 2129268426, 2129277255, 2129278312, 2129271467, 2129256561, 2129233410, 2129201800, 2129161480, 2129112170, 2129053545, 2128985244, 2128906855, 2128817916, 2128717911, 2128606255, 2128482298, 2128345305, 2128194452, 2128028813, 2127847342, 2127648860, 2127432031, 2127195339, 2126937058, 2126655214, 2126347546, 2126011445, 2125643893, 2125241376, 2124799783, 2124314271, 2123779094, 2123187386, 2122530867, 2121799464, 2120980787, 2120059418, 2119015917, 2117825402, 2116455471, 2114863093, 2112989789, 2110753906, 2108037662, 2104664315, 2100355223, 2094642347, 2086670106, 2074676188, 2054300022, 2010539237]); + wn = $toNativeArray($kindFloat32, [1.7290404663583558e-09, 1.2680928529462676e-10, 1.689751810696194e-10, 1.9862687883343e-10, 2.223243117382978e-10, 2.4244936613904144e-10, 2.601613091623989e-10, 2.761198769629658e-10, 2.9073962681813725e-10, 3.042996965518796e-10, 3.169979556627567e-10, 3.289802041894774e-10, 3.4035738116777736e-10, 3.5121602848242617e-10, 3.61625090983253e-10, 3.7164057942185025e-10, 3.813085680537398e-10, 3.906675816178762e-10, 3.997501218933053e-10, 4.0858399996679395e-10, 4.1719308563337165e-10, 4.255982233303257e-10, 4.3381759295968436e-10, 4.4186720948857783e-10, 4.497613115272969e-10, 4.57512583373898e-10, 4.6513240481438345e-10, 4.726310454117311e-10, 4.800177477726209e-10, 4.873009773476156e-10, 4.944885056978876e-10, 5.015873272284921e-10, 5.086040477664255e-10, 5.155446070048697e-10, 5.224146670812502e-10, 5.292193350214802e-10, 5.359634958068682e-10, 5.426517013518151e-10, 5.492881705038144e-10, 5.558769555769061e-10, 5.624218868405251e-10, 5.689264614971989e-10, 5.75394121238304e-10, 5.818281967329142e-10, 5.882316855831959e-10, 5.946076964136182e-10, 6.009590047817426e-10, 6.072883862451306e-10, 6.135985053390414e-10, 6.19892026598734e-10, 6.261713370037114e-10, 6.324390455780815e-10, 6.386973727678935e-10, 6.449488165749528e-10, 6.511955974453087e-10, 6.574400468473129e-10, 6.636843297158634e-10, 6.699307220081607e-10, 6.761814441702541e-10, 6.824387166481927e-10, 6.887046488657234e-10, 6.949815167800466e-10, 7.012714853260604e-10, 7.075767749498141e-10, 7.13899661608508e-10, 7.202424212593428e-10, 7.266072743483676e-10, 7.329966078550854e-10, 7.394128087589991e-10, 7.458582640396116e-10, 7.523354716987285e-10, 7.588469852493063e-10, 7.653954137154528e-10, 7.719834771435785e-10, 7.786139510912449e-10, 7.852897221383159e-10, 7.920137878869582e-10, 7.987892014504894e-10, 8.056192379868321e-10, 8.125072836762115e-10, 8.194568912323064e-10, 8.264716688799467e-10, 8.3355555791087e-10, 8.407127216614185e-10, 8.479473234679347e-10, 8.552640262671218e-10, 8.626675485068347e-10, 8.701631637464402e-10, 8.777562010564566e-10, 8.854524335966119e-10, 8.932581896381464e-10, 9.011799639857543e-10, 9.092249730890956e-10, 9.174008219758889e-10, 9.25715837318819e-10, 9.341788453909317e-10, 9.42799727177146e-10, 9.515889187738935e-10, 9.605578554783278e-10, 9.697193048552322e-10, 9.790869226478094e-10, 9.886760299337993e-10, 9.985036131254788e-10, 1.008588212947359e-09, 1.0189509236369076e-09, 1.0296150598776421e-09, 1.040606933955246e-09, 1.0519566329136865e-09, 1.0636980185552147e-09, 1.0758701707302976e-09, 1.0885182755160372e-09, 1.101694735439196e-09, 1.115461056855338e-09, 1.1298901814171813e-09, 1.1450695946990663e-09, 1.1611052119775422e-09, 1.178127595480305e-09, 1.1962995039027646e-09, 1.2158286599728285e-09, 1.2369856250415978e-09, 1.2601323318151003e-09, 1.2857697129220469e-09, 1.3146201904845611e-09, 1.3477839955200466e-09, 1.3870635751089821e-09, 1.43574030442295e-09, 1.5008658760251592e-09, 1.6030947680434338e-09]); + fn = $toNativeArray($kindFloat32, [1, 0.963599681854248, 0.9362826943397522, 0.9130436182022095, 0.8922816514968872, 0.8732430338859558, 0.8555005788803101, 0.8387836217880249, 0.8229072093963623, 0.8077383041381836, 0.7931770086288452, 0.7791460752487183, 0.7655841708183289, 0.7524415850639343, 0.7396772503852844, 0.7272568941116333, 0.7151514887809753, 0.7033361196517944, 0.6917891502380371, 0.6804918646812439, 0.6694276928901672, 0.6585819721221924, 0.6479418277740479, 0.6374954581260681, 0.6272324919700623, 0.6171433925628662, 0.6072195172309875, 0.5974531769752502, 0.5878370404243469, 0.5783646702766418, 0.5690299868583679, 0.5598273873329163, 0.550751805305481, 0.5417983531951904, 0.5329626798629761, 0.5242405533790588, 0.5156282186508179, 0.5071220397949219, 0.49871864914894104, 0.4904148280620575, 0.48220765590667725, 0.47409430146217346, 0.466072142124176, 0.45813870429992676, 0.45029163360595703, 0.44252872467041016, 0.4348478317260742, 0.42724698781967163, 0.41972434520721436, 0.41227802634239197, 0.40490642189979553, 0.39760786294937134, 0.3903807997703552, 0.3832238018512726, 0.3761354684829712, 0.3691144585609436, 0.36215949058532715, 0.3552693724632263, 0.3484429717063904, 0.3416791558265686, 0.33497685194015503, 0.32833510637283325, 0.3217529058456421, 0.3152293860912323, 0.30876362323760986, 0.3023548424243927, 0.2960021495819092, 0.2897048592567444, 0.28346219658851624, 0.2772735059261322, 0.271138072013855, 0.2650552988052368, 0.25902456045150757, 0.25304529070854187, 0.24711695313453674, 0.24123899638652802, 0.23541094362735748, 0.22963231801986694, 0.22390270233154297, 0.21822164952754974, 0.21258877217769623, 0.20700371265411377, 0.20146611332893372, 0.1959756463766098, 0.19053204357624054, 0.18513499200344086, 0.17978426814079285, 0.1744796335697174, 0.16922089457511902, 0.16400785744190216, 0.1588403731584549, 0.15371830761432648, 0.14864157140254974, 0.14361007511615753, 0.13862377405166626, 0.13368265330791473, 0.12878671288490295, 0.12393598258495331, 0.11913054436445236, 0.11437050998210907, 0.10965602099895477, 0.1049872562289238, 0.10036443918943405, 0.09578784555196762, 0.09125780314207077, 0.08677466958761215, 0.08233889937400818, 0.07795098423957825, 0.07361150532960892, 0.06932111829519272, 0.06508058309555054, 0.06089077144861221, 0.05675266310572624, 0.05266740173101425, 0.048636294901371, 0.044660862535238266, 0.040742866694927216, 0.03688438981771469, 0.03308788686990738, 0.029356317594647408, 0.025693291798233986, 0.02210330404341221, 0.018592102453112602, 0.015167297795414925, 0.011839478276669979, 0.0086244847625494, 0.005548994988203049, 0.0026696291752159595]); + rng_cooked = $toNativeArray($kindInt64, [new $Int64(1173834291, 3952672746), new $Int64(1081821761, 3130416987), new $Int64(324977939, 3414273807), new $Int64(1241840476, 2806224363), new $Int64(669549340, 1997590414), new $Int64(2103305448, 2402795971), new $Int64(1663160183, 1140819369), new $Int64(1120601685, 1788868961), new $Int64(1848035537, 1089001426), new $Int64(1235702047, 873593504), new $Int64(1911387977, 581324885), new $Int64(492609478, 1609182556), new $Int64(1069394745, 1241596776), new $Int64(1895445337, 1771189259), new $Int64(772864846, 3467012610), new $Int64(2006957225, 2344407434), new $Int64(402115761, 782467244), new $Int64(26335124, 3404933915), new $Int64(1063924276, 618867887), new $Int64(1178782866, 520164395), new $Int64(555910815, 1341358184), new $Int64(632398609, 665794848), new $Int64(1527227641, 3183648150), new $Int64(1781176124, 696329606), new $Int64(1789146075, 4151988961), new $Int64(60039534, 998951326), new $Int64(1535158725, 1364957564), new $Int64(63173359, 4090230633), new $Int64(649454641, 4009697548), new $Int64(248009524, 2569622517), new $Int64(778703922, 3742421481), new $Int64(1038377625, 1506914633), new $Int64(1738099768, 1983412561), new $Int64(236311649, 1436266083), new $Int64(1035966148, 3922894967), new $Int64(810508934, 1792680179), new $Int64(563141142, 1188796351), new $Int64(1349617468, 405968250), new $Int64(1044074554, 433754187), new $Int64(870549669, 4073162024), new $Int64(1053232044, 433121399), new $Int64(2451824, 4162580594), new $Int64(2010221076, 4132415622), new $Int64(611252600, 3033822028), new $Int64(2016407895, 824682382), new $Int64(2366218, 3583765414), new $Int64(1522878809, 535386927), new $Int64(1637219058, 2286693689), new $Int64(1453075389, 2968466525), new $Int64(193683513, 1351410206), new $Int64(1863677552, 1412813499), new $Int64(492736522, 4126267639), new $Int64(512765208, 2105529399), new $Int64(2132966268, 2413882233), new $Int64(947457634, 32226200), new $Int64(1149341356, 2032329073), new $Int64(106485445, 1356518208), new $Int64(79673492, 3430061722), new $Int64(663048513, 3820169661), new $Int64(481498454, 2981816134), new $Int64(1017155588, 4184371017), new $Int64(206574701, 2119206761), new $Int64(1295374591, 2472200560), new $Int64(1587026100, 2853524696), new $Int64(1307803389, 1681119904), new $Int64(1972496813, 95608918), new $Int64(392686347, 3690479145), new $Int64(941912722, 1397922290), new $Int64(988169623, 1516129515), new $Int64(1827305493, 1547420459), new $Int64(1311333971, 1470949486), new $Int64(194013850, 1336785672), new $Int64(2102397034, 4131677129), new $Int64(755205548, 4246329084), new $Int64(1004983461, 3788585631), new $Int64(2081005363, 3080389532), new $Int64(1501045284, 2215402037), new $Int64(391002300, 1171593935), new $Int64(1408774047, 1423855166), new $Int64(1628305930, 2276716302), new $Int64(1779030508, 2068027241), new $Int64(1369359303, 3427553297), new $Int64(189241615, 3289637845), new $Int64(1057480830, 3486407650), new $Int64(634572984, 3071877822), new $Int64(1159653919, 3363620705), new $Int64(1213226718, 4159821533), new $Int64(2070861710, 1894661), new $Int64(1472989750, 1156868282), new $Int64(348271067, 776219088), new $Int64(1646054810, 2425634259), new $Int64(1716021749, 680510161), new $Int64(1573220192, 1310101429), new $Int64(1095885995, 2964454134), new $Int64(1821788136, 3467098407), new $Int64(1990672920, 2109628894), new $Int64(7834944, 1232604732), new $Int64(309412934, 3261916179), new $Int64(1699175360, 434597899), new $Int64(235436061, 1624796439), new $Int64(521080809, 3589632480), new $Int64(1198416575, 864579159), new $Int64(208735487, 1380889830), new $Int64(619206309, 2654509477), new $Int64(1419738251, 1468209306), new $Int64(403198876, 100794388), new $Int64(956062190, 2991674471), new $Int64(1938816907, 2224662036), new $Int64(1973824487, 977097250), new $Int64(1351320195, 726419512), new $Int64(1964023751, 1747974366), new $Int64(1394388465, 1556430604), new $Int64(1097991433, 1080776742), new $Int64(1761636690, 280794874), new $Int64(117767733, 919835643), new $Int64(1180474222, 3434019658), new $Int64(196069168, 2461941785), new $Int64(133215641, 3615001066), new $Int64(417204809, 3103414427), new $Int64(790056561, 3380809712), new $Int64(879802240, 2724693469), new $Int64(547796833, 598827710), new $Int64(300924196, 3452273442), new $Int64(2071705424, 649274915), new $Int64(1346182319, 2585724112), new $Int64(636549385, 3165579553), new $Int64(1185578221, 2635894283), new $Int64(2094573470, 2053289721), new $Int64(985976581, 3169337108), new $Int64(1170569632, 144717764), new $Int64(1079216270, 1383666384), new $Int64(2022678706, 681540375), new $Int64(1375448925, 537050586), new $Int64(182715304, 315246468), new $Int64(226402871, 849323088), new $Int64(1262421183, 45543944), new $Int64(1201038398, 2319052083), new $Int64(2106775454, 3613090841), new $Int64(560472520, 2992171180), new $Int64(1765620479, 2068244785), new $Int64(917538188, 4239862634), new $Int64(777927839, 3892253031), new $Int64(720683925, 958186149), new $Int64(1724185863, 1877702262), new $Int64(1357886971, 837674867), new $Int64(1837048883, 1507589294), new $Int64(1905518400, 873336795), new $Int64(267722611, 2764496274), new $Int64(341003118, 4196182374), new $Int64(1080717893, 550964545), new $Int64(818747069, 420611474), new $Int64(222653272, 204265180), new $Int64(1549974541, 1787046383), new $Int64(1215581865, 3102292318), new $Int64(418321538, 1552199393), new $Int64(1243493047, 980542004), new $Int64(267284263, 3293718720), new $Int64(1179528763, 3771917473), new $Int64(599484404, 2195808264), new $Int64(252818753, 3894702887), new $Int64(780007692, 2099949527), new $Int64(1424094358, 338442522), new $Int64(490737398, 637158004), new $Int64(419862118, 281976339), new $Int64(574970164, 3619802330), new $Int64(1715552825, 3084554784), new $Int64(882872465, 4129772886), new $Int64(43084605, 1680378557), new $Int64(525521057, 3339087776), new $Int64(1680500332, 4220317857), new $Int64(211654685, 2959322499), new $Int64(1675600481, 1488354890), new $Int64(1312620086, 3958162143), new $Int64(920972075, 2773705983), new $Int64(1876039582, 225908689), new $Int64(963748535, 908216283), new $Int64(1541787429, 3574646075), new $Int64(319760557, 1936937569), new $Int64(1519770881, 75492235), new $Int64(816689472, 1935193178), new $Int64(2142521206, 2018250883), new $Int64(455141620, 3943126022), new $Int64(1546084160, 3066544345), new $Int64(1932392669, 2793082663), new $Int64(908474287, 3297036421), new $Int64(1640597065, 2206987825), new $Int64(1594236910, 807894872), new $Int64(366158341, 766252117), new $Int64(2060649606, 3833114345), new $Int64(845619743, 1255067973), new $Int64(1201145605, 741697208), new $Int64(671241040, 2810093753), new $Int64(1109032642, 4229340371), new $Int64(1462188720, 1361684224), new $Int64(988084219, 1906263026), new $Int64(475781207, 3904421704), new $Int64(1523946520, 1769075545), new $Int64(1062308525, 2621599764), new $Int64(1279509432, 3431891480), new $Int64(404732502, 1871896503), new $Int64(128756421, 1412808876), new $Int64(1605404688, 952876175), new $Int64(1917039957, 1824438899), new $Int64(1662295856, 1005035476), new $Int64(1990909507, 527508597), new $Int64(1288873303, 3066806859), new $Int64(565995893, 3244940914), new $Int64(1257737460, 209092916), new $Int64(1899814242, 1242699167), new $Int64(1433653252, 456723774), new $Int64(1776978905, 1001252870), new $Int64(1468772157, 2026725874), new $Int64(857254202, 2137562569), new $Int64(765939740, 3183366709), new $Int64(1533887628, 2612072960), new $Int64(56977098, 1727148468), new $Int64(949899753, 3803658212), new $Int64(1883670356, 479946959), new $Int64(685713571, 1562982345), new $Int64(201241205, 1766109365), new $Int64(700596547, 3257093788), new $Int64(1962768719, 2365720207), new $Int64(93384808, 3742754173), new $Int64(1689098413, 2878193673), new $Int64(1096135042, 2174002182), new $Int64(1313222695, 3573511231), new $Int64(1392911121, 1760299077), new $Int64(771856457, 2260779833), new $Int64(1281464374, 1452805722), new $Int64(917811730, 2940011802), new $Int64(1890251082, 1886183802), new $Int64(893897673, 2514369088), new $Int64(1644345561, 3924317791), new $Int64(172616216, 500935732), new $Int64(1403501753, 676580929), new $Int64(581571365, 1184984890), new $Int64(1455515235, 1271474274), new $Int64(318728910, 3163791473), new $Int64(2051027584, 2842487377), new $Int64(1511537551, 2170968612), new $Int64(573262976, 3535856740), new $Int64(94256461, 1488599718), new $Int64(966951817, 3408913763), new $Int64(60951736, 2501050084), new $Int64(1272353200, 1639124157), new $Int64(138001144, 4088176393), new $Int64(1574896563, 3989947576), new $Int64(1982239940, 3414355209), new $Int64(1355154361, 2275136352), new $Int64(89709303, 2151835223), new $Int64(1216338715, 1654534827), new $Int64(1467562197, 377892833), new $Int64(1664767638, 660204544), new $Int64(85706799, 390828249), new $Int64(725310955, 3402783878), new $Int64(678849488, 3717936603), new $Int64(1113532086, 2211058823), new $Int64(1564224320, 2692150867), new $Int64(1952770442, 1928910388), new $Int64(788716862, 3931011137), new $Int64(1083670504, 1112701047), new $Int64(2079333076, 2452299106), new $Int64(1251318826, 2337204777), new $Int64(1774877857, 273889282), new $Int64(1798719843, 1462008793), new $Int64(2138834788, 1554494002), new $Int64(952516517, 182675323), new $Int64(548928884, 1882802136), new $Int64(589279648, 3700220025), new $Int64(381039426, 3083431543), new $Int64(1295624457, 3622207527), new $Int64(338126939, 432729309), new $Int64(480013522, 2391914317), new $Int64(297925497, 235747924), new $Int64(2120733629, 3088823825), new $Int64(1402403853, 2314658321), new $Int64(1165929723, 2957634338), new $Int64(501323675, 4117056981), new $Int64(1564699815, 1482500298), new $Int64(1406657158, 840489337), new $Int64(799522364, 3483178565), new $Int64(532129761, 2074004656), new $Int64(724246478, 3643392642), new $Int64(1482330167, 1583624461), new $Int64(1261660694, 287473085), new $Int64(1667835381, 3136843981), new $Int64(1138806821, 1266970974), new $Int64(135185781, 1998688839), new $Int64(392094735, 1492900209), new $Int64(1031326774, 1538112737), new $Int64(76914806, 2207265429), new $Int64(260686035, 963263315), new $Int64(1671145500, 2295892134), new $Int64(1068469660, 2002560897), new $Int64(1791233343, 1369254035), new $Int64(33436120, 3353312708), new $Int64(57507843, 947771099), new $Int64(201728503, 1747061399), new $Int64(1507240140, 2047354631), new $Int64(720000810, 4165367136), new $Int64(479265078, 3388864963), new $Int64(1195302398, 286492130), new $Int64(2045622690, 2795735007), new $Int64(1431753082, 3703961339), new $Int64(1999047161, 1797825479), new $Int64(1429039600, 1116589674), new $Int64(482063550, 2593309206), new $Int64(1329049334, 3404995677), new $Int64(1396904208, 3453462936), new $Int64(1014767077, 3016498634), new $Int64(75698599, 1650371545), new $Int64(1592007860, 212344364), new $Int64(1127766888, 3843932156), new $Int64(1399463792, 3573129983), new $Int64(1256901817, 665897820), new $Int64(1071492673, 1675628772), new $Int64(243225682, 2831752928), new $Int64(2120298836, 1486294219), new $Int64(193076235, 268782709), new $Int64(1145360145, 4186179080), new $Int64(624342951, 1613720397), new $Int64(857179861, 2703686015), new $Int64(1235864944, 2205342611), new $Int64(1474779655, 1411666394), new $Int64(619028749, 677744900), new $Int64(270855115, 4172867247), new $Int64(135494707, 2163418403), new $Int64(849547544, 2841526879), new $Int64(1029966689, 1082141470), new $Int64(377371856, 4046134367), new $Int64(51415528, 2142943655), new $Int64(1897659315, 3124627521), new $Int64(998228909, 219992939), new $Int64(1068692697, 1756846531), new $Int64(1283749206, 1225118210), new $Int64(1621625642, 1647770243), new $Int64(111523943, 444807907), new $Int64(2036369448, 3952076173), new $Int64(53201823, 1461839639), new $Int64(315761893, 3699250910), new $Int64(702974850, 1373688981), new $Int64(734022261, 147523747), new $Int64(100152742, 1211276581), new $Int64(1294440951, 2548832680), new $Int64(1144696256, 1995631888), new $Int64(154500578, 2011457303), new $Int64(796460974, 3057425772), new $Int64(667839456, 81484597), new $Int64(465502760, 3646681560), new $Int64(775020923, 635548515), new $Int64(602489502, 2508044581), new $Int64(353263531, 1014917157), new $Int64(719992433, 3214891315), new $Int64(852684611, 959582252), new $Int64(226415134, 3347040449), new $Int64(1784615552, 4102971975), new $Int64(397887437, 4078022210), new $Int64(1610679822, 2851767182), new $Int64(749162636, 1540160644), new $Int64(598384772, 1057290595), new $Int64(2034890660, 3907769253), new $Int64(579300318, 4248952684), new $Int64(1092907599, 132554364), new $Int64(1061621234, 1029351092), new $Int64(697840928, 2583007416), new $Int64(298619124, 1486185789), new $Int64(55905697, 2871589073), new $Int64(2017643612, 723203291), new $Int64(146250550, 2494333952), new $Int64(1064490251, 2230939180), new $Int64(342915576, 3943232912), new $Int64(1768732449, 2181367922), new $Int64(1418222537, 2889274791), new $Int64(1824032949, 2046728161), new $Int64(1653899792, 1376052477), new $Int64(1022327048, 381236993), new $Int64(1034385958, 3188942166), new $Int64(2073003539, 350070824), new $Int64(144881592, 61758415), new $Int64(1405659422, 3492950336), new $Int64(117440928, 3093818430), new $Int64(1693893113, 2962480613), new $Int64(235432940, 3154871160), new $Int64(511005079, 3228564679), new $Int64(610731502, 888276216), new $Int64(1200780674, 3574998604), new $Int64(870415268, 1967526716), new $Int64(591335707, 1554691298), new $Int64(574459414, 339944798), new $Int64(1223764147, 1154515356), new $Int64(1825645307, 967516237), new $Int64(1546195135, 596588202), new $Int64(279882768, 3764362170), new $Int64(492091056, 266611402), new $Int64(1754227768, 2047856075), new $Int64(1146757215, 21444105), new $Int64(1198058894, 3065563181), new $Int64(1915064845, 1140663212), new $Int64(633187674, 2323741028), new $Int64(2126290159, 3103873707), new $Int64(1008658319, 2766828349), new $Int64(1661896145, 1970872996), new $Int64(1628585413, 3766615585), new $Int64(1552335120, 2036813414), new $Int64(152606527, 3105536507), new $Int64(13954645, 3396176938), new $Int64(1426081645, 1377154485), new $Int64(2085644467, 3807014186), new $Int64(543009040, 3710110597), new $Int64(396058129, 916420443), new $Int64(734556788, 2103831255), new $Int64(381322154, 717331943), new $Int64(572884752, 3550505941), new $Int64(45939673, 378749927), new $Int64(149867929, 611017331), new $Int64(592130075, 758907650), new $Int64(1012992349, 154266815), new $Int64(1107028706, 1407468696), new $Int64(469292398, 970098704), new $Int64(1862426162, 1971660656), new $Int64(998365243, 3332747885), new $Int64(1947089649, 1935189867), new $Int64(1510248801, 203520055), new $Int64(842317902, 3916463034), new $Int64(1758884993, 3474113316), new $Int64(1036101639, 316544223), new $Int64(373738757, 1650844677), new $Int64(1240292229, 4267565603), new $Int64(1077208624, 2501167616), new $Int64(626831785, 3929401789), new $Int64(56122796, 337170252), new $Int64(1186981558, 2061966842), new $Int64(1843292800, 2508461464), new $Int64(206012532, 2791377107), new $Int64(1240791848, 1227227588), new $Int64(1813978778, 1709681848), new $Int64(1153692192, 3768820575), new $Int64(1145186199, 2887126398), new $Int64(700372314, 296561685), new $Int64(700300844, 3729960077), new $Int64(575172304, 372833036), new $Int64(2078875613, 2409779288), new $Int64(1829161290, 555274064), new $Int64(1041887929, 4239804901), new $Int64(1839403216, 3723486978), new $Int64(498390553, 2145871984), new $Int64(564717933, 3565480803), new $Int64(578829821, 2197313814), new $Int64(974785092, 3613674566), new $Int64(438638731, 3042093666), new $Int64(2050927384, 3324034321), new $Int64(869420878, 3708873369), new $Int64(946682149, 1698090092), new $Int64(1618900382, 4213940712), new $Int64(304003901, 2087477361), new $Int64(381315848, 2407950639), new $Int64(851258090, 3942568569), new $Int64(923583198, 4088074412), new $Int64(723260036, 2964773675), new $Int64(1473561819, 1539178386), new $Int64(1062961552, 2694849566), new $Int64(460977733, 2120273838), new $Int64(542912908, 2484608657), new $Int64(880846449, 2956190677), new $Int64(1970902366, 4223313749), new $Int64(662161910, 3502682327), new $Int64(705634754, 4133891139), new $Int64(1116124348, 1166449596), new $Int64(1038247601, 3362705993), new $Int64(93734798, 3892921029), new $Int64(1876124043, 786869787), new $Int64(1057490746, 1046342263), new $Int64(242763728, 493777327), new $Int64(1293910447, 3304827646), new $Int64(616460742, 125356352), new $Int64(499300063, 74094113), new $Int64(1351896723, 2500816079), new $Int64(1657235204, 514015239), new $Int64(1377565129, 543520454), new $Int64(107706923, 3614531153), new $Int64(2056746300, 2356753985), new $Int64(1390062617, 2018141668), new $Int64(131272971, 2087974891), new $Int64(644556607, 3166972343), new $Int64(372256200, 1517638666), new $Int64(1212207984, 173466846), new $Int64(1451709187, 4241513471), new $Int64(733932806, 2783126920), new $Int64(1972004134, 4167264826), new $Int64(29260506, 3907395640), new $Int64(1236582087, 1539634186), new $Int64(1551526350, 178241987), new $Int64(2034206012, 182168164), new $Int64(1044953189, 2386154934), new $Int64(1379126408, 4077374341), new $Int64(32803926, 1732699140), new $Int64(1726425903, 1041306002), new $Int64(1860414813, 2068001749), new $Int64(1005320202, 3208962910), new $Int64(844054010, 697710380), new $Int64(638124245, 2228431183), new $Int64(1337169671, 3554678728), new $Int64(1396494601, 173470263), new $Int64(2061597383, 3848297795), new $Int64(1220546671, 246236185), new $Int64(163293187, 2066374846), new $Int64(1771673660, 312890749), new $Int64(703378057, 3573310289), new $Int64(1548631747, 143166754), new $Int64(613554316, 2081511079), new $Int64(1197802104, 486038032), new $Int64(240999859, 2982218564), new $Int64(364901986, 1000939191), new $Int64(1902782651, 2750454885), new $Int64(1475638791, 3375313137), new $Int64(503615608, 881302957), new $Int64(638698903, 2514186393), new $Int64(443860803, 360024739), new $Int64(1399671872, 292500025), new $Int64(1381210821, 2276300752), new $Int64(521803381, 4069087683), new $Int64(208500981, 1637778212), new $Int64(720490469, 1676670893), new $Int64(1067262482, 3855174429), new $Int64(2114075974, 2067248671), new $Int64(2058057389, 2884561259), new $Int64(1341742553, 2456511185), new $Int64(983726246, 561175414), new $Int64(427994085, 432588903), new $Int64(885133709, 4059399550), new $Int64(2054387382, 1075014784), new $Int64(413651020, 2728058415), new $Int64(1839142064, 1299703678), new $Int64(1262333188, 2347583393), new $Int64(1285481956, 2468164145), new $Int64(989129637, 1140014346), new $Int64(2033889184, 1936972070), new $Int64(409904655, 3870530098), new $Int64(1662989391, 1717789158), new $Int64(1914486492, 1153452491), new $Int64(1157059232, 3948827651), new $Int64(790338018, 2101413152), new $Int64(1495744672, 3854091229), new $Int64(83644069, 4215565463), new $Int64(762206335, 1202710438), new $Int64(1582574611, 2072216740), new $Int64(705690639, 2066751068), new $Int64(33900336, 173902580), new $Int64(1405499842, 142459001), new $Int64(172391592, 1889151926), new $Int64(1648540523, 3034199774), new $Int64(1618587731, 516490102), new $Int64(93114264, 3692577783), new $Int64(68662295, 2953948865), new $Int64(1826544975, 4041040923), new $Int64(204965672, 592046130), new $Int64(1441840008, 384297211), new $Int64(95834184, 265863924), new $Int64(2101717619, 1333136237), new $Int64(1499611781, 1406273556), new $Int64(1074670496, 426305476), new $Int64(125704633, 2750898176), new $Int64(488068495, 1633944332), new $Int64(2037723464, 3236349343), new $Int64(444060402, 4013676611), new $Int64(1718532237, 2265047407), new $Int64(1433593806, 875071080), new $Int64(1804436145, 1418843655), new $Int64(2009228711, 451657300), new $Int64(1229446621, 1866374663), new $Int64(1653472867, 1551455622), new $Int64(577191481, 3560962459), new $Int64(1669204077, 3347903778), new $Int64(1849156454, 2675874918), new $Int64(316128071, 2762991672), new $Int64(530492383, 3689068477), new $Int64(844089962, 4071997905), new $Int64(1508155730, 1381702441), new $Int64(2089931018, 2373284878), new $Int64(1283216186, 2143983064), new $Int64(308739063, 1938207195), new $Int64(1754949306, 1188152253), new $Int64(1272345009, 615870490), new $Int64(742653194, 2662252621), new $Int64(1477718295, 3839976789), new $Int64(56149435, 306752547), new $Int64(720795581, 2162363077), new $Int64(2090431015, 2767224719), new $Int64(675859549, 2628837712), new $Int64(1678405918, 2967771969), new $Int64(1694285728, 499792248), new $Int64(403352367, 4285253508), new $Int64(962357072, 2856511070), new $Int64(679471692, 2526409716), new $Int64(353777175, 1240875658), new $Int64(1232590226, 2577342868), new $Int64(1146185433, 4136853496), new $Int64(670368674, 2403540137), new $Int64(1372824515, 1371410668), new $Int64(1970921600, 371758825), new $Int64(1706420536, 1528834084), new $Int64(2075795018, 1504757260), new $Int64(685663576, 699052551), new $Int64(1641940109, 3347789870), new $Int64(1951619734, 3430604759), new $Int64(2119672219, 1935601723), new $Int64(966789690, 834676166)]); + globalRand = New(new lockedSource.ptr(new nosync.Mutex.ptr(false), NewSource(new $Int64(0, 1)))); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["math/big"] = (function() { + var $pkg = {}, $init, bytes, binary, errors, fmt, nosync, io, math, rand, strconv, strings, Word, Int, byteReader, nat, divisor, arrayType, structType, sliceType, sliceType$1, sliceType$2, ptrType$1, ptrType$3, arrayType$1, ptrType$4, sliceType$3, ptrType$6, intOne, natOne, natTwo, karatsubaThreshold, deBruijn32Lookup, deBruijn64Lookup, leafSize, cacheBase10, mulWW, divWW, addVV, subVV, addVW, subVW, shlVU, shrVU, mulAddVWW, addMulVVW, divWVW, bitLen, addWW_g, subWW_g, mulWW_g, mulAddWWW_g, bitLen_g, nlz, divWW_g, addVV_g, subVV_g, addVW_g, subVW_g, shlVU_g, shrVU_g, mulAddVWW_g, addMulVVW_g, divWVW_g, low64, Jacobi, writeMultiple, scanSign, basicMul, karatsubaAdd, karatsubaSub, karatsuba, alias, addAt, max, karatsubaLen, trailingZeroBits, greaterThan, maxPow, pow, divisors; + bytes = $packages["bytes"]; + binary = $packages["encoding/binary"]; + errors = $packages["errors"]; + fmt = $packages["fmt"]; + nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; + io = $packages["io"]; + math = $packages["math"]; + rand = $packages["math/rand"]; + strconv = $packages["strconv"]; + strings = $packages["strings"]; + Word = $pkg.Word = $newType(4, $kindUintptr, "big.Word", "Word", "math/big", null); + Int = $pkg.Int = $newType(0, $kindStruct, "big.Int", "Int", "math/big", function(neg_, abs_) { + this.$val = this; + if (arguments.length === 0) { + this.neg = false; + this.abs = nat.nil; + return; + } + this.neg = neg_; + this.abs = abs_; + }); + byteReader = $pkg.byteReader = $newType(0, $kindStruct, "big.byteReader", "byteReader", "math/big", function(ScanState_) { + this.$val = this; + if (arguments.length === 0) { + this.ScanState = $ifaceNil; + return; + } + this.ScanState = ScanState_; + }); + nat = $pkg.nat = $newType(12, $kindSlice, "big.nat", "nat", "math/big", null); + divisor = $pkg.divisor = $newType(0, $kindStruct, "big.divisor", "divisor", "math/big", function(bbb_, nbits_, ndigits_) { + this.$val = this; + if (arguments.length === 0) { + this.bbb = nat.nil; + this.nbits = 0; + this.ndigits = 0; + return; + } + this.bbb = bbb_; + this.nbits = nbits_; + this.ndigits = ndigits_; + }); + arrayType = $arrayType(divisor, 64); + structType = $structType([{prop: "Mutex", name: "", pkg: "", typ: nosync.Mutex, tag: ""}, {prop: "table", name: "table", pkg: "math/big", typ: arrayType, tag: ""}]); + sliceType = $sliceType($Uint8); + sliceType$1 = $sliceType($emptyInterface); + sliceType$2 = $sliceType(Word); + ptrType$1 = $ptrType(Int); + ptrType$3 = $ptrType(Word); + arrayType$1 = $arrayType(nat, 16); + ptrType$4 = $ptrType(nat); + sliceType$3 = $sliceType(divisor); + ptrType$6 = $ptrType(rand.Rand); + mulWW = function(x, y) { + var $ptr, _tuple, x, y, z0, z1; + z1 = 0; + z0 = 0; + _tuple = mulWW_g(x, y); + z1 = _tuple[0]; + z0 = _tuple[1]; + return [z1, z0]; + }; + divWW = function(x1, x0, y) { + var $ptr, _tuple, q, r, x0, x1, y; + q = 0; + r = 0; + _tuple = divWW_g(x1, x0, y); + q = _tuple[0]; + r = _tuple[1]; + return [q, r]; + }; + addVV = function(z, x, y) { + var $ptr, c, x, y, z; + c = 0; + c = addVV_g(z, x, y); + return c; + }; + subVV = function(z, x, y) { + var $ptr, c, x, y, z; + c = 0; + c = subVV_g(z, x, y); + return c; + }; + addVW = function(z, x, y) { + var $ptr, c, x, y, z; + c = 0; + c = addVW_g(z, x, y); + return c; + }; + subVW = function(z, x, y) { + var $ptr, c, x, y, z; + c = 0; + c = subVW_g(z, x, y); + return c; + }; + shlVU = function(z, x, s) { + var $ptr, c, s, x, z; + c = 0; + c = shlVU_g(z, x, s); + return c; + }; + shrVU = function(z, x, s) { + var $ptr, c, s, x, z; + c = 0; + c = shrVU_g(z, x, s); + return c; + }; + mulAddVWW = function(z, x, y, r) { + var $ptr, c, r, x, y, z; + c = 0; + c = mulAddVWW_g(z, x, y, r); + return c; + }; + addMulVVW = function(z, x, y) { + var $ptr, c, x, y, z; + c = 0; + c = addMulVVW_g(z, x, y); + return c; + }; + divWVW = function(z, xn, x, y) { + var $ptr, r, x, xn, y, z; + r = 0; + r = divWVW_g(z, xn, x, y); + return r; + }; + bitLen = function(x) { + var $ptr, n, x; + n = 0; + n = bitLen_g(x); + return n; + }; + addWW_g = function(x, y, c) { + var $ptr, c, x, y, yc, z0, z1; + z1 = 0; + z0 = 0; + yc = y + c >>> 0; + z0 = x + yc >>> 0; + if (z0 < x || yc < y) { + z1 = 1; + } + return [z1, z0]; + }; + subWW_g = function(x, y, c) { + var $ptr, c, x, y, yc, z0, z1; + z1 = 0; + z0 = 0; + yc = y + c >>> 0; + z0 = x - yc >>> 0; + if (z0 > x || yc < y) { + z1 = 1; + } + return [z1, z0]; + }; + mulWW_g = function(x, y) { + var $ptr, t, w0, w1, w2, x, x0, x1, y, y0, y1, z0, z1; + z1 = 0; + z0 = 0; + x0 = (x & 65535) >>> 0; + x1 = x >>> 16 >>> 0; + y0 = (y & 65535) >>> 0; + y1 = y >>> 16 >>> 0; + w0 = $imul(x0, y0) >>> 0; + t = ($imul(x1, y0) >>> 0) + (w0 >>> 16 >>> 0) >>> 0; + w1 = (t & 65535) >>> 0; + w2 = t >>> 16 >>> 0; + w1 = w1 + (($imul(x0, y1) >>> 0)) >>> 0; + z1 = (($imul(x1, y1) >>> 0) + w2 >>> 0) + (w1 >>> 16 >>> 0) >>> 0; + z0 = $imul(x, y) >>> 0; + return [z1, z0]; + }; + mulAddWWW_g = function(x, y, c) { + var $ptr, _tuple, c, x, y, z0, z1, zz0; + z1 = 0; + z0 = 0; + _tuple = mulWW_g(x, y); + z1 = _tuple[0]; + zz0 = _tuple[1]; + z0 = zz0 + c >>> 0; + if (z0 < zz0) { + z1 = z1 + (1) >>> 0; + } + return [z1, z0]; + }; + bitLen_g = function(x) { + var $ptr, n, x, y, y$1, y$2, y$3; + n = 0; + while (true) { + if (!(x >= 32768)) { break; } + n = n + (16) >> 0; + x = (y = (16), y < 32 ? (x >>> y) : 0) >>> 0; + } + if (x >= 128) { + x = (y$1 = (8), y$1 < 32 ? (x >>> y$1) : 0) >>> 0; + n = n + (8) >> 0; + } + if (x >= 8) { + x = (y$2 = (4), y$2 < 32 ? (x >>> y$2) : 0) >>> 0; + n = n + (4) >> 0; + } + if (x >= 2) { + x = (y$3 = (2), y$3 < 32 ? (x >>> y$3) : 0) >>> 0; + n = n + (2) >> 0; + } + if (x >= 1) { + n = n + (1) >> 0; + } + return n; + }; + nlz = function(x) { + var $ptr, x; + return ((32 - bitLen(x) >> 0) >>> 0); + }; + divWW_g = function(u1, u0, v) { + var $ptr, _q, _q$1, _tmp, _tmp$1, _tmp$2, _tmp$3, q, q0, q1, r, rhat, s, u0, u1, un0, un1, un10, un21, un32, v, vn0, vn1, y, y$1, y$2, y$3, y$4; + q = 0; + r = 0; + if (u1 >= v) { + _tmp = 4294967295; + _tmp$1 = 4294967295; + q = _tmp; + r = _tmp$1; + return [q, r]; + } + s = nlz(v); + v = (y = (s), y < 32 ? (v << y) : 0) >>> 0; + vn1 = v >>> 16 >>> 0; + vn0 = (v & 65535) >>> 0; + un32 = (((y$1 = s, y$1 < 32 ? (u1 << y$1) : 0) >>> 0) | ((y$2 = ((32 - s >>> 0)), y$2 < 32 ? (u0 >>> y$2) : 0) >>> 0)) >>> 0; + un10 = (y$3 = s, y$3 < 32 ? (u0 << y$3) : 0) >>> 0; + un1 = un10 >>> 16 >>> 0; + un0 = (un10 & 65535) >>> 0; + q1 = (_q = un32 / vn1, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + rhat = un32 - ($imul(q1, vn1) >>> 0) >>> 0; + while (true) { + if (!(q1 >= 65536 || ($imul(q1, vn0) >>> 0) > (($imul(65536, rhat) >>> 0) + un1 >>> 0))) { break; } + q1 = q1 - (1) >>> 0; + rhat = rhat + (vn1) >>> 0; + if (rhat >= 65536) { + break; + } + } + un21 = (($imul(un32, 65536) >>> 0) + un1 >>> 0) - ($imul(q1, v) >>> 0) >>> 0; + q0 = (_q$1 = un21 / vn1, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); + rhat = un21 - ($imul(q0, vn1) >>> 0) >>> 0; + while (true) { + if (!(q0 >= 65536 || ($imul(q0, vn0) >>> 0) > (($imul(65536, rhat) >>> 0) + un0 >>> 0))) { break; } + q0 = q0 - (1) >>> 0; + rhat = rhat + (vn1) >>> 0; + if (rhat >= 65536) { + break; + } + } + _tmp$2 = ($imul(q1, 65536) >>> 0) + q0 >>> 0; + _tmp$3 = (y$4 = s, y$4 < 32 ? ((((($imul(un21, 65536) >>> 0) + un0 >>> 0) - ($imul(q0, v) >>> 0) >>> 0)) >>> y$4) : 0) >>> 0; + q = _tmp$2; + r = _tmp$3; + return [q, r]; + }; + addVV_g = function(z, x, y) { + var $ptr, _i, _i$1, _ref, _ref$1, _tuple, c, i, i$1, x, xi, y, yi, z, zi; + c = 0; + if (false) { + _ref = z; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + _tuple = addWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i]), c); + c = _tuple[0]; + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[1]); + _i++; + } + return c; + } + _ref$1 = $subslice(x, 0, z.$length); + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$1 = _i$1; + xi = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); + yi = ((i$1 < 0 || i$1 >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i$1]); + zi = (xi + yi >>> 0) + c >>> 0; + ((i$1 < 0 || i$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i$1] = zi); + c = (((((xi & yi) >>> 0) | (((((xi | yi) >>> 0)) & ~zi) >>> 0)) >>> 0)) >>> 31 >>> 0; + _i$1++; + } + return c; + }; + subVV_g = function(z, x, y) { + var $ptr, _i, _i$1, _ref, _ref$1, _tuple, c, i, i$1, x, xi, y, yi, z, zi; + c = 0; + if (false) { + _ref = z; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + _tuple = subWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i]), c); + c = _tuple[0]; + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[1]); + _i++; + } + return c; + } + _ref$1 = $subslice(x, 0, z.$length); + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$1 = _i$1; + xi = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); + yi = ((i$1 < 0 || i$1 >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i$1]); + zi = (xi - yi >>> 0) - c >>> 0; + ((i$1 < 0 || i$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i$1] = zi); + c = (((((yi & ~xi) >>> 0) | (((((yi | (~xi >>> 0)) >>> 0)) & zi) >>> 0)) >>> 0)) >>> 31 >>> 0; + _i$1++; + } + return c; + }; + addVW_g = function(z, x, y) { + var $ptr, _i, _i$1, _ref, _ref$1, _tuple, c, i, i$1, x, xi, y, z, zi; + c = 0; + if (false) { + c = y; + _ref = z; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + _tuple = addWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), c, 0); + c = _tuple[0]; + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[1]); + _i++; + } + return c; + } + c = y; + _ref$1 = $subslice(x, 0, z.$length); + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$1 = _i$1; + xi = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); + zi = xi + c >>> 0; + ((i$1 < 0 || i$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i$1] = zi); + c = ((xi & ~zi) >>> 0) >>> 31 >>> 0; + _i$1++; + } + return c; + }; + subVW_g = function(z, x, y) { + var $ptr, _i, _i$1, _ref, _ref$1, _tuple, c, i, i$1, x, xi, y, z, zi; + c = 0; + if (false) { + c = y; + _ref = z; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + _tuple = subWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), c, 0); + c = _tuple[0]; + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[1]); + _i++; + } + return c; + } + c = y; + _ref$1 = $subslice(x, 0, z.$length); + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$1 = _i$1; + xi = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); + zi = xi - c >>> 0; + ((i$1 < 0 || i$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i$1] = zi); + c = (((zi & ~xi) >>> 0)) >>> 31 >>> 0; + _i$1++; + } + return c; + }; + shlVU_g = function(z, x, s) { + var $C5$9D, $ptr, c, i, n, s, w, w1, x, x$1, x$2, y, y$1, y$2, y$3, z; + c = 0; + n = z.$length; + if (n > 0) { + $C5$9D = 32 - s >>> 0; + w1 = (x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); + c = (y = $C5$9D, y < 32 ? (w1 >>> y) : 0) >>> 0; + i = n - 1 >> 0; + while (true) { + if (!(i > 0)) { break; } + w = w1; + w1 = (x$2 = i - 1 >> 0, ((x$2 < 0 || x$2 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$2])); + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((y$1 = s, y$1 < 32 ? (w << y$1) : 0) >>> 0) | ((y$2 = $C5$9D, y$2 < 32 ? (w1 >>> y$2) : 0) >>> 0)) >>> 0)); + i = i - (1) >> 0; + } + (0 >= z.$length ? $throwRuntimeError("index out of range") : z.$array[z.$offset + 0] = ((y$3 = s, y$3 < 32 ? (w1 << y$3) : 0) >>> 0)); + } + return c; + }; + shrVU_g = function(z, x, s) { + var $C5$9D, $ptr, c, i, n, s, w, w1, x, x$1, x$2, y, y$1, y$2, y$3, z; + c = 0; + n = z.$length; + if (n > 0) { + $C5$9D = 32 - s >>> 0; + w1 = (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0]); + c = (y = $C5$9D, y < 32 ? (w1 << y) : 0) >>> 0; + i = 0; + while (true) { + if (!(i < (n - 1 >> 0))) { break; } + w = w1; + w1 = (x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((y$1 = s, y$1 < 32 ? (w >>> y$1) : 0) >>> 0) | ((y$2 = $C5$9D, y$2 < 32 ? (w1 << y$2) : 0) >>> 0)) >>> 0)); + i = i + (1) >> 0; + } + (x$2 = n - 1 >> 0, ((x$2 < 0 || x$2 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + x$2] = ((y$3 = s, y$3 < 32 ? (w1 >>> y$3) : 0) >>> 0))); + } + return c; + }; + mulAddVWW_g = function(z, x, y, r) { + var $ptr, _i, _ref, _tuple, c, i, r, x, y, z; + c = 0; + c = r; + _ref = z; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + _tuple = mulAddWWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), y, c); + c = _tuple[0]; + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[1]); + _i++; + } + return c; + }; + addMulVVW_g = function(z, x, y) { + var $ptr, _i, _ref, _tuple, _tuple$1, c, i, x, y, z, z0, z1; + c = 0; + _ref = z; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + _tuple = mulAddWWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), y, ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i])); + z1 = _tuple[0]; + z0 = _tuple[1]; + _tuple$1 = addWW_g(z0, c, 0); + c = _tuple$1[0]; + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple$1[1]); + c = c + (z1) >>> 0; + _i++; + } + return c; + }; + divWVW_g = function(z, xn, x, y) { + var $ptr, _tuple, i, r, x, xn, y, z; + r = 0; + r = xn; + i = z.$length - 1 >> 0; + while (true) { + if (!(i >= 0)) { break; } + _tuple = divWW_g(r, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), y); + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[0]); + r = _tuple[1]; + i = i - (1) >> 0; + } + return r; + }; + Int.ptr.prototype.Sign = function() { + var $ptr, x; + x = this; + if (x.abs.$length === 0) { + return 0; + } + if (x.neg) { + return -1; + } + return 1; + }; + Int.prototype.Sign = function() { return this.$val.Sign(); }; + Int.ptr.prototype.SetInt64 = function(x) { + var $ptr, neg, x, z; + z = this; + neg = false; + if ((x.$high < 0 || (x.$high === 0 && x.$low < 0))) { + neg = true; + x = new $Int64(-x.$high, -x.$low); + } + z.abs = z.abs.setUint64(new $Uint64(x.$high, x.$low)); + z.neg = neg; + return z; + }; + Int.prototype.SetInt64 = function(x) { return this.$val.SetInt64(x); }; + Int.ptr.prototype.SetUint64 = function(x) { + var $ptr, x, z; + z = this; + z.abs = z.abs.setUint64(x); + z.neg = false; + return z; + }; + Int.prototype.SetUint64 = function(x) { return this.$val.SetUint64(x); }; + Int.ptr.prototype.Set = function(x) { + var $ptr, x, z; + z = this; + if (!(z === x)) { + z.abs = z.abs.set(x.abs); + z.neg = x.neg; + } + return z; + }; + Int.prototype.Set = function(x) { return this.$val.Set(x); }; + Int.ptr.prototype.Bits = function() { + var $ptr, x, x$1; + x = this; + return (x$1 = x.abs, $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)); + }; + Int.prototype.Bits = function() { return this.$val.Bits(); }; + Int.ptr.prototype.SetBits = function(abs) { + var $ptr, abs, z; + z = this; + z.abs = $subslice(new nat(abs.$array), abs.$offset, abs.$offset + abs.$length).norm(); + z.neg = false; + return z; + }; + Int.prototype.SetBits = function(abs) { return this.$val.SetBits(abs); }; + Int.ptr.prototype.Abs = function(x) { + var $ptr, x, z; + z = this; + z.Set(x); + z.neg = false; + return z; + }; + Int.prototype.Abs = function(x) { return this.$val.Abs(x); }; + Int.ptr.prototype.Neg = function(x) { + var $ptr, x, z; + z = this; + z.Set(x); + z.neg = z.abs.$length > 0 && !z.neg; + return z; + }; + Int.prototype.Neg = function(x) { return this.$val.Neg(x); }; + Int.ptr.prototype.Add = function(x, y) { + var $ptr, neg, x, y, z; + z = this; + neg = x.neg; + if (x.neg === y.neg) { + z.abs = z.abs.add(x.abs, y.abs); + } else { + if (x.abs.cmp(y.abs) >= 0) { + z.abs = z.abs.sub(x.abs, y.abs); + } else { + neg = !neg; + z.abs = z.abs.sub(y.abs, x.abs); + } + } + z.neg = z.abs.$length > 0 && neg; + return z; + }; + Int.prototype.Add = function(x, y) { return this.$val.Add(x, y); }; + Int.ptr.prototype.Sub = function(x, y) { + var $ptr, neg, x, y, z; + z = this; + neg = x.neg; + if (!(x.neg === y.neg)) { + z.abs = z.abs.add(x.abs, y.abs); + } else { + if (x.abs.cmp(y.abs) >= 0) { + z.abs = z.abs.sub(x.abs, y.abs); + } else { + neg = !neg; + z.abs = z.abs.sub(y.abs, x.abs); + } + } + z.neg = z.abs.$length > 0 && neg; + return z; + }; + Int.prototype.Sub = function(x, y) { return this.$val.Sub(x, y); }; + Int.ptr.prototype.Mul = function(x, y) { + var $ptr, x, y, z; + z = this; + z.abs = z.abs.mul(x.abs, y.abs); + z.neg = z.abs.$length > 0 && !(x.neg === y.neg); + return z; + }; + Int.prototype.Mul = function(x, y) { return this.$val.Mul(x, y); }; + Int.ptr.prototype.MulRange = function(a, b) { + var $ptr, _tmp, _tmp$1, a, b, neg, x, x$1, z; + z = this; + if ((a.$high > b.$high || (a.$high === b.$high && a.$low > b.$low))) { + return z.SetInt64(new $Int64(0, 1)); + } else if ((a.$high < 0 || (a.$high === 0 && a.$low <= 0)) && (b.$high > 0 || (b.$high === 0 && b.$low >= 0))) { + return z.SetInt64(new $Int64(0, 0)); + } + neg = false; + if ((a.$high < 0 || (a.$high === 0 && a.$low < 0))) { + neg = (x = (x$1 = new $Int64(b.$high - a.$high, b.$low - a.$low), new $Int64(x$1.$high & 0, (x$1.$low & 1) >>> 0)), (x.$high === 0 && x.$low === 0)); + _tmp = new $Int64(-b.$high, -b.$low); + _tmp$1 = new $Int64(-a.$high, -a.$low); + a = _tmp; + b = _tmp$1; + } + z.abs = z.abs.mulRange(new $Uint64(a.$high, a.$low), new $Uint64(b.$high, b.$low)); + z.neg = neg; + return z; + }; + Int.prototype.MulRange = function(a, b) { return this.$val.MulRange(a, b); }; + Int.ptr.prototype.Binomial = function(n, k) { + var $ptr, _tmp, _tmp$1, a, b, k, n, x, x$1, z; + z = this; + if ((x = $div64(n, new $Int64(0, 2), false), (x.$high < k.$high || (x.$high === k.$high && x.$low < k.$low))) && (k.$high < n.$high || (k.$high === n.$high && k.$low <= n.$low))) { + k = new $Int64(n.$high - k.$high, n.$low - k.$low); + } + _tmp = new Int.ptr(false, nat.nil); + _tmp$1 = new Int.ptr(false, nat.nil); + a = $clone(_tmp, Int); + b = $clone(_tmp$1, Int); + a.MulRange((x$1 = new $Int64(n.$high - k.$high, n.$low - k.$low), new $Int64(x$1.$high + 0, x$1.$low + 1)), n); + b.MulRange(new $Int64(0, 1), k); + return z.Quo(a, b); + }; + Int.prototype.Binomial = function(n, k) { return this.$val.Binomial(n, k); }; + Int.ptr.prototype.Quo = function(x, y) { + var $ptr, _tuple, x, y, z; + z = this; + _tuple = z.abs.div(nat.nil, x.abs, y.abs); + z.abs = _tuple[0]; + z.neg = z.abs.$length > 0 && !(x.neg === y.neg); + return z; + }; + Int.prototype.Quo = function(x, y) { return this.$val.Quo(x, y); }; + Int.ptr.prototype.Rem = function(x, y) { + var $ptr, _tuple, x, y, z; + z = this; + _tuple = nat.nil.div(z.abs, x.abs, y.abs); + z.abs = _tuple[1]; + z.neg = z.abs.$length > 0 && x.neg; + return z; + }; + Int.prototype.Rem = function(x, y) { return this.$val.Rem(x, y); }; + Int.ptr.prototype.QuoRem = function(x, y, r) { + var $ptr, _tmp, _tmp$1, _tuple, r, x, y, z; + z = this; + _tuple = z.abs.div(r.abs, x.abs, y.abs); + z.abs = _tuple[0]; + r.abs = _tuple[1]; + _tmp = z.abs.$length > 0 && !(x.neg === y.neg); + _tmp$1 = r.abs.$length > 0 && x.neg; + z.neg = _tmp; + r.neg = _tmp$1; + return [z, r]; + }; + Int.prototype.QuoRem = function(x, y, r) { return this.$val.QuoRem(x, y, r); }; + Int.ptr.prototype.Div = function(x, y) { + var $ptr, r, x, y, y_neg, z; + z = this; + y_neg = y.neg; + r = new Int.ptr(false, nat.nil); + z.QuoRem(x, y, r); + if (r.neg) { + if (y_neg) { + z.Add(z, intOne); + } else { + z.Sub(z, intOne); + } + } + return z; + }; + Int.prototype.Div = function(x, y) { return this.$val.Div(x, y); }; + Int.ptr.prototype.Mod = function(x, y) { + var $ptr, q, x, y, y0, z; + z = this; + y0 = y; + if (z === y || alias(z.abs, y.abs)) { + y0 = new Int.ptr(false, nat.nil).Set(y); + } + q = new Int.ptr(false, nat.nil); + q.QuoRem(x, y, z); + if (z.neg) { + if (y0.neg) { + z.Sub(z, y0); + } else { + z.Add(z, y0); + } + } + return z; + }; + Int.prototype.Mod = function(x, y) { return this.$val.Mod(x, y); }; + Int.ptr.prototype.DivMod = function(x, y, m) { + var $ptr, m, x, y, y0, z; + z = this; + y0 = y; + if (z === y || alias(z.abs, y.abs)) { + y0 = new Int.ptr(false, nat.nil).Set(y); + } + z.QuoRem(x, y, m); + if (m.neg) { + if (y0.neg) { + z.Add(z, intOne); + m.Sub(m, y0); + } else { + z.Sub(z, intOne); + m.Add(m, y0); + } + } + return [z, m]; + }; + Int.prototype.DivMod = function(x, y, m) { return this.$val.DivMod(x, y, m); }; + Int.ptr.prototype.Cmp = function(y) { + var $ptr, r, x, y; + r = 0; + x = this; + if (x.neg === y.neg) { + r = x.abs.cmp(y.abs); + if (x.neg) { + r = -r; + } + } else if (x.neg) { + r = -1; + } else { + r = 1; + } + return r; + }; + Int.prototype.Cmp = function(y) { return this.$val.Cmp(y); }; + low64 = function(z) { + var $ptr, v, x, x$1, x$2, z; + if (z.$length === 0) { + return new $Uint64(0, 0); + } + v = (x = (0 >= z.$length ? $throwRuntimeError("index out of range") : z.$array[z.$offset + 0]), new $Uint64(0, x.constructor === Number ? x : 1)); + if (true && z.$length > 1) { + v = (x$1 = $shiftLeft64((x$2 = (1 >= z.$length ? $throwRuntimeError("index out of range") : z.$array[z.$offset + 1]), new $Uint64(0, x$2.constructor === Number ? x$2 : 1)), 32), new $Uint64(v.$high | x$1.$high, (v.$low | x$1.$low) >>> 0)); + } + return v; + }; + Int.ptr.prototype.Int64 = function() { + var $ptr, v, x, x$1; + x = this; + v = (x$1 = low64(x.abs), new $Int64(x$1.$high, x$1.$low)); + if (x.neg) { + v = new $Int64(-v.$high, -v.$low); + } + return v; + }; + Int.prototype.Int64 = function() { return this.$val.Int64(); }; + Int.ptr.prototype.Uint64 = function() { + var $ptr, x; + x = this; + return low64(x.abs); + }; + Int.prototype.Uint64 = function() { return this.$val.Uint64(); }; + Int.ptr.prototype.SetString = function(s, base) { + var $ptr, _r, _tuple, _tuple$1, base, err, r, s, z, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; base = $f.base; err = $f.err; r = $f.r; s = $f.s; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + z = this; + r = strings.NewReader(s); + _r = z.scan(r, base); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + err = _tuple[2]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [ptrType$1.nil, false]; + } + _tuple$1 = r.ReadByte(); + err = _tuple$1[1]; + if (!($interfaceIsEqual(err, io.EOF))) { + return [ptrType$1.nil, false]; + } + return [z, true]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.SetString }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.base = base; $f.err = err; $f.r = r; $f.s = s; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.prototype.SetString = function(s, base) { return this.$val.SetString(s, base); }; + Int.ptr.prototype.SetBytes = function(buf) { + var $ptr, buf, z; + z = this; + z.abs = z.abs.setBytes(buf); + z.neg = false; + return z; + }; + Int.prototype.SetBytes = function(buf) { return this.$val.SetBytes(buf); }; + Int.ptr.prototype.Bytes = function() { + var $ptr, buf, x; + x = this; + buf = $makeSlice(sliceType, ($imul(x.abs.$length, 4))); + return $subslice(buf, x.abs.bytes(buf)); + }; + Int.prototype.Bytes = function() { return this.$val.Bytes(); }; + Int.ptr.prototype.BitLen = function() { + var $ptr, x; + x = this; + return x.abs.bitLen(); + }; + Int.prototype.BitLen = function() { return this.$val.BitLen(); }; + Int.ptr.prototype.Exp = function(x, y, m) { + var $ptr, m, mWords, x, y, yWords, z; + z = this; + yWords = nat.nil; + if (!y.neg) { + yWords = y.abs; + } + mWords = nat.nil; + if (!(m === ptrType$1.nil)) { + mWords = m.abs; + } + z.abs = z.abs.expNN(x.abs, yWords, mWords); + z.neg = z.abs.$length > 0 && x.neg && yWords.$length > 0 && ((((0 >= yWords.$length ? $throwRuntimeError("index out of range") : yWords.$array[yWords.$offset + 0]) & 1) >>> 0) === 1); + if (z.neg && mWords.$length > 0) { + z.abs = z.abs.sub(mWords, z.abs); + z.neg = false; + } + return z; + }; + Int.prototype.Exp = function(x, y, m) { return this.$val.Exp(x, y, m); }; + Int.ptr.prototype.GCD = function(x, y, a, b) { + var $ptr, A, B, X, Y, _tmp, _tmp$1, _tuple, a, b, lastX, lastY, q, r, temp, x, y, z; + z = this; + if (a.Sign() <= 0 || b.Sign() <= 0) { + z.SetInt64(new $Int64(0, 0)); + if (!(x === ptrType$1.nil)) { + x.SetInt64(new $Int64(0, 0)); + } + if (!(y === ptrType$1.nil)) { + y.SetInt64(new $Int64(0, 0)); + } + return z; + } + if (x === ptrType$1.nil && y === ptrType$1.nil) { + return z.binaryGCD(a, b); + } + A = new Int.ptr(false, nat.nil).Set(a); + B = new Int.ptr(false, nat.nil).Set(b); + X = new Int.ptr(false, nat.nil); + Y = new Int.ptr(false, nat.nil).SetInt64(new $Int64(0, 1)); + lastX = new Int.ptr(false, nat.nil).SetInt64(new $Int64(0, 1)); + lastY = new Int.ptr(false, nat.nil); + q = new Int.ptr(false, nat.nil); + temp = new Int.ptr(false, nat.nil); + while (true) { + if (!(B.abs.$length > 0)) { break; } + r = new Int.ptr(false, nat.nil); + _tuple = q.QuoRem(A, B, r); + q = _tuple[0]; + r = _tuple[1]; + _tmp = B; + _tmp$1 = r; + A = _tmp; + B = _tmp$1; + temp.Set(X); + X.Mul(X, q); + X.neg = !X.neg; + X.Add(X, lastX); + lastX.Set(temp); + temp.Set(Y); + Y.Mul(Y, q); + Y.neg = !Y.neg; + Y.Add(Y, lastY); + lastY.Set(temp); + } + if (!(x === ptrType$1.nil)) { + Int.copy(x, lastX); + } + if (!(y === ptrType$1.nil)) { + Int.copy(y, lastY); + } + Int.copy(z, A); + return z; + }; + Int.prototype.GCD = function(x, y, a, b) { return this.$val.GCD(x, y, a, b); }; + Int.ptr.prototype.binaryGCD = function(a, b) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, a, b, k, t, u, v, vk, x, z; + z = this; + u = z; + v = new Int.ptr(false, nat.nil); + if (a.abs.$length > b.abs.$length) { + v.Rem(a, b); + u.Set(b); + } else if (a.abs.$length < b.abs.$length) { + v.Rem(b, a); + u.Set(a); + } else { + v.Set(b); + u.Set(a); + } + if (v.abs.$length === 0) { + return u; + } + k = u.abs.trailingZeroBits(); + vk = v.abs.trailingZeroBits(); + if (vk < k) { + k = vk; + } + u.Rsh(u, k); + v.Rsh(v, k); + t = new Int.ptr(false, nat.nil); + if (!(((((x = u.abs, (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0])) & 1) >>> 0) === 0))) { + t.Neg(v); + } else { + t.Set(u); + } + while (true) { + if (!(t.abs.$length > 0)) { break; } + t.Rsh(t, t.abs.trailingZeroBits()); + if (t.neg) { + _tmp = t; + _tmp$1 = v; + v = _tmp; + t = _tmp$1; + v.neg = v.abs.$length > 0 && !v.neg; + } else { + _tmp$2 = t; + _tmp$3 = u; + u = _tmp$2; + t = _tmp$3; + } + t.Sub(u, v); + } + return z.Lsh(u, k); + }; + Int.prototype.binaryGCD = function(a, b) { return this.$val.binaryGCD(a, b); }; + Int.ptr.prototype.ProbablyPrime = function(n) { + var $ptr, _r, _v, n, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _v = $f._v; n = $f.n; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + x = this; + if (n <= 0) { + $panic(new $String("non-positive n for ProbablyPrime")); + } + if (!(!x.neg)) { _v = false; $s = 1; continue s; } + _r = x.abs.probablyPrime(n); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r; case 1: + /* */ $s = 3; case 3: + return _v; + /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.ProbablyPrime }; } $f.$ptr = $ptr; $f._r = _r; $f._v = _v; $f.n = n; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.prototype.ProbablyPrime = function(n) { return this.$val.ProbablyPrime(n); }; + Int.ptr.prototype.Rand = function(rnd, n) { + var $ptr, _r, n, rnd, z, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; n = $f.n; rnd = $f.rnd; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + z = this; + z.neg = false; + if (n.neg || (n.abs.$length === 0)) { + z.abs = nat.nil; + return z; + } + _r = z.abs.random(rnd, n.abs, n.abs.bitLen()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + z.abs = _r; + return z; + /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Rand }; } $f.$ptr = $ptr; $f._r = _r; $f.n = n; $f.rnd = rnd; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.prototype.Rand = function(rnd, n) { return this.$val.Rand(rnd, n); }; + Int.ptr.prototype.ModInverse = function(g, n) { + var $ptr, d, g, n, z; + z = this; + d = new Int.ptr(false, nat.nil); + d.GCD(z, ptrType$1.nil, g, n); + if (z.neg) { + z.Add(z, n); + } + return z; + }; + Int.prototype.ModInverse = function(g, n) { return this.$val.ModInverse(g, n); }; + Jacobi = function(x, y) { + var $ptr, _r, _tmp, _tmp$1, _tmp$2, a, b, bmod8, c, j, s, x, x$1, x$2, x$3, x$4, y, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; a = $f.a; b = $f.b; bmod8 = $f.bmod8; c = $f.c; j = $f.j; s = $f.s; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + a = [a]; + b = [b]; + c = [c]; + /* */ if ((y.abs.$length === 0) || ((((x$1 = y.abs, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])) & 1) >>> 0) === 0)) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ((y.abs.$length === 0) || ((((x$1 = y.abs, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])) & 1) >>> 0) === 0)) { */ case 1: + _r = fmt.Sprintf("big: invalid 2nd argument to Int.Jacobi: need odd integer but got %s", new sliceType$1([y])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $panic(new $String(_r)); + /* } */ case 2: + _tmp = new Int.ptr(false, nat.nil); + _tmp$1 = new Int.ptr(false, nat.nil); + _tmp$2 = new Int.ptr(false, nat.nil); + a[0] = $clone(_tmp, Int); + b[0] = $clone(_tmp$1, Int); + c[0] = $clone(_tmp$2, Int); + a[0].Set(x); + b[0].Set(y); + j = 1; + if (b[0].neg) { + if (a[0].neg) { + j = -1; + } + b[0].neg = false; + } + while (true) { + if (b[0].Cmp(intOne) === 0) { + return j; + } + if (a[0].abs.$length === 0) { + return 0; + } + a[0].Mod(a[0], b[0]); + if (a[0].abs.$length === 0) { + return 0; + } + s = a[0].abs.trailingZeroBits(); + if (!((((s & 1) >>> 0) === 0))) { + bmod8 = ((x$2 = b[0].abs, (0 >= x$2.$length ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + 0])) & 7) >>> 0; + if ((bmod8 === 3) || (bmod8 === 5)) { + j = -j; + } + } + c[0].Rsh(a[0], s); + if (((((x$3 = b[0].abs, (0 >= x$3.$length ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + 0])) & 3) >>> 0) === 3) && ((((x$4 = c[0].abs, (0 >= x$4.$length ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + 0])) & 3) >>> 0) === 3)) { + j = -j; + } + a[0].Set(b[0]); + b[0].Set(c[0]); + } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Jacobi }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.a = a; $f.b = b; $f.bmod8 = bmod8; $f.c = c; $f.j = j; $f.s = s; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Jacobi = Jacobi; + Int.ptr.prototype.modSqrt3Mod4Prime = function(x, p) { + var $ptr, p, x, z; + z = this; + z.Set(p); + z.Add(z, intOne); + z.Rsh(z, 2); + z.Exp(x, z, p); + return z; + }; + Int.prototype.modSqrt3Mod4Prime = function(x, p) { return this.$val.modSqrt3Mod4Prime(x, p); }; + Int.ptr.prototype.modSqrtTonelliShanks = function(x, p) { + var $ptr, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, b, e, g, m, n, p, r, s, t, x, y, z, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; b = $f.b; e = $f.e; g = $f.g; m = $f.m; n = $f.n; p = $f.p; r = $f.r; s = $f.s; t = $f.t; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + b = [b]; + g = [g]; + n = [n]; + s = [s]; + t = [t]; + y = [y]; + z = this; + s[0] = new Int.ptr(false, nat.nil); + s[0].Sub(p, intOne); + e = s[0].abs.trailingZeroBits(); + s[0].Rsh(s[0], e); + n[0] = new Int.ptr(false, nat.nil); + n[0].SetInt64(new $Int64(0, 2)); + /* while (true) { */ case 1: + _r = Jacobi(n[0], p); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* if (!(!((_r === -1)))) { break; } */ if(!(!((_r === -1)))) { $s = 2; continue; } + n[0].Add(n[0], intOne); + /* } */ $s = 1; continue; case 2: + _tmp = new Int.ptr(false, nat.nil); + _tmp$1 = new Int.ptr(false, nat.nil); + _tmp$2 = new Int.ptr(false, nat.nil); + _tmp$3 = new Int.ptr(false, nat.nil); + y[0] = $clone(_tmp, Int); + b[0] = $clone(_tmp$1, Int); + g[0] = $clone(_tmp$2, Int); + t[0] = $clone(_tmp$3, Int); + y[0].Add(s[0], intOne); + y[0].Rsh(y[0], 1); + y[0].Exp(x, y[0], p); + b[0].Exp(x, s[0], p); + g[0].Exp(n[0], s[0], p); + r = e; + while (true) { + m = 0; + t[0].Set(b[0]); + while (true) { + if (!(!((t[0].Cmp(intOne) === 0)))) { break; } + t[0].Mul(t[0], t[0]).Mod(t[0], p); + m = m + (1) >>> 0; + } + if (m === 0) { + return z.Set(y[0]); + } + t[0].SetInt64(new $Int64(0, 0)).SetBit(t[0], (((r - m >>> 0) - 1 >>> 0) >> 0), 1).Exp(g[0], t[0], p); + g[0].Mul(t[0], t[0]).Mod(g[0], p); + y[0].Mul(y[0], t[0]).Mod(y[0], p); + b[0].Mul(b[0], g[0]).Mod(b[0], p); + r = m; + } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.modSqrtTonelliShanks }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.b = b; $f.e = e; $f.g = g; $f.m = m; $f.n = n; $f.p = p; $f.r = r; $f.s = s; $f.t = t; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.prototype.modSqrtTonelliShanks = function(x, p) { return this.$val.modSqrtTonelliShanks(x, p); }; + Int.ptr.prototype.ModSqrt = function(x, p) { + var $ptr, _1, _r, _r$1, _r$2, p, x, x$1, z, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; p = $f.p; x = $f.x; x$1 = $f.x$1; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + z = this; + _r = Jacobi(x, p); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _1 = _r; + if (_1 === (-1)) { + return ptrType$1.nil; + } else if (_1 === (0)) { + return z.SetInt64(new $Int64(0, 0)); + } else if (_1 === (1)) { + /* break; */ $s = 1; continue; + } + case 1: + if (x.neg || x.Cmp(p) >= 0) { + x = new Int.ptr(false, nat.nil).Mod(x, p); + } + if (p.abs.$length > 0 && ((_r$1 = (x$1 = p.abs, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])) % 4, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 3)) { + return z.modSqrt3Mod4Prime(x, p); + } + _r$2 = z.modSqrtTonelliShanks(x, p); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return _r$2; + /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.ModSqrt }; } $f.$ptr = $ptr; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.prototype.ModSqrt = function(x, p) { return this.$val.ModSqrt(x, p); }; + Int.ptr.prototype.Lsh = function(x, n) { + var $ptr, n, x, z; + z = this; + z.abs = z.abs.shl(x.abs, n); + z.neg = x.neg; + return z; + }; + Int.prototype.Lsh = function(x, n) { return this.$val.Lsh(x, n); }; + Int.ptr.prototype.Rsh = function(x, n) { + var $ptr, n, t, x, z; + z = this; + if (x.neg) { + t = z.abs.sub(x.abs, natOne); + t = t.shr(t, n); + z.abs = t.add(t, natOne); + z.neg = true; + return z; + } + z.abs = z.abs.shr(x.abs, n); + z.neg = false; + return z; + }; + Int.prototype.Rsh = function(x, n) { return this.$val.Rsh(x, n); }; + Int.ptr.prototype.Bit = function(i) { + var $ptr, i, t, x, x$1; + x = this; + if (i === 0) { + if (x.abs.$length > 0) { + return ((((x$1 = x.abs, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])) & 1) >>> 0) >>> 0); + } + return 0; + } + if (i < 0) { + $panic(new $String("negative bit index")); + } + if (x.neg) { + t = nat.nil.sub(x.abs, natOne); + return (t.bit((i >>> 0)) ^ 1) >>> 0; + } + return x.abs.bit((i >>> 0)); + }; + Int.prototype.Bit = function(i) { return this.$val.Bit(i); }; + Int.ptr.prototype.SetBit = function(x, i, b) { + var $ptr, b, i, t, x, z; + z = this; + if (i < 0) { + $panic(new $String("negative bit index")); + } + if (x.neg) { + t = z.abs.sub(x.abs, natOne); + t = t.setBit(t, (i >>> 0), (b ^ 1) >>> 0); + z.abs = t.add(t, natOne); + z.neg = z.abs.$length > 0; + return z; + } + z.abs = z.abs.setBit(x.abs, (i >>> 0), b); + z.neg = false; + return z; + }; + Int.prototype.SetBit = function(x, i, b) { return this.$val.SetBit(x, i, b); }; + Int.ptr.prototype.And = function(x, y) { + var $ptr, _tmp, _tmp$1, x, x1, y, y1, y1$1, z; + z = this; + if (x.neg === y.neg) { + if (x.neg) { + x1 = nat.nil.sub(x.abs, natOne); + y1 = nat.nil.sub(y.abs, natOne); + z.abs = z.abs.add(z.abs.or(x1, y1), natOne); + z.neg = true; + return z; + } + z.abs = z.abs.and(x.abs, y.abs); + z.neg = false; + return z; + } + if (x.neg) { + _tmp = y; + _tmp$1 = x; + x = _tmp; + y = _tmp$1; + } + y1$1 = nat.nil.sub(y.abs, natOne); + z.abs = z.abs.andNot(x.abs, y1$1); + z.neg = false; + return z; + }; + Int.prototype.And = function(x, y) { return this.$val.And(x, y); }; + Int.ptr.prototype.AndNot = function(x, y) { + var $ptr, x, x1, x1$1, y, y1, y1$1, z; + z = this; + if (x.neg === y.neg) { + if (x.neg) { + x1 = nat.nil.sub(x.abs, natOne); + y1 = nat.nil.sub(y.abs, natOne); + z.abs = z.abs.andNot(y1, x1); + z.neg = false; + return z; + } + z.abs = z.abs.andNot(x.abs, y.abs); + z.neg = false; + return z; + } + if (x.neg) { + x1$1 = nat.nil.sub(x.abs, natOne); + z.abs = z.abs.add(z.abs.or(x1$1, y.abs), natOne); + z.neg = true; + return z; + } + y1$1 = nat.nil.sub(y.abs, natOne); + z.abs = z.abs.and(x.abs, y1$1); + z.neg = false; + return z; + }; + Int.prototype.AndNot = function(x, y) { return this.$val.AndNot(x, y); }; + Int.ptr.prototype.Or = function(x, y) { + var $ptr, _tmp, _tmp$1, x, x1, y, y1, y1$1, z; + z = this; + if (x.neg === y.neg) { + if (x.neg) { + x1 = nat.nil.sub(x.abs, natOne); + y1 = nat.nil.sub(y.abs, natOne); + z.abs = z.abs.add(z.abs.and(x1, y1), natOne); + z.neg = true; + return z; + } + z.abs = z.abs.or(x.abs, y.abs); + z.neg = false; + return z; + } + if (x.neg) { + _tmp = y; + _tmp$1 = x; + x = _tmp; + y = _tmp$1; + } + y1$1 = nat.nil.sub(y.abs, natOne); + z.abs = z.abs.add(z.abs.andNot(y1$1, x.abs), natOne); + z.neg = true; + return z; + }; + Int.prototype.Or = function(x, y) { return this.$val.Or(x, y); }; + Int.ptr.prototype.Xor = function(x, y) { + var $ptr, _tmp, _tmp$1, x, x1, y, y1, y1$1, z; + z = this; + if (x.neg === y.neg) { + if (x.neg) { + x1 = nat.nil.sub(x.abs, natOne); + y1 = nat.nil.sub(y.abs, natOne); + z.abs = z.abs.xor(x1, y1); + z.neg = false; + return z; + } + z.abs = z.abs.xor(x.abs, y.abs); + z.neg = false; + return z; + } + if (x.neg) { + _tmp = y; + _tmp$1 = x; + x = _tmp; + y = _tmp$1; + } + y1$1 = nat.nil.sub(y.abs, natOne); + z.abs = z.abs.add(z.abs.xor(x.abs, y1$1), natOne); + z.neg = true; + return z; + }; + Int.prototype.Xor = function(x, y) { return this.$val.Xor(x, y); }; + Int.ptr.prototype.Not = function(x) { + var $ptr, x, z; + z = this; + if (x.neg) { + z.abs = z.abs.sub(x.abs, natOne); + z.neg = false; + return z; + } + z.abs = z.abs.add(x.abs, natOne); + z.neg = true; + return z; + }; + Int.prototype.Not = function(x) { return this.$val.Not(x); }; + Int.ptr.prototype.Text = function(base) { + var $ptr, base, x; + x = this; + if (x === ptrType$1.nil) { + return ""; + } + return $bytesToString(x.abs.itoa(x.neg, base)); + }; + Int.prototype.Text = function(base) { return this.$val.Text(base); }; + Int.ptr.prototype.Append = function(buf, base) { + var $ptr, base, buf, x; + x = this; + if (x === ptrType$1.nil) { + return $appendSlice(buf, ""); + } + return $appendSlice(buf, x.abs.itoa(x.neg, base)); + }; + Int.prototype.Append = function(buf, base) { return this.$val.Append(buf, base); }; + Int.ptr.prototype.String = function() { + var $ptr, x; + x = this; + return x.Text(10); + }; + Int.prototype.String = function() { return this.$val.String(); }; + writeMultiple = function(s, text, count) { + var $ptr, _r, b, count, s, text, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; b = $f.b; count = $f.count; s = $f.s; text = $f.text; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ if (text.length > 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (text.length > 0) { */ case 1: + b = new sliceType($stringToBytes(text)); + /* while (true) { */ case 3: + /* if (!(count > 0)) { break; } */ if(!(count > 0)) { $s = 4; continue; } + _r = s.Write(b); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r; + count = count - (1) >> 0; + /* } */ $s = 3; continue; case 4: + /* } */ case 2: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: writeMultiple }; } $f.$ptr = $ptr; $f._r = _r; $f.b = b; $f.count = count; $f.s = s; $f.text = text; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.ptr.prototype.Format = function(s, ch) { + var $ptr, _1, _2, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tuple, _tuple$1, base, ch, d, d$1, digits, i, left, length, precision, precisionSet, prefix, right, s, sign, width, widthSet, x, zeros, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _1 = $f._1; _2 = $f._2; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; base = $f.base; ch = $f.ch; d = $f.d; d$1 = $f.d$1; digits = $f.digits; i = $f.i; left = $f.left; length = $f.length; precision = $f.precision; precisionSet = $f.precisionSet; prefix = $f.prefix; right = $f.right; s = $f.s; sign = $f.sign; width = $f.width; widthSet = $f.widthSet; x = $f.x; zeros = $f.zeros; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + x = this; + base = 0; + _1 = ch; + /* */ if (_1 === (98)) { $s = 2; continue; } + /* */ if (_1 === (111)) { $s = 3; continue; } + /* */ if ((_1 === (100)) || (_1 === (115)) || (_1 === (118))) { $s = 4; continue; } + /* */ if ((_1 === (120)) || (_1 === (88))) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (_1 === (98)) { */ case 2: + base = 2; + $s = 7; continue; + /* } else if (_1 === (111)) { */ case 3: + base = 8; + $s = 7; continue; + /* } else if ((_1 === (100)) || (_1 === (115)) || (_1 === (118))) { */ case 4: + base = 10; + $s = 7; continue; + /* } else if ((_1 === (120)) || (_1 === (88))) { */ case 5: + base = 16; + $s = 7; continue; + /* } else { */ case 6: + _r = fmt.Fprintf(s, "%%!%c(big.Int=%s)", new sliceType$1([new $Int32(ch), new $String(x.String())])); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r; + return; + /* } */ case 7: + case 1: + /* */ if (x === ptrType$1.nil) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (x === ptrType$1.nil) { */ case 9: + _r$1 = fmt.Fprint(s, new sliceType$1([new $String("")])); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1; + return; + /* } */ case 10: + sign = ""; + /* */ if (x.neg) { $s = 13; continue; } + _r$2 = s.Flag(43); /* */ $s = 17; case 17: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ if (_r$2) { $s = 14; continue; } + _r$3 = s.Flag(32); /* */ $s = 18; case 18: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (_r$3) { $s = 15; continue; } + /* */ $s = 16; continue; + /* if (x.neg) { */ case 13: + sign = "-"; + $s = 16; continue; + /* } else if (_r$2) { */ case 14: + sign = "+"; + $s = 16; continue; + /* } else if (_r$3) { */ case 15: + sign = " "; + /* } */ case 16: + case 12: + prefix = ""; + _r$4 = s.Flag(35); /* */ $s = 21; case 21: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + /* */ if (_r$4) { $s = 19; continue; } + /* */ $s = 20; continue; + /* if (_r$4) { */ case 19: + _2 = ch; + if (_2 === (111)) { + prefix = "0"; + } else if (_2 === (120)) { + prefix = "0x"; + } else if (_2 === (88)) { + prefix = "0X"; + } + /* } */ case 20: + digits = x.abs.utoa(base); + if (ch === 88) { + _ref = digits; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + d = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (97 <= d && d <= 122) { + ((i < 0 || i >= digits.$length) ? $throwRuntimeError("index out of range") : digits.$array[digits.$offset + i] = (65 + ((d - 97 << 24 >>> 24)) << 24 >>> 24)); + } + _i++; + } + } + left = 0; + zeros = 0; + right = 0; + _r$5 = s.Precision(); /* */ $s = 22; case 22: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _tuple = _r$5; + precision = _tuple[0]; + precisionSet = _tuple[1]; + if (precisionSet) { + if (digits.$length < precision) { + zeros = precision - digits.$length >> 0; + } else if ((digits.$length === 1) && ((0 >= digits.$length ? $throwRuntimeError("index out of range") : digits.$array[digits.$offset + 0]) === 48) && (precision === 0)) { + return; + } + } + length = ((sign.length + prefix.length >> 0) + zeros >> 0) + digits.$length >> 0; + _r$6 = s.Width(); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _tuple$1 = _r$6; + width = _tuple$1[0]; + widthSet = _tuple$1[1]; + /* */ if (widthSet && length < width) { $s = 24; continue; } + /* */ $s = 25; continue; + /* if (widthSet && length < width) { */ case 24: + d$1 = width - length >> 0; + _r$7 = s.Flag(45); /* */ $s = 31; case 31: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + /* */ if (_r$7) { $s = 27; continue; } + _r$8 = s.Flag(48); /* */ $s = 32; case 32: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + /* */ if (_r$8 && !precisionSet) { $s = 28; continue; } + /* */ $s = 29; continue; + /* if (_r$7) { */ case 27: + right = d$1; + $s = 30; continue; + /* } else if (_r$8 && !precisionSet) { */ case 28: + zeros = d$1; + $s = 30; continue; + /* } else { */ case 29: + left = d$1; + /* } */ case 30: + case 26: + /* } */ case 25: + $r = writeMultiple(s, " ", left); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = writeMultiple(s, sign, 1); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = writeMultiple(s, prefix, 1); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = writeMultiple(s, "0", zeros); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r$9 = s.Write(digits); /* */ $s = 37; case 37: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + _r$9; + $r = writeMultiple(s, " ", right); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Format }; } $f.$ptr = $ptr; $f._1 = _1; $f._2 = _2; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.base = base; $f.ch = ch; $f.d = d; $f.d$1 = d$1; $f.digits = digits; $f.i = i; $f.left = left; $f.length = length; $f.precision = precision; $f.precisionSet = precisionSet; $f.prefix = prefix; $f.right = right; $f.s = s; $f.sign = sign; $f.width = width; $f.widthSet = widthSet; $f.x = x; $f.zeros = zeros; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.prototype.Format = function(s, ch) { return this.$val.Format(s, ch); }; + Int.ptr.prototype.scan = function(r, base) { + var $ptr, _r, _r$1, _tuple, _tuple$1, base, err, neg, r, z, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; base = $f.base; err = $f.err; neg = $f.neg; r = $f.r; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + z = this; + _r = scanSign(r); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + neg = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [ptrType$1.nil, 0, err]; + } + _r$1 = z.abs.scan(r, base, false); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + z.abs = _tuple$1[0]; + base = _tuple$1[1]; + err = _tuple$1[3]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [ptrType$1.nil, base, err]; + } + z.neg = z.abs.$length > 0 && neg; + return [z, base, $ifaceNil]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.scan }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.base = base; $f.err = err; $f.neg = neg; $f.r = r; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.prototype.scan = function(r, base) { return this.$val.scan(r, base); }; + scanSign = function(r) { + var $ptr, _3, _r, _r$1, _tmp, _tmp$1, _tuple, ch, err, neg, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _3 = $f._3; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; ch = $f.ch; err = $f.err; neg = $f.neg; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + neg = false; + err = $ifaceNil; + ch = 0; + _r = r.ReadByte(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + ch = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + _tmp = false; + _tmp$1 = err; + neg = _tmp; + err = _tmp$1; + return [neg, err]; + } + _3 = ch; + /* */ if (_3 === (45)) { $s = 3; continue; } + /* */ if (_3 === (43)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_3 === (45)) { */ case 3: + neg = true; + $s = 6; continue; + /* } else if (_3 === (43)) { */ case 4: + $s = 6; continue; + /* } else { */ case 5: + _r$1 = r.UnreadByte(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1; + /* } */ case 6: + case 2: + return [neg, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: scanSign }; } $f.$ptr = $ptr; $f._3 = _3; $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.ch = ch; $f.err = err; $f.neg = neg; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + byteReader.ptr.prototype.ReadByte = function() { + var $ptr, _r, _r$1, _tuple, ch, err, r, size, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; ch = $f.ch; err = $f.err; r = $f.r; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = $clone(this, byteReader); + _r = r.ScanState.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + ch = _tuple[0]; + size = _tuple[1]; + err = _tuple[2]; + /* */ if (!((size === 1)) && $interfaceIsEqual(err, $ifaceNil)) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!((size === 1)) && $interfaceIsEqual(err, $ifaceNil)) { */ case 2: + _r$1 = fmt.Errorf("invalid rune %#U", new sliceType$1([new $Int32(ch)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + err = _r$1; + /* } */ case 3: + return [(ch << 24 >>> 24), err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: byteReader.ptr.prototype.ReadByte }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.ch = ch; $f.err = err; $f.r = r; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; + }; + byteReader.prototype.ReadByte = function() { return this.$val.ReadByte(); }; + byteReader.ptr.prototype.UnreadByte = function() { + var $ptr, _r, r, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + r = $clone(this, byteReader); + _r = r.ScanState.UnreadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: byteReader.ptr.prototype.UnreadByte }; } $f.$ptr = $ptr; $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; + }; + byteReader.prototype.UnreadByte = function() { return this.$val.UnreadByte(); }; + Int.ptr.prototype.Scan = function(s, ch) { + var $ptr, _4, _r, _tuple, base, ch, err, s, x, z, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _4 = $f._4; _r = $f._r; _tuple = $f._tuple; base = $f.base; ch = $f.ch; err = $f.err; s = $f.s; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + z = this; + $r = s.SkipSpace(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + base = 0; + _4 = ch; + if (_4 === (98)) { + base = 2; + } else if (_4 === (111)) { + base = 8; + } else if (_4 === (100)) { + base = 10; + } else if ((_4 === (120)) || (_4 === (88))) { + base = 16; + } else if ((_4 === (115)) || (_4 === (118))) { + } else { + return errors.New("Int.Scan: invalid verb"); + } + _r = z.scan((x = new byteReader.ptr(s), new x.constructor.elem(x)), base); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + err = _tuple[2]; + return err; + /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Scan }; } $f.$ptr = $ptr; $f._4 = _4; $f._r = _r; $f._tuple = _tuple; $f.base = base; $f.ch = ch; $f.err = err; $f.s = s; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.prototype.Scan = function(s, ch) { return this.$val.Scan(s, ch); }; + Int.ptr.prototype.GobEncode = function() { + var $ptr, b, buf, i, x; + x = this; + if (x === ptrType$1.nil) { + return [sliceType.nil, $ifaceNil]; + } + buf = $makeSlice(sliceType, (1 + ($imul(x.abs.$length, 4)) >> 0)); + i = x.abs.bytes(buf) - 1 >> 0; + b = 2; + if (x.neg) { + b = (b | (1)) >>> 0; + } + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = b); + return [$subslice(buf, i), $ifaceNil]; + }; + Int.prototype.GobEncode = function() { return this.$val.GobEncode(); }; + Int.ptr.prototype.GobDecode = function(buf) { + var $ptr, _r, b, buf, z, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; b = $f.b; buf = $f.buf; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + z = this; + if (buf.$length === 0) { + Int.copy(z, new Int.ptr(false, nat.nil)); + return $ifaceNil; + } + b = (0 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 0]); + /* */ if (!(((b >>> 1 << 24 >>> 24) === 1))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!(((b >>> 1 << 24 >>> 24) === 1))) { */ case 1: + _r = fmt.Errorf("Int.GobDecode: encoding version %d not supported", new sliceType$1([new $Uint8((b >>> 1 << 24 >>> 24))])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return _r; + /* } */ case 2: + z.neg = !((((b & 1) >>> 0) === 0)); + z.abs = z.abs.setBytes($subslice(buf, 1)); + return $ifaceNil; + /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.GobDecode }; } $f.$ptr = $ptr; $f._r = _r; $f.b = b; $f.buf = buf; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.prototype.GobDecode = function(buf) { return this.$val.GobDecode(buf); }; + Int.ptr.prototype.MarshalText = function() { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, err, text, x; + text = sliceType.nil; + err = $ifaceNil; + x = this; + if (x === ptrType$1.nil) { + _tmp = new sliceType($stringToBytes("")); + _tmp$1 = $ifaceNil; + text = _tmp; + err = _tmp$1; + return [text, err]; + } + _tmp$2 = x.abs.itoa(x.neg, 10); + _tmp$3 = $ifaceNil; + text = _tmp$2; + err = _tmp$3; + return [text, err]; + }; + Int.prototype.MarshalText = function() { return this.$val.MarshalText(); }; + Int.ptr.prototype.UnmarshalText = function(text) { + var $ptr, _r, _r$1, _tuple, ok, text, z, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; ok = $f.ok; text = $f.text; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + z = this; + _r = z.SetString($bytesToString(text), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + ok = _tuple[1]; + /* */ if (!ok) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!ok) { */ case 2: + _r$1 = fmt.Errorf("math/big: cannot unmarshal %q into a *big.Int", new sliceType$1([text])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 5; case 5: + return _r$1; + /* } */ case 3: + return $ifaceNil; + /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.UnmarshalText }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.ok = ok; $f.text = text; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.prototype.UnmarshalText = function(text) { return this.$val.UnmarshalText(text); }; + Int.ptr.prototype.MarshalJSON = function() { + var $ptr, x; + x = this; + return x.MarshalText(); + }; + Int.prototype.MarshalJSON = function() { return this.$val.MarshalJSON(); }; + Int.ptr.prototype.UnmarshalJSON = function(text) { + var $ptr, _r, text, z, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; text = $f.text; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + z = this; + _r = z.UnmarshalText(text); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.UnmarshalJSON }; } $f.$ptr = $ptr; $f._r = _r; $f.text = text; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; + }; + Int.prototype.UnmarshalJSON = function(text) { return this.$val.UnmarshalJSON(text); }; + nat.prototype.clear = function() { + var $ptr, _i, _ref, i, z; + z = this; + _ref = z; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = 0); + _i++; + } + }; + $ptrType(nat).prototype.clear = function() { return this.$get().clear(); }; + nat.prototype.norm = function() { + var $ptr, i, x, z; + z = this; + i = z.$length; + while (true) { + if (!(i > 0 && ((x = i - 1 >> 0, ((x < 0 || x >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + x])) === 0))) { break; } + i = i - (1) >> 0; + } + return $subslice(z, 0, i); + }; + $ptrType(nat).prototype.norm = function() { return this.$get().norm(); }; + nat.prototype.make = function(n) { + var $ptr, n, z; + z = this; + if (n <= z.$capacity) { + return $subslice(z, 0, n); + } + return $makeSlice(nat, n, (n + 4 >> 0)); + }; + $ptrType(nat).prototype.make = function(n) { return this.$get().make(n); }; + nat.prototype.setWord = function(x) { + var $ptr, x, z; + z = this; + if (x === 0) { + return $subslice(z, 0, 0); + } + z = z.make(1); + (0 >= z.$length ? $throwRuntimeError("index out of range") : z.$array[z.$offset + 0] = x); + return z; + }; + $ptrType(nat).prototype.setWord = function(x) { return this.$get().setWord(x); }; + nat.prototype.setUint64 = function(x) { + var $ptr, _i, _ref, i, n, t, w, x, x$1, z; + z = this; + w = (x.$low >>> 0); + if ((x$1 = new $Uint64(0, w.constructor === Number ? w : 1), (x$1.$high === x.$high && x$1.$low === x.$low))) { + return z.setWord(w); + } + n = 0; + t = x; + while (true) { + if (!((t.$high > 0 || (t.$high === 0 && t.$low > 0)))) { break; } + n = n + (1) >> 0; + t = $shiftRightUint64(t, (32)); + } + z = z.make(n); + _ref = z; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = (new $Uint64(x.$high & 0, (x.$low & 4294967295) >>> 0).$low >>> 0)); + x = $shiftRightUint64(x, (32)); + _i++; + } + return z; + }; + $ptrType(nat).prototype.setUint64 = function(x) { return this.$get().setUint64(x); }; + nat.prototype.set = function(x) { + var $ptr, x, z; + z = this; + z = z.make(x.$length); + $copySlice(z, x); + return z; + }; + $ptrType(nat).prototype.set = function(x) { return this.$get().set(x); }; + nat.prototype.add = function(x, y) { + var $ptr, c, m, n, x, x$1, x$2, x$3, y, z; + z = this; + m = x.$length; + n = y.$length; + if (m < n) { + return z.add(y, x); + } else if ((m === 0)) { + return $subslice(z, 0, 0); + } else if ((n === 0)) { + return z.set(x); + } + z = z.make(m + 1 >> 0); + c = addVV((x$1 = $subslice(z, 0, n), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), $subslice(new sliceType$2(y.$array), y.$offset, y.$offset + y.$length)); + if (m > n) { + c = addVW((x$2 = $subslice(z, n, m), $subslice(new sliceType$2(x$2.$array), x$2.$offset, x$2.$offset + x$2.$length)), (x$3 = $subslice(x, n), $subslice(new sliceType$2(x$3.$array), x$3.$offset, x$3.$offset + x$3.$length)), c); + } + ((m < 0 || m >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + m] = c); + return z.norm(); + }; + $ptrType(nat).prototype.add = function(x, y) { return this.$get().add(x, y); }; + nat.prototype.sub = function(x, y) { + var $ptr, c, m, n, x, x$1, x$2, x$3, y, z; + z = this; + m = x.$length; + n = y.$length; + if (m < n) { + $panic(new $String("underflow")); + } else if ((m === 0)) { + return $subslice(z, 0, 0); + } else if ((n === 0)) { + return z.set(x); + } + z = z.make(m); + c = subVV((x$1 = $subslice(z, 0, n), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), $subslice(new sliceType$2(y.$array), y.$offset, y.$offset + y.$length)); + if (m > n) { + c = subVW((x$2 = $subslice(z, n), $subslice(new sliceType$2(x$2.$array), x$2.$offset, x$2.$offset + x$2.$length)), (x$3 = $subslice(x, n), $subslice(new sliceType$2(x$3.$array), x$3.$offset, x$3.$offset + x$3.$length)), c); + } + if (!((c === 0))) { + $panic(new $String("underflow")); + } + return z.norm(); + }; + $ptrType(nat).prototype.sub = function(x, y) { return this.$get().sub(x, y); }; + nat.prototype.cmp = function(y) { + var $ptr, i, m, n, r, x, y; + r = 0; + x = this; + m = x.$length; + n = y.$length; + if (!((m === n)) || (m === 0)) { + if (m < n) { + r = -1; + } else if (m > n) { + r = 1; + } + return r; + } + i = m - 1 >> 0; + while (true) { + if (!(i > 0 && (((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) === ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])))) { break; } + i = i - (1) >> 0; + } + if (((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) < ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) { + r = -1; + } else if (((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) > ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) { + r = 1; + } + return r; + }; + $ptrType(nat).prototype.cmp = function(y) { return this.$get().cmp(y); }; + nat.prototype.mulAddWW = function(x, y, r) { + var $ptr, m, r, x, x$1, y, z; + z = this; + m = x.$length; + if ((m === 0) || (y === 0)) { + return z.setWord(r); + } + z = z.make(m + 1 >> 0); + ((m < 0 || m >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + m] = mulAddVWW((x$1 = $subslice(z, 0, m), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), y, r)); + return z.norm(); + }; + $ptrType(nat).prototype.mulAddWW = function(x, y, r) { return this.$get().mulAddWW(x, y, r); }; + basicMul = function(z, x, y) { + var $ptr, _i, _ref, d, i, x, x$1, x$2, y, z; + $subslice(z, 0, (x.$length + y.$length >> 0)).clear(); + _ref = y; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + d = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (!((d === 0))) { + (x$2 = x.$length + i >> 0, ((x$2 < 0 || x$2 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + x$2] = addMulVVW((x$1 = $subslice(z, i, (i + x.$length >> 0)), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), d))); + } + _i++; + } + }; + nat.prototype.montgomery = function(x, y, m, k, n) { + var $ptr, c, c2, c3, cx, cy, d, i, k, m, n, t, x, x$1, y, z; + z = this; + if (!((x.$length === n)) || !((y.$length === n)) || !((m.$length === n))) { + $panic(new $String("math/big: mismatched montgomery number lengths")); + } + z = z.make(n); + z.clear(); + c = 0; + i = 0; + while (true) { + if (!(i < n)) { break; } + d = ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i]); + c2 = addMulVVW($subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), d); + t = $imul((0 >= z.$length ? $throwRuntimeError("index out of range") : z.$array[z.$offset + 0]), k) >>> 0; + c3 = addMulVVW($subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(m.$array), m.$offset, m.$offset + m.$length), t); + $copySlice(z, $subslice(z, 1)); + cx = c + c2 >>> 0; + cy = cx + c3 >>> 0; + (x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + x$1] = cy)); + if (cx < c2 || cy < c3) { + c = 1; + } else { + c = 0; + } + i = i + (1) >> 0; + } + if (!((c === 0))) { + subVV($subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(m.$array), m.$offset, m.$offset + m.$length)); + } + return z; + }; + $ptrType(nat).prototype.montgomery = function(x, y, m, k, n) { return this.$get().montgomery(x, y, m, k, n); }; + karatsubaAdd = function(z, x, n) { + var $ptr, c, n, x, x$1, x$2, x$3, z; + c = addVV((x$1 = $subslice(z, 0, n), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length)); + if (!((c === 0))) { + addVW((x$2 = $subslice(z, n, (n + (n >> 1 >> 0) >> 0)), $subslice(new sliceType$2(x$2.$array), x$2.$offset, x$2.$offset + x$2.$length)), (x$3 = $subslice(z, n), $subslice(new sliceType$2(x$3.$array), x$3.$offset, x$3.$offset + x$3.$length)), c); + } + }; + karatsubaSub = function(z, x, n) { + var $ptr, c, n, x, x$1, x$2, x$3, z; + c = subVV((x$1 = $subslice(z, 0, n), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length)); + if (!((c === 0))) { + subVW((x$2 = $subslice(z, n, (n + (n >> 1 >> 0) >> 0)), $subslice(new sliceType$2(x$2.$array), x$2.$offset, x$2.$offset + x$2.$length)), (x$3 = $subslice(z, n), $subslice(new sliceType$2(x$3.$array), x$3.$offset, x$3.$offset + x$3.$length)), c); + } + }; + karatsuba = function(z, x, y) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, n, n2, p, r, s, x, x0, x1, xd, y, y0, y1, yd, z; + n = y.$length; + if (!(((n & 1) === 0)) || n < karatsubaThreshold || n < 2) { + basicMul(z, x, y); + return; + } + n2 = n >> 1 >> 0; + _tmp = $subslice(x, n2); + _tmp$1 = $subslice(x, 0, n2); + x1 = _tmp; + x0 = _tmp$1; + _tmp$2 = $subslice(y, n2); + _tmp$3 = $subslice(y, 0, n2); + y1 = _tmp$2; + y0 = _tmp$3; + karatsuba(z, x0, y0); + karatsuba($subslice(z, n), x1, y1); + s = 1; + xd = $subslice(z, ($imul(2, n)), (($imul(2, n)) + n2 >> 0)); + if (!((subVV($subslice(new sliceType$2(xd.$array), xd.$offset, xd.$offset + xd.$length), $subslice(new sliceType$2(x1.$array), x1.$offset, x1.$offset + x1.$length), $subslice(new sliceType$2(x0.$array), x0.$offset, x0.$offset + x0.$length)) === 0))) { + s = -s; + subVV($subslice(new sliceType$2(xd.$array), xd.$offset, xd.$offset + xd.$length), $subslice(new sliceType$2(x0.$array), x0.$offset, x0.$offset + x0.$length), $subslice(new sliceType$2(x1.$array), x1.$offset, x1.$offset + x1.$length)); + } + yd = $subslice(z, (($imul(2, n)) + n2 >> 0), ($imul(3, n))); + if (!((subVV($subslice(new sliceType$2(yd.$array), yd.$offset, yd.$offset + yd.$length), $subslice(new sliceType$2(y0.$array), y0.$offset, y0.$offset + y0.$length), $subslice(new sliceType$2(y1.$array), y1.$offset, y1.$offset + y1.$length)) === 0))) { + s = -s; + subVV($subslice(new sliceType$2(yd.$array), yd.$offset, yd.$offset + yd.$length), $subslice(new sliceType$2(y1.$array), y1.$offset, y1.$offset + y1.$length), $subslice(new sliceType$2(y0.$array), y0.$offset, y0.$offset + y0.$length)); + } + p = $subslice(z, ($imul(n, 3))); + karatsuba(p, xd, yd); + r = $subslice(z, ($imul(n, 4))); + $copySlice(r, $subslice(z, 0, ($imul(n, 2)))); + karatsubaAdd($subslice(z, n2), r, n); + karatsubaAdd($subslice(z, n2), $subslice(r, n), n); + if (s > 0) { + karatsubaAdd($subslice(z, n2), p, n); + } else { + karatsubaSub($subslice(z, n2), p, n); + } + }; + alias = function(x, y) { + var $ptr, x, x$1, x$2, y; + return x.$capacity > 0 && y.$capacity > 0 && (x$1 = $subslice(x, 0, x.$capacity), $indexPtr(x$1.$array, x$1.$offset + (x.$capacity - 1 >> 0), ptrType$3)) === (x$2 = $subslice(y, 0, y.$capacity), $indexPtr(x$2.$array, x$2.$offset + (y.$capacity - 1 >> 0), ptrType$3)); + }; + addAt = function(z, x, i) { + var $ptr, c, i, j, n, x, x$1, x$2, x$3, x$4, z; + n = x.$length; + if (n > 0) { + c = addVV((x$1 = $subslice(z, i, (i + n >> 0)), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), (x$2 = $subslice(z, i), $subslice(new sliceType$2(x$2.$array), x$2.$offset, x$2.$offset + x$2.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length)); + if (!((c === 0))) { + j = i + n >> 0; + if (j < z.$length) { + addVW((x$3 = $subslice(z, j), $subslice(new sliceType$2(x$3.$array), x$3.$offset, x$3.$offset + x$3.$length)), (x$4 = $subslice(z, j), $subslice(new sliceType$2(x$4.$array), x$4.$offset, x$4.$offset + x$4.$length)), c); + } + } + } + }; + max = function(x, y) { + var $ptr, x, y; + if (x > y) { + return x; + } + return y; + }; + karatsubaLen = function(n) { + var $ptr, i, n, y; + i = 0; + while (true) { + if (!(n > karatsubaThreshold)) { break; } + n = (n >> $min((1), 31)) >> 0; + i = i + (1) >>> 0; + } + return (y = i, y < 32 ? (n << y) : 0) >> 0; + }; + nat.prototype.mul = function(x, y) { + var $ptr, i, k, m, n, t, x, x0, x0$1, xi, y, y0, y0$1, y1, z; + z = this; + m = x.$length; + n = y.$length; + if (m < n) { + return z.mul(y, x); + } else if ((m === 0) || (n === 0)) { + return $subslice(z, 0, 0); + } else if ((n === 1)) { + return z.mulAddWW(x, (0 >= y.$length ? $throwRuntimeError("index out of range") : y.$array[y.$offset + 0]), 0); + } + if (alias(z, x) || alias(z, y)) { + z = nat.nil; + } + if (n < karatsubaThreshold) { + z = z.make(m + n >> 0); + basicMul(z, x, y); + return z.norm(); + } + k = karatsubaLen(n); + x0 = $subslice(x, 0, k); + y0 = $subslice(y, 0, k); + z = z.make(max($imul(6, k), m + n >> 0)); + karatsuba(z, x0, y0); + z = $subslice(z, 0, (m + n >> 0)); + $subslice(z, ($imul(2, k))).clear(); + if (k < n || !((m === n))) { + t = nat.nil; + x0$1 = x0.norm(); + y1 = $subslice(y, k); + t = t.mul(x0$1, y1); + addAt(z, t, k); + y0$1 = y0.norm(); + i = k; + while (true) { + if (!(i < x.$length)) { break; } + xi = $subslice(x, i); + if (xi.$length > k) { + xi = $subslice(xi, 0, k); + } + xi = xi.norm(); + t = t.mul(xi, y0$1); + addAt(z, t, i); + t = t.mul(xi, y1); + addAt(z, t, i + k >> 0); + i = i + (k) >> 0; + } + } + return z.norm(); + }; + $ptrType(nat).prototype.mul = function(x, y) { return this.$get().mul(x, y); }; + nat.prototype.mulRange = function(a, b) { + var $ptr, a, b, m, x, z; + z = this; + if ((a.$high === 0 && a.$low === 0)) { + return z.setUint64(new $Uint64(0, 0)); + } else if ((a.$high > b.$high || (a.$high === b.$high && a.$low > b.$low))) { + return z.setUint64(new $Uint64(0, 1)); + } else if ((a.$high === b.$high && a.$low === b.$low)) { + return z.setUint64(a); + } else if ((x = new $Uint64(a.$high + 0, a.$low + 1), (x.$high === b.$high && x.$low === b.$low))) { + return z.mul(nat.nil.setUint64(a), nat.nil.setUint64(b)); + } + m = $div64((new $Uint64(a.$high + b.$high, a.$low + b.$low)), new $Uint64(0, 2), false); + return z.mul(nat.nil.mulRange(a, m), nat.nil.mulRange(new $Uint64(m.$high + 0, m.$low + 1), b)); + }; + $ptrType(nat).prototype.mulRange = function(a, b) { return this.$get().mulRange(a, b); }; + nat.prototype.divW = function(x, y) { + var $ptr, m, q, r, x, y, z; + q = nat.nil; + r = 0; + z = this; + m = x.$length; + if ((y === 0)) { + $panic(new $String("division by zero")); + } else if ((y === 1)) { + q = z.set(x); + return [q, r]; + } else if ((m === 0)) { + q = $subslice(z, 0, 0); + return [q, r]; + } + z = z.make(m); + r = divWVW($subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), 0, $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), y); + q = z.norm(); + return [q, r]; + }; + $ptrType(nat).prototype.divW = function(x, y) { return this.$get().divW(x, y); }; + nat.prototype.div = function(z2, u, v) { + var $ptr, _tuple, _tuple$1, q, r, r2, u, v, z, z2; + q = nat.nil; + r = nat.nil; + z = this; + if (v.$length === 0) { + $panic(new $String("division by zero")); + } + if (u.cmp(v) < 0) { + q = $subslice(z, 0, 0); + r = z2.set(u); + return [q, r]; + } + if (v.$length === 1) { + r2 = 0; + _tuple = z.divW(u, (0 >= v.$length ? $throwRuntimeError("index out of range") : v.$array[v.$offset + 0])); + q = _tuple[0]; + r2 = _tuple[1]; + r = z2.setWord(r2); + return [q, r]; + } + _tuple$1 = z.divLarge(z2, u, v); + q = _tuple$1[0]; + r = _tuple$1[1]; + return [q, r]; + }; + $ptrType(nat).prototype.div = function(z2, u, v) { return this.$get().div(z2, u, v); }; + nat.prototype.divLarge = function(u, uIn, v) { + var $ptr, _index, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, c, c$1, j, m, n, prevRhat, q, qhat, qhatv, r, rhat, shift, u, uIn, v, v1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, x1, x2, z; + q = nat.nil; + r = nat.nil; + z = this; + n = v.$length; + m = uIn.$length - n >> 0; + if (alias(z, uIn) || alias(z, v)) { + z = nat.nil; + } + q = z.make(m + 1 >> 0); + qhatv = $makeSlice(nat, (n + 1 >> 0)); + if (alias(u, uIn) || alias(u, v)) { + u = nat.nil; + } + u = u.make(uIn.$length + 1 >> 0); + u.clear(); + shift = nlz((x = n - 1 >> 0, ((x < 0 || x >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x]))); + if (shift > 0) { + v1 = $makeSlice(nat, n); + shlVU($subslice(new sliceType$2(v1.$array), v1.$offset, v1.$offset + v1.$length), $subslice(new sliceType$2(v.$array), v.$offset, v.$offset + v.$length), shift); + v = v1; + } + (x$2 = uIn.$length, ((x$2 < 0 || x$2 >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + x$2] = shlVU((x$1 = $subslice(u, 0, uIn.$length), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(uIn.$array), uIn.$offset, uIn.$offset + uIn.$length), shift))); + j = m; + while (true) { + if (!(j >= 0)) { break; } + qhat = 4294967295; + if (!(((x$3 = j + n >> 0, ((x$3 < 0 || x$3 >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + x$3])) === (x$4 = n - 1 >> 0, ((x$4 < 0 || x$4 >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x$4]))))) { + rhat = 0; + _tuple = divWW((x$5 = j + n >> 0, ((x$5 < 0 || x$5 >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + x$5])), (x$6 = (j + n >> 0) - 1 >> 0, ((x$6 < 0 || x$6 >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + x$6])), (x$7 = n - 1 >> 0, ((x$7 < 0 || x$7 >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x$7]))); + qhat = _tuple[0]; + rhat = _tuple[1]; + _tuple$1 = mulWW(qhat, (x$8 = n - 2 >> 0, ((x$8 < 0 || x$8 >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x$8]))); + x1 = _tuple$1[0]; + x2 = _tuple$1[1]; + while (true) { + if (!(greaterThan(x1, x2, rhat, (x$9 = (j + n >> 0) - 2 >> 0, ((x$9 < 0 || x$9 >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + x$9]))))) { break; } + qhat = qhat - (1) >>> 0; + prevRhat = rhat; + rhat = rhat + ((x$10 = n - 1 >> 0, ((x$10 < 0 || x$10 >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x$10]))) >>> 0; + if (rhat < prevRhat) { + break; + } + _tuple$2 = mulWW(qhat, (x$11 = n - 2 >> 0, ((x$11 < 0 || x$11 >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x$11]))); + x1 = _tuple$2[0]; + x2 = _tuple$2[1]; + } + } + ((n < 0 || n >= qhatv.$length) ? $throwRuntimeError("index out of range") : qhatv.$array[qhatv.$offset + n] = mulAddVWW((x$12 = $subslice(qhatv, 0, n), $subslice(new sliceType$2(x$12.$array), x$12.$offset, x$12.$offset + x$12.$length)), $subslice(new sliceType$2(v.$array), v.$offset, v.$offset + v.$length), qhat, 0)); + c = subVV((x$13 = $subslice(u, j, (j + qhatv.$length >> 0)), $subslice(new sliceType$2(x$13.$array), x$13.$offset, x$13.$offset + x$13.$length)), (x$14 = $subslice(u, j), $subslice(new sliceType$2(x$14.$array), x$14.$offset, x$14.$offset + x$14.$length)), $subslice(new sliceType$2(qhatv.$array), qhatv.$offset, qhatv.$offset + qhatv.$length)); + if (!((c === 0))) { + c$1 = addVV((x$15 = $subslice(u, j, (j + n >> 0)), $subslice(new sliceType$2(x$15.$array), x$15.$offset, x$15.$offset + x$15.$length)), (x$16 = $subslice(u, j), $subslice(new sliceType$2(x$16.$array), x$16.$offset, x$16.$offset + x$16.$length)), $subslice(new sliceType$2(v.$array), v.$offset, v.$offset + v.$length)); + _index = j + n >> 0; + ((_index < 0 || _index >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + _index] = (((_index < 0 || _index >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + _index]) + (c$1) >>> 0)); + qhat = qhat - (1) >>> 0; + } + ((j < 0 || j >= q.$length) ? $throwRuntimeError("index out of range") : q.$array[q.$offset + j] = qhat); + j = j - (1) >> 0; + } + q = q.norm(); + shrVU($subslice(new sliceType$2(u.$array), u.$offset, u.$offset + u.$length), $subslice(new sliceType$2(u.$array), u.$offset, u.$offset + u.$length), shift); + r = u.norm(); + _tmp = q; + _tmp$1 = r; + q = _tmp; + r = _tmp$1; + return [q, r]; + }; + $ptrType(nat).prototype.divLarge = function(u, uIn, v) { return this.$get().divLarge(u, uIn, v); }; + nat.prototype.bitLen = function() { + var $ptr, i, x; + x = this; + i = x.$length - 1 >> 0; + if (i >= 0) { + return ($imul(i, 32)) + bitLen(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])) >> 0; + } + return 0; + }; + $ptrType(nat).prototype.bitLen = function() { return this.$get().bitLen(); }; + trailingZeroBits = function(x) { + var $ptr, _1, x, x$1, x$2; + _1 = 32; + if (_1 === (32)) { + return ((x$1 = (($imul((((x & (-x >>> 0)) >>> 0)), 125613361) >>> 0)) >>> 27 >>> 0, ((x$1 < 0 || x$1 >= deBruijn32Lookup.$length) ? $throwRuntimeError("index out of range") : deBruijn32Lookup.$array[deBruijn32Lookup.$offset + x$1])) >>> 0); + } else if (_1 === (64)) { + return ((x$2 = 0, ((x$2 < 0 || x$2 >= deBruijn64Lookup.$length) ? $throwRuntimeError("index out of range") : deBruijn64Lookup.$array[deBruijn64Lookup.$offset + x$2])) >>> 0); + } else { + $panic(new $String("unknown word size")); + } + }; + nat.prototype.trailingZeroBits = function() { + var $ptr, i, x; + x = this; + if (x.$length === 0) { + return 0; + } + i = 0; + while (true) { + if (!(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) === 0)) { break; } + i = i + (1) >>> 0; + } + return (i * 32 >>> 0) + trailingZeroBits(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])) >>> 0; + }; + $ptrType(nat).prototype.trailingZeroBits = function() { return this.$get().trailingZeroBits(); }; + nat.prototype.shl = function(x, s) { + var $ptr, _q, _r, m, n, s, x, x$1, z; + z = this; + m = x.$length; + if (m === 0) { + return $subslice(z, 0, 0); + } + n = m + ((_q = s / 32, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) >> 0) >> 0; + z = z.make(n + 1 >> 0); + ((n < 0 || n >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + n] = shlVU((x$1 = $subslice(z, (n - m >> 0), n), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), (_r = s % 32, _r === _r ? _r : $throwRuntimeError("integer divide by zero")))); + $subslice(z, 0, (n - m >> 0)).clear(); + return z.norm(); + }; + $ptrType(nat).prototype.shl = function(x, s) { return this.$get().shl(x, s); }; + nat.prototype.shr = function(x, s) { + var $ptr, _q, _r, m, n, s, x, x$1, z; + z = this; + m = x.$length; + n = m - ((_q = s / 32, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) >> 0) >> 0; + if (n <= 0) { + return $subslice(z, 0, 0); + } + z = z.make(n); + shrVU($subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), (x$1 = $subslice(x, (m - n >> 0)), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), (_r = s % 32, _r === _r ? _r : $throwRuntimeError("integer divide by zero"))); + return z.norm(); + }; + $ptrType(nat).prototype.shr = function(x, s) { return this.$get().shr(x, s); }; + nat.prototype.setBit = function(x, i, b) { + var $ptr, _2, _q, _r, b, i, j, m, n, x, y, z; + z = this; + j = ((_q = i / 32, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) >> 0); + m = (y = ((_r = i % 32, _r === _r ? _r : $throwRuntimeError("integer divide by zero"))), y < 32 ? (1 << y) : 0) >>> 0; + n = x.$length; + _2 = b; + if (_2 === (0)) { + z = z.make(n); + $copySlice(z, x); + if (j >= n) { + return z; + } + ((j < 0 || j >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + j] = ((((j < 0 || j >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + j]) & ~(m)) >>> 0)); + return z.norm(); + } else if (_2 === (1)) { + if (j >= n) { + z = z.make(j + 1 >> 0); + $subslice(z, n).clear(); + } else { + z = z.make(n); + } + $copySlice(z, x); + ((j < 0 || j >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + j] = ((((j < 0 || j >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + j]) | (m)) >>> 0)); + return z; + } + $panic(new $String("set bit is not 0 or 1")); + }; + $ptrType(nat).prototype.setBit = function(x, i, b) { return this.$get().setBit(x, i, b); }; + nat.prototype.bit = function(i) { + var $ptr, _q, _r, i, j, x, y; + x = this; + j = (_q = i / 32, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + if (j >= (x.$length >>> 0)) { + return 0; + } + return (((((y = ((_r = i % 32, _r === _r ? _r : $throwRuntimeError("integer divide by zero"))), y < 32 ? (((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]) >>> y) : 0) >>> 0) & 1) >>> 0) >>> 0); + }; + $ptrType(nat).prototype.bit = function(i) { return this.$get().bit(i); }; + nat.prototype.and = function(x, y) { + var $ptr, i, m, n, x, y, z; + z = this; + m = x.$length; + n = y.$length; + if (m > n) { + m = n; + } + z = z.make(m); + i = 0; + while (true) { + if (!(i < m)) { break; } + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) & ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) >>> 0)); + i = i + (1) >> 0; + } + return z.norm(); + }; + $ptrType(nat).prototype.and = function(x, y) { return this.$get().and(x, y); }; + nat.prototype.andNot = function(x, y) { + var $ptr, i, m, n, x, y, z; + z = this; + m = x.$length; + n = y.$length; + if (n > m) { + n = m; + } + z = z.make(m); + i = 0; + while (true) { + if (!(i < n)) { break; } + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) & ~((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) >>> 0)); + i = i + (1) >> 0; + } + $copySlice($subslice(z, n, m), $subslice(x, n, m)); + return z.norm(); + }; + $ptrType(nat).prototype.andNot = function(x, y) { return this.$get().andNot(x, y); }; + nat.prototype.or = function(x, y) { + var $ptr, _tmp, _tmp$1, i, m, n, s, x, y, z; + z = this; + m = x.$length; + n = y.$length; + s = x; + if (m < n) { + _tmp = m; + _tmp$1 = n; + n = _tmp; + m = _tmp$1; + s = y; + } + z = z.make(m); + i = 0; + while (true) { + if (!(i < n)) { break; } + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) | ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) >>> 0)); + i = i + (1) >> 0; + } + $copySlice($subslice(z, n, m), $subslice(s, n, m)); + return z.norm(); + }; + $ptrType(nat).prototype.or = function(x, y) { return this.$get().or(x, y); }; + nat.prototype.xor = function(x, y) { + var $ptr, _tmp, _tmp$1, i, m, n, s, x, y, z; + z = this; + m = x.$length; + n = y.$length; + s = x; + if (m < n) { + _tmp = m; + _tmp$1 = n; + n = _tmp; + m = _tmp$1; + s = y; + } + z = z.make(m); + i = 0; + while (true) { + if (!(i < n)) { break; } + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) ^ ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) >>> 0)); + i = i + (1) >> 0; + } + $copySlice($subslice(z, n, m), $subslice(s, n, m)); + return z.norm(); + }; + $ptrType(nat).prototype.xor = function(x, y) { return this.$get().xor(x, y); }; + greaterThan = function(x1, x2, y1, y2) { + var $ptr, x1, x2, y1, y2; + return x1 > y1 || (x1 === y1) && x2 > y2; + }; + nat.prototype.modW = function(d) { + var $ptr, d, q, r, x; + r = 0; + x = this; + q = nat.nil; + q = q.make(x.$length); + r = divWVW($subslice(new sliceType$2(q.$array), q.$offset, q.$offset + q.$length), 0, $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), d); + return r; + }; + $ptrType(nat).prototype.modW = function(d) { return this.$get().modW(d); }; + nat.prototype.random = function(rand$1, limit, n) { + var $ptr, _3, _i, _i$1, _index, _r, _r$1, _r$2, _ref, _ref$1, bitLengthOfMSW, i, i$1, limit, mask, n, rand$1, y, z, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _3 = $f._3; _i = $f._i; _i$1 = $f._i$1; _index = $f._index; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _ref$1 = $f._ref$1; bitLengthOfMSW = $f.bitLengthOfMSW; i = $f.i; i$1 = $f.i$1; limit = $f.limit; mask = $f.mask; n = $f.n; rand$1 = $f.rand$1; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + z = this; + if (alias(z, limit)) { + z = nat.nil; + } + z = z.make(limit.$length); + bitLengthOfMSW = ((_r = n % 32, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) >>> 0); + if (bitLengthOfMSW === 0) { + bitLengthOfMSW = 32; + } + mask = ((((y = bitLengthOfMSW, y < 32 ? (1 << y) : 0) >>> 0)) - 1 >>> 0); + /* while (true) { */ case 1: + _3 = 32; + /* */ if (_3 === (32)) { $s = 4; continue; } + /* */ if (_3 === (64)) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (_3 === (32)) { */ case 4: + _ref = z; + _i = 0; + /* while (true) { */ case 8: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 9; continue; } + i = _i; + _r$1 = rand$1.Uint32(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = (_r$1 >>> 0)); + _i++; + /* } */ $s = 8; continue; case 9: + $s = 7; continue; + /* } else if (_3 === (64)) { */ case 5: + _ref$1 = z; + _i$1 = 0; + /* while (true) { */ case 11: + /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 12; continue; } + i$1 = _i$1; + _r$2 = rand$1.Uint32(); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + ((i$1 < 0 || i$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i$1] = (((_r$2 >>> 0) | 0) >>> 0)); + _i$1++; + /* } */ $s = 11; continue; case 12: + $s = 7; continue; + /* } else { */ case 6: + $panic(new $String("unknown word size")); + /* } */ case 7: + case 3: + _index = limit.$length - 1 >> 0; + ((_index < 0 || _index >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + _index] = ((((_index < 0 || _index >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + _index]) & (mask)) >>> 0)); + if (z.cmp(limit) < 0) { + /* break; */ $s = 2; continue; + } + /* } */ $s = 1; continue; case 2: + return z.norm(); + /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.random }; } $f.$ptr = $ptr; $f._3 = _3; $f._i = _i; $f._i$1 = _i$1; $f._index = _index; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._ref$1 = _ref$1; $f.bitLengthOfMSW = bitLengthOfMSW; $f.i = i; $f.i$1 = i$1; $f.limit = limit; $f.mask = mask; $f.n = n; $f.rand$1 = rand$1; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; + }; + $ptrType(nat).prototype.random = function(rand$1, limit, n) { return this.$get().random(rand$1, limit, n); }; + nat.prototype.expNN = function(x, y, m) { + var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, i, j, j$1, m, q, r, shift, v, w, x, x$1, y, y$1, y$2, y$3, z, zz; + z = this; + if (alias(z, x) || alias(z, y)) { + z = nat.nil; + } + if ((m.$length === 1) && ((0 >= m.$length ? $throwRuntimeError("index out of range") : m.$array[m.$offset + 0]) === 1)) { + return z.setWord(0); + } + if (y.$length === 0) { + return z.setWord(1); + } + if ((y.$length === 1) && ((0 >= y.$length ? $throwRuntimeError("index out of range") : y.$array[y.$offset + 0]) === 1) && !((m.$length === 0))) { + _tuple = z.div(z, x, m); + z = _tuple[1]; + return z; + } + if (!((m.$length === 0))) { + z = z.make(m.$length); + } + z = z.set(x); + if (x.$length > 1 && y.$length > 1 && m.$length > 0) { + if ((((0 >= m.$length ? $throwRuntimeError("index out of range") : m.$array[m.$offset + 0]) & 1) >>> 0) === 1) { + return z.expNNMontgomery(x, y, m); + } + return z.expNNWindowed(x, y, m); + } + v = (x$1 = y.$length - 1 >> 0, ((x$1 < 0 || x$1 >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + x$1])); + shift = nlz(v) + 1 >>> 0; + v = (y$1 = (shift), y$1 < 32 ? (v << y$1) : 0) >>> 0; + q = nat.nil; + w = 32 - (shift >> 0) >> 0; + _tmp = nat.nil; + _tmp$1 = nat.nil; + zz = _tmp; + r = _tmp$1; + j = 0; + while (true) { + if (!(j < w)) { break; } + zz = zz.mul(z, z); + _tmp$2 = z; + _tmp$3 = zz; + zz = _tmp$2; + z = _tmp$3; + if (!((((v & 2147483648) >>> 0) === 0))) { + zz = zz.mul(z, x); + _tmp$4 = z; + _tmp$5 = zz; + zz = _tmp$4; + z = _tmp$5; + } + if (!((m.$length === 0))) { + _tuple$1 = zz.div(r, z, m); + zz = _tuple$1[0]; + r = _tuple$1[1]; + _tmp$6 = q; + _tmp$7 = z; + _tmp$8 = zz; + _tmp$9 = r; + zz = _tmp$6; + r = _tmp$7; + q = _tmp$8; + z = _tmp$9; + } + v = (y$2 = (1), y$2 < 32 ? (v << y$2) : 0) >>> 0; + j = j + (1) >> 0; + } + i = y.$length - 2 >> 0; + while (true) { + if (!(i >= 0)) { break; } + v = ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i]); + j$1 = 0; + while (true) { + if (!(j$1 < 32)) { break; } + zz = zz.mul(z, z); + _tmp$10 = z; + _tmp$11 = zz; + zz = _tmp$10; + z = _tmp$11; + if (!((((v & 2147483648) >>> 0) === 0))) { + zz = zz.mul(z, x); + _tmp$12 = z; + _tmp$13 = zz; + zz = _tmp$12; + z = _tmp$13; + } + if (!((m.$length === 0))) { + _tuple$2 = zz.div(r, z, m); + zz = _tuple$2[0]; + r = _tuple$2[1]; + _tmp$14 = q; + _tmp$15 = z; + _tmp$16 = zz; + _tmp$17 = r; + zz = _tmp$14; + r = _tmp$15; + q = _tmp$16; + z = _tmp$17; + } + v = (y$3 = (1), y$3 < 32 ? (v << y$3) : 0) >>> 0; + j$1 = j$1 + (1) >> 0; + } + i = i - (1) >> 0; + } + return z.norm(); + }; + $ptrType(nat).prototype.expNN = function(x, y, m) { return this.$get().expNN(x, y, m); }; + nat.prototype.expNNWindowed = function(x, y, m) { + var $ptr, _q, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, i, i$1, j, m, p, p1, p2, powers, r, x, x$1, y, y$1, yi, z, zz; + z = this; + _tmp = nat.nil; + _tmp$1 = nat.nil; + zz = _tmp; + r = _tmp$1; + powers = arrayType$1.zero(); + powers[0] = natOne; + powers[1] = x; + i = 2; + while (true) { + if (!(i < 16)) { break; } + _tmp$2 = $indexPtr(powers, (_q = i / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), ptrType$4); + _tmp$3 = $indexPtr(powers, i, ptrType$4); + _tmp$4 = $indexPtr(powers, (i + 1 >> 0), ptrType$4); + p2 = _tmp$2; + p = _tmp$3; + p1 = _tmp$4; + p.$set(p.mul(p2.$get(), p2.$get())); + _tuple = zz.div(r, p.$get(), m); + zz = _tuple[0]; + r = _tuple[1]; + _tmp$5 = r; + _tmp$6 = p.$get(); + p.$set(_tmp$5); + r = _tmp$6; + p1.$set(p1.mul(p.$get(), x)); + _tuple$1 = zz.div(r, p1.$get(), m); + zz = _tuple$1[0]; + r = _tuple$1[1]; + _tmp$7 = r; + _tmp$8 = p1.$get(); + p1.$set(_tmp$7); + r = _tmp$8; + i = i + (2) >> 0; + } + z = z.setWord(1); + i$1 = y.$length - 1 >> 0; + while (true) { + if (!(i$1 >= 0)) { break; } + yi = ((i$1 < 0 || i$1 >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i$1]); + j = 0; + while (true) { + if (!(j < 32)) { break; } + if (!((i$1 === (y.$length - 1 >> 0))) || !((j === 0))) { + zz = zz.mul(z, z); + _tmp$9 = z; + _tmp$10 = zz; + zz = _tmp$9; + z = _tmp$10; + _tuple$2 = zz.div(r, z, m); + zz = _tuple$2[0]; + r = _tuple$2[1]; + _tmp$11 = r; + _tmp$12 = z; + z = _tmp$11; + r = _tmp$12; + zz = zz.mul(z, z); + _tmp$13 = z; + _tmp$14 = zz; + zz = _tmp$13; + z = _tmp$14; + _tuple$3 = zz.div(r, z, m); + zz = _tuple$3[0]; + r = _tuple$3[1]; + _tmp$15 = r; + _tmp$16 = z; + z = _tmp$15; + r = _tmp$16; + zz = zz.mul(z, z); + _tmp$17 = z; + _tmp$18 = zz; + zz = _tmp$17; + z = _tmp$18; + _tuple$4 = zz.div(r, z, m); + zz = _tuple$4[0]; + r = _tuple$4[1]; + _tmp$19 = r; + _tmp$20 = z; + z = _tmp$19; + r = _tmp$20; + zz = zz.mul(z, z); + _tmp$21 = z; + _tmp$22 = zz; + zz = _tmp$21; + z = _tmp$22; + _tuple$5 = zz.div(r, z, m); + zz = _tuple$5[0]; + r = _tuple$5[1]; + _tmp$23 = r; + _tmp$24 = z; + z = _tmp$23; + r = _tmp$24; + } + zz = zz.mul(z, (x$1 = yi >>> 28 >>> 0, ((x$1 < 0 || x$1 >= powers.length) ? $throwRuntimeError("index out of range") : powers[x$1]))); + _tmp$25 = z; + _tmp$26 = zz; + zz = _tmp$25; + z = _tmp$26; + _tuple$6 = zz.div(r, z, m); + zz = _tuple$6[0]; + r = _tuple$6[1]; + _tmp$27 = r; + _tmp$28 = z; + z = _tmp$27; + r = _tmp$28; + yi = (y$1 = (4), y$1 < 32 ? (yi << y$1) : 0) >>> 0; + j = j + (4) >> 0; + } + i$1 = i$1 - (1) >> 0; + } + return z.norm(); + }; + $ptrType(nat).prototype.expNNWindowed = function(x, y, m) { return this.$get().expNNWindowed(x, y, m); }; + nat.prototype.expNNMontgomery = function(x, y, m) { + var $ptr, RR, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, i, i$1, i$2, j, k0, m, numWords, one, powers, rr, t, x, x$1, x$2, y, y$1, y$2, yi, z, zz; + z = this; + numWords = m.$length; + if (x.$length > numWords) { + _tuple = nat.nil.div(nat.nil, x, m); + x = _tuple[1]; + } + if (x.$length < numWords) { + rr = $makeSlice(nat, numWords); + $copySlice(rr, x); + x = rr; + } + k0 = 2 - (0 >= m.$length ? $throwRuntimeError("index out of range") : m.$array[m.$offset + 0]) >>> 0; + t = (0 >= m.$length ? $throwRuntimeError("index out of range") : m.$array[m.$offset + 0]) - 1 >>> 0; + i = 1; + while (true) { + if (!(i < 32)) { break; } + t = $imul(t, (t)) >>> 0; + k0 = $imul(k0, (((t + 1 >>> 0)))) >>> 0; + i = (y$1 = (1), y$1 < 32 ? (i << y$1) : 0) >> 0; + } + k0 = -k0 >>> 0; + RR = nat.nil.setWord(1); + zz = nat.nil.shl(RR, (($imul(($imul(2, numWords)), 32)) >>> 0)); + _tuple$1 = RR.div(RR, zz, m); + RR = _tuple$1[1]; + if (RR.$length < numWords) { + zz = zz.make(numWords); + $copySlice(zz, RR); + RR = zz; + } + one = $makeSlice(nat, numWords); + (0 >= one.$length ? $throwRuntimeError("index out of range") : one.$array[one.$offset + 0] = 1); + powers = arrayType$1.zero(); + powers[0] = powers[0].montgomery(one, RR, m, k0, numWords); + powers[1] = powers[1].montgomery(x, RR, m, k0, numWords); + i$1 = 2; + while (true) { + if (!(i$1 < 16)) { break; } + ((i$1 < 0 || i$1 >= powers.length) ? $throwRuntimeError("index out of range") : powers[i$1] = ((i$1 < 0 || i$1 >= powers.length) ? $throwRuntimeError("index out of range") : powers[i$1]).montgomery((x$1 = i$1 - 1 >> 0, ((x$1 < 0 || x$1 >= powers.length) ? $throwRuntimeError("index out of range") : powers[x$1])), powers[1], m, k0, numWords)); + i$1 = i$1 + (1) >> 0; + } + z = z.make(numWords); + $copySlice(z, powers[0]); + zz = zz.make(numWords); + i$2 = y.$length - 1 >> 0; + while (true) { + if (!(i$2 >= 0)) { break; } + yi = ((i$2 < 0 || i$2 >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i$2]); + j = 0; + while (true) { + if (!(j < 32)) { break; } + if (!((i$2 === (y.$length - 1 >> 0))) || !((j === 0))) { + zz = zz.montgomery(z, z, m, k0, numWords); + z = z.montgomery(zz, zz, m, k0, numWords); + zz = zz.montgomery(z, z, m, k0, numWords); + z = z.montgomery(zz, zz, m, k0, numWords); + } + zz = zz.montgomery(z, (x$2 = yi >>> 28 >>> 0, ((x$2 < 0 || x$2 >= powers.length) ? $throwRuntimeError("index out of range") : powers[x$2])), m, k0, numWords); + _tmp = zz; + _tmp$1 = z; + z = _tmp; + zz = _tmp$1; + yi = (y$2 = (4), y$2 < 32 ? (yi << y$2) : 0) >>> 0; + j = j + (4) >> 0; + } + i$2 = i$2 - (1) >> 0; + } + zz = zz.montgomery(z, one, m, k0, numWords); + if (zz.cmp(m) >= 0) { + zz = zz.sub(zz, m); + if (zz.cmp(m) >= 0) { + _tuple$2 = nat.nil.div(nat.nil, zz, m); + zz = _tuple$2[1]; + } + } + return zz.norm(); + }; + $ptrType(nat).prototype.expNNMontgomery = function(x, y, m) { return this.$get().expNNMontgomery(x, y, m); }; + nat.prototype.probablyPrime = function(reps) { + var $ptr, _4, _5, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _tmp$2, _tuple, i, j, k, n, nm1, nm3, nm3Len, q, quotient, r, rand$1, reps, x, x$1, y, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _4 = $f._4; _5 = $f._5; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; i = $f.i; j = $f.j; k = $f.k; n = $f.n; nm1 = $f.nm1; nm3 = $f.nm3; nm3Len = $f.nm3Len; q = $f.q; quotient = $f.quotient; r = $f.r; rand$1 = $f.rand$1; reps = $f.reps; x = $f.x; x$1 = $f.x$1; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = this; + if (n.$length === 0) { + return false; + } + if (n.$length === 1) { + if ((0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]) < 2) { + return false; + } + if ((_r = (0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]) % 2, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0) { + return (0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]) === 2; + } + _4 = (0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]); + if ((_4 === (3)) || (_4 === (5)) || (_4 === (7)) || (_4 === (11)) || (_4 === (13)) || (_4 === (17)) || (_4 === (19)) || (_4 === (23)) || (_4 === (29)) || (_4 === (31)) || (_4 === (37)) || (_4 === (41)) || (_4 === (43)) || (_4 === (47)) || (_4 === (53))) { + return true; + } + } + if ((((0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]) & 1) >>> 0) === 0) { + return false; + } + r = 0; + _5 = 32; + if (_5 === (32)) { + r = n.modW(3234846615); + } else if (_5 === (64)) { + r = n.modW(820596253); + } else { + $panic(new $String("Unknown word size")); + } + if (((_r$1 = r % 3, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$2 = r % 5, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$3 = r % 7, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$4 = r % 11, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$5 = r % 13, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$6 = r % 17, _r$6 === _r$6 ? _r$6 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$7 = r % 19, _r$7 === _r$7 ? _r$7 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$8 = r % 23, _r$8 === _r$8 ? _r$8 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$9 = r % 29, _r$9 === _r$9 ? _r$9 : $throwRuntimeError("integer divide by zero")) === 0)) { + return false; + } + if (false && (((_r$10 = r % 31, _r$10 === _r$10 ? _r$10 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$11 = r % 37, _r$11 === _r$11 ? _r$11 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$12 = r % 41, _r$12 === _r$12 ? _r$12 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$13 = r % 43, _r$13 === _r$13 ? _r$13 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$14 = r % 47, _r$14 === _r$14 ? _r$14 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$15 = r % 53, _r$15 === _r$15 ? _r$15 : $throwRuntimeError("integer divide by zero")) === 0))) { + return false; + } + nm1 = nat.nil.sub(n, natOne); + k = nm1.trailingZeroBits(); + q = nat.nil.shr(nm1, k); + nm3 = nat.nil.sub(nm1, natTwo); + rand$1 = rand.New(rand.NewSource((x = (0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]), new $Int64(0, x.constructor === Number ? x : 1)))); + _tmp = nat.nil; + _tmp$1 = nat.nil; + _tmp$2 = nat.nil; + x$1 = _tmp; + y = _tmp$1; + quotient = _tmp$2; + nm3Len = nm3.bitLen(); + i = 0; + /* while (true) { */ case 1: + /* if (!(i < reps)) { break; } */ if(!(i < reps)) { $s = 2; continue; } + _r$16 = x$1.random(rand$1, nm3, nm3Len); /* */ $s = 3; case 3: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } + x$1 = _r$16; + x$1 = x$1.add(x$1, natTwo); + y = y.expNN(x$1, q, n); + if ((y.cmp(natOne) === 0) || (y.cmp(nm1) === 0)) { + i = i + (1) >> 0; + /* continue; */ $s = 1; continue; + } + j = 1; + while (true) { + if (!(j < k)) { break; } + y = y.mul(y, y); + _tuple = quotient.div(y, y, n); + quotient = _tuple[0]; + y = _tuple[1]; + if (y.cmp(nm1) === 0) { + i = i + (1) >> 0; + /* continue NextRandom; */ $s = 1; continue s; + } + if (y.cmp(natOne) === 0) { + return false; + } + j = j + (1) >>> 0; + } + return false; + /* } */ $s = 1; continue; case 2: + return true; + /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.probablyPrime }; } $f.$ptr = $ptr; $f._4 = _4; $f._5 = _5; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.i = i; $f.j = j; $f.k = k; $f.n = n; $f.nm1 = nm1; $f.nm3 = nm3; $f.nm3Len = nm3Len; $f.q = q; $f.quotient = quotient; $f.r = r; $f.rand$1 = rand$1; $f.reps = reps; $f.x = x; $f.x$1 = x$1; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; + }; + $ptrType(nat).prototype.probablyPrime = function(reps) { return this.$get().probablyPrime(reps); }; + nat.prototype.bytes = function(buf) { + var $ptr, _i, _ref, buf, d, i, j, y, z; + i = 0; + z = this; + i = buf.$length; + _ref = z; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + d = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + j = 0; + while (true) { + if (!(j < 4)) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = (d << 24 >>> 24)); + d = (y = (8), y < 32 ? (d >>> y) : 0) >>> 0; + j = j + (1) >> 0; + } + _i++; + } + while (true) { + if (!(i < buf.$length && (((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i]) === 0))) { break; } + i = i + (1) >> 0; + } + return i; + }; + $ptrType(nat).prototype.bytes = function(buf) { return this.$get().bytes(buf); }; + nat.prototype.setBytes = function(buf) { + var $ptr, _q, buf, d, i, k, s, x, y, z; + z = this; + z = z.make((_q = (((buf.$length + 4 >> 0) - 1 >> 0)) / 4, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); + k = 0; + s = 0; + d = 0; + i = buf.$length; + while (true) { + if (!(i > 0)) { break; } + d = (d | (((y = s, y < 32 ? (((x = i - 1 >> 0, ((x < 0 || x >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + x])) >>> 0) << y) : 0) >>> 0))) >>> 0; + s = s + (8) >>> 0; + if (s === 32) { + ((k < 0 || k >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + k] = d); + k = k + (1) >> 0; + s = 0; + d = 0; + } + i = i - (1) >> 0; + } + if (k < z.$length) { + ((k < 0 || k >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + k] = d); + } + return z.norm(); + }; + $ptrType(nat).prototype.setBytes = function(buf) { return this.$get().setBytes(buf); }; + maxPow = function(b) { + var $ptr, _q, _tmp, _tmp$1, b, max$1, n, p; + p = 0; + n = 0; + _tmp = b; + _tmp$1 = 1; + p = _tmp; + n = _tmp$1; + max$1 = (_q = 4294967295 / b, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + while (true) { + if (!(p <= max$1)) { break; } + p = $imul(p, (b)) >>> 0; + n = n + (1) >> 0; + } + return [p, n]; + }; + pow = function(x, n) { + var $ptr, n, p, x; + p = 0; + p = 1; + while (true) { + if (!(n > 0)) { break; } + if (!(((n & 1) === 0))) { + p = $imul(p, (x)) >>> 0; + } + x = $imul(x, (x)) >>> 0; + n = (n >> $min((1), 31)) >> 0; + } + return p; + }; + nat.prototype.scan = function(r, base, fracOk) { + var $ptr, _1, _2, _3, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, b, b1, base, baseOk, bn, ch, count, d1, di, dp, err, fracOk, i, n, r, res, z, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _1 = $f._1; _2 = $f._2; _3 = $f._3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; b = $f.b; b1 = $f.b1; base = $f.base; baseOk = $f.baseOk; bn = $f.bn; ch = $f.ch; count = $f.count; d1 = $f.d1; di = $f.di; dp = $f.dp; err = $f.err; fracOk = $f.fracOk; i = $f.i; n = $f.n; r = $f.r; res = $f.res; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + res = nat.nil; + b = 0; + count = 0; + err = $ifaceNil; + z = this; + baseOk = (base === 0) || !fracOk && 2 <= base && base <= 36 || fracOk && ((base === 2) || (base === 10) || (base === 16)); + /* */ if (!baseOk) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!baseOk) { */ case 1: + _r = fmt.Sprintf("illegal number base %d", new sliceType$1([new $Int(base)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + $panic(new $String(_r)); + /* } */ case 2: + _r$1 = r.ReadByte(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple = _r$1; + ch = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [res, b, count, err]; + } + b = base; + /* */ if (base === 0) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (base === 0) { */ case 5: + b = 10; + /* */ if (ch === 48) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (ch === 48) { */ case 7: + count = 1; + _r$2 = r.ReadByte(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$1 = _r$2; + ch = _tuple$1[0]; + err = _tuple$1[1]; + _1 = err; + /* */ if ($interfaceIsEqual(_1, $ifaceNil)) { $s = 11; continue; } + /* */ if ($interfaceIsEqual(_1, (io.EOF))) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if ($interfaceIsEqual(_1, $ifaceNil)) { */ case 11: + if (!fracOk) { + b = 8; + } + _2 = ch; + if ((_2 === (120)) || (_2 === (88))) { + b = 16; + } else if ((_2 === (98)) || (_2 === (66))) { + b = 2; + } + _3 = b; + /* */ if ((_3 === (16)) || (_3 === (2))) { $s = 16; continue; } + /* */ if (_3 === (8)) { $s = 17; continue; } + /* */ $s = 18; continue; + /* if ((_3 === (16)) || (_3 === (2))) { */ case 16: + count = 0; + _r$3 = r.ReadByte(); /* */ $s = 19; case 19: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple$2 = _r$3; + ch = _tuple$2[0]; + err = _tuple$2[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [res, b, count, err]; + } + $s = 18; continue; + /* } else if (_3 === (8)) { */ case 17: + count = 0; + /* } */ case 18: + case 15: + $s = 14; continue; + /* } else if ($interfaceIsEqual(_1, (io.EOF))) { */ case 12: + res = $subslice(z, 0, 0); + err = $ifaceNil; + return [res, b, count, err]; + /* } else { */ case 13: + return [res, b, count, err]; + /* } */ case 14: + case 9: + /* } */ case 8: + /* } */ case 6: + z = $subslice(z, 0, 0); + b1 = (b >>> 0); + _tuple$3 = maxPow(b1); + bn = _tuple$3[0]; + n = _tuple$3[1]; + di = 0; + i = 0; + dp = -1; + /* while (true) { */ case 20: + /* */ if (fracOk && (ch === 46)) { $s = 22; continue; } + /* */ $s = 23; continue; + /* if (fracOk && (ch === 46)) { */ case 22: + fracOk = false; + dp = count; + _r$4 = r.ReadByte(); /* */ $s = 24; case 24: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _tuple$4 = _r$4; + ch = _tuple$4[0]; + err = _tuple$4[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + if ($interfaceIsEqual(err, io.EOF)) { + err = $ifaceNil; + /* break; */ $s = 21; continue; + } + return [res, b, count, err]; + } + /* } */ case 23: + d1 = 0; + if (48 <= ch && ch <= 57) { + d1 = ((ch - 48 << 24 >>> 24) >>> 0); + } else if (97 <= ch && ch <= 122) { + d1 = (((ch - 97 << 24 >>> 24) + 10 << 24 >>> 24) >>> 0); + } else if (65 <= ch && ch <= 90) { + d1 = (((ch - 65 << 24 >>> 24) + 10 << 24 >>> 24) >>> 0); + } else { + d1 = 37; + } + /* */ if (d1 >= b1) { $s = 25; continue; } + /* */ $s = 26; continue; + /* if (d1 >= b1) { */ case 25: + _r$5 = r.UnreadByte(); /* */ $s = 27; case 27: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _r$5; + /* break; */ $s = 21; continue; + /* } */ case 26: + count = count + (1) >> 0; + di = ($imul(di, b1) >>> 0) + d1 >>> 0; + i = i + (1) >> 0; + if (i === n) { + z = z.mulAddWW(z, bn, di); + di = 0; + i = 0; + } + _r$6 = r.ReadByte(); /* */ $s = 28; case 28: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _tuple$5 = _r$6; + ch = _tuple$5[0]; + err = _tuple$5[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + if ($interfaceIsEqual(err, io.EOF)) { + err = $ifaceNil; + /* break; */ $s = 21; continue; + } + return [res, b, count, err]; + } + /* } */ $s = 20; continue; case 21: + if (count === 0) { + if ((base === 0) && (b === 8)) { + count = 1; + b = 10; + } else if (!((base === 0)) || !((b === 8))) { + err = errors.New("syntax error scanning number"); + } + return [res, b, count, err]; + } + if (i > 0) { + z = z.mulAddWW(z, pow(b1, i), di); + } + res = z.norm(); + if (dp >= 0) { + count = dp - count >> 0; + } + return [res, b, count, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.scan }; } $f.$ptr = $ptr; $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f.b = b; $f.b1 = b1; $f.base = base; $f.baseOk = baseOk; $f.bn = bn; $f.ch = ch; $f.count = count; $f.d1 = d1; $f.di = di; $f.dp = dp; $f.err = err; $f.fracOk = fracOk; $f.i = i; $f.n = n; $f.r = r; $f.res = res; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; + }; + $ptrType(nat).prototype.scan = function(r, base, fracOk) { return this.$get().scan(r, base, fracOk); }; + nat.prototype.utoa = function(base) { + var $ptr, base, x; + x = this; + return x.itoa(false, base); + }; + $ptrType(nat).prototype.utoa = function(base) { return this.$get().utoa(base); }; + nat.prototype.itoa = function(neg, base) { + var $ptr, _tuple, b, base, bb, i, k, mask, nbits, ndigits, neg, q, s, shift, table, w, x, y, y$1, y$2, y$3, y$4; + x = this; + if (base < 2 || base > 36) { + $panic(new $String("invalid base")); + } + if (x.$length === 0) { + return new sliceType($stringToBytes("0")); + } + i = (x.bitLen() / math.Log2(base) >> 0) + 1 >> 0; + if (neg) { + i = i + (1) >> 0; + } + s = $makeSlice(sliceType, i); + b = (base >>> 0); + if (b === ((b & (-b >>> 0)) >>> 0)) { + shift = trailingZeroBits(b); + mask = (((y = shift, y < 32 ? (1 << y) : 0) >>> 0) - 1 >>> 0); + w = (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0]); + nbits = 32; + k = 1; + while (true) { + if (!(k < x.$length)) { break; } + while (true) { + if (!(nbits >= shift)) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((w & mask) >>> 0))); + w = (y$1 = (shift), y$1 < 32 ? (w >>> y$1) : 0) >>> 0; + nbits = nbits - (shift) >>> 0; + } + if (nbits === 0) { + w = ((k < 0 || k >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + k]); + nbits = 32; + } else { + w = (w | (((y$2 = nbits, y$2 < 32 ? (((k < 0 || k >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + k]) << y$2) : 0) >>> 0))) >>> 0; + i = i - (1) >> 0; + ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((w & mask) >>> 0))); + w = (y$3 = ((shift - nbits >>> 0)), y$3 < 32 ? (((k < 0 || k >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + k]) >>> y$3) : 0) >>> 0; + nbits = 32 - ((shift - nbits >>> 0)) >>> 0; + } + k = k + (1) >> 0; + } + while (true) { + if (!(!((w === 0)))) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((w & mask) >>> 0))); + w = (y$4 = (shift), y$4 < 32 ? (w >>> y$4) : 0) >>> 0; + } + } else { + _tuple = maxPow(b); + bb = _tuple[0]; + ndigits = _tuple[1]; + table = divisors(x.$length, b, ndigits, bb); + q = nat.nil.set(x); + q.convertWords(s, b, ndigits, bb, table); + i = 0; + while (true) { + if (!(((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i]) === 48)) { break; } + i = i + (1) >> 0; + } + } + if (neg) { + i = i - (1) >> 0; + ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = 45); + } + return $subslice(s, i); + }; + $ptrType(nat).prototype.itoa = function(neg, base) { return this.$get().itoa(neg, base); }; + nat.prototype.convertWords = function(s, b, ndigits, bb, table) { + var $ptr, _q, _q$1, _r, _tuple, _tuple$1, _tuple$2, b, bb, h, i, index, j, j$1, maxLength, minLength, ndigits, q, r, r$1, s, t, table, x; + q = this; + if (!(table === sliceType$3.nil)) { + r = nat.nil; + index = table.$length - 1 >> 0; + while (true) { + if (!(q.$length > leafSize)) { break; } + maxLength = q.bitLen(); + minLength = maxLength >> 1 >> 0; + while (true) { + if (!(index > 0 && (x = index - 1 >> 0, ((x < 0 || x >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + x])).nbits > minLength)) { break; } + index = index - (1) >> 0; + } + if (((index < 0 || index >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + index]).nbits >= maxLength && ((index < 0 || index >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + index]).bbb.cmp(q) >= 0) { + index = index - (1) >> 0; + if (index < 0) { + $panic(new $String("internal inconsistency")); + } + } + _tuple = q.div(r, q, ((index < 0 || index >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + index]).bbb); + q = _tuple[0]; + r = _tuple[1]; + h = s.$length - ((index < 0 || index >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + index]).ndigits >> 0; + r.convertWords($subslice(s, h), b, ndigits, bb, $subslice(table, 0, index)); + s = $subslice(s, 0, h); + } + } + i = s.$length; + r$1 = 0; + if (b === 10) { + while (true) { + if (!(q.$length > 0)) { break; } + _tuple$1 = q.divW(q, bb); + q = _tuple$1[0]; + r$1 = _tuple$1[1]; + j = 0; + while (true) { + if (!(j < ndigits && i > 0)) { break; } + i = i - (1) >> 0; + t = (_q = r$1 / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); + ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = (48 + ((((r$1 - (t << 3 >>> 0) >>> 0) - t >>> 0) - t >>> 0) << 24 >>> 24) << 24 >>> 24)); + r$1 = t; + j = j + (1) >> 0; + } + } + } else { + while (true) { + if (!(q.$length > 0)) { break; } + _tuple$2 = q.divW(q, bb); + q = _tuple$2[0]; + r$1 = _tuple$2[1]; + j$1 = 0; + while (true) { + if (!(j$1 < ndigits && i > 0)) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((_r = r$1 % b, _r === _r ? _r : $throwRuntimeError("integer divide by zero")))); + r$1 = (_q$1 = r$1 / (b), (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); + j$1 = j$1 + (1) >> 0; + } + } + } + while (true) { + if (!(i > 0)) { break; } + i = i - (1) >> 0; + ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = 48); + } + }; + $ptrType(nat).prototype.convertWords = function(s, b, ndigits, bb, table) { return this.$get().convertWords(s, b, ndigits, bb, table); }; + nat.prototype.expWW = function(x, y) { + var $ptr, x, y, z; + z = this; + return z.expNN(nat.nil.setWord(x), nat.nil.setWord(y), nat.nil); + }; + $ptrType(nat).prototype.expWW = function(x, y) { return this.$get().expWW(x, y); }; + divisors = function(m, b, ndigits, bb) { + var $ptr, b, bb, i, k, larger, m, ndigits, table, words, x, x$1, x$2, x$3, y; + if ((leafSize === 0) || m <= leafSize) { + return sliceType$3.nil; + } + k = 1; + words = leafSize; + while (true) { + if (!(words < (m >> 1 >> 0) && k < 64)) { break; } + k = k + (1) >> 0; + words = (y = (1), y < 32 ? (words << y) : 0) >> 0; + } + table = sliceType$3.nil; + if (b === 10) { + cacheBase10.Mutex.Lock(); + table = $subslice(new sliceType$3(cacheBase10.table), 0, k); + } else { + table = $makeSlice(sliceType$3, k); + } + if ((x = k - 1 >> 0, ((x < 0 || x >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + x])).ndigits === 0) { + larger = nat.nil; + i = 0; + while (true) { + if (!(i < k)) { break; } + if (((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).ndigits === 0) { + if (i === 0) { + (0 >= table.$length ? $throwRuntimeError("index out of range") : table.$array[table.$offset + 0]).bbb = nat.nil.expWW(bb, (leafSize >>> 0)); + (0 >= table.$length ? $throwRuntimeError("index out of range") : table.$array[table.$offset + 0]).ndigits = $imul(ndigits, leafSize); + } else { + ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).bbb = nat.nil.mul((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + x$1])).bbb, (x$2 = i - 1 >> 0, ((x$2 < 0 || x$2 >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + x$2])).bbb); + ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).ndigits = $imul(2, (x$3 = i - 1 >> 0, ((x$3 < 0 || x$3 >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + x$3])).ndigits); + } + larger = nat.nil.set(((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).bbb); + while (true) { + if (!(mulAddVWW($subslice(new sliceType$2(larger.$array), larger.$offset, larger.$offset + larger.$length), $subslice(new sliceType$2(larger.$array), larger.$offset, larger.$offset + larger.$length), b, 0) === 0)) { break; } + ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).bbb = ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).bbb.set(larger); + ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).ndigits = ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).ndigits + (1) >> 0; + } + ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).nbits = ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).bbb.bitLen(); + } + i = i + (1) >> 0; + } + } + if (b === 10) { + cacheBase10.Mutex.Unlock(); + } + return table; + }; + ptrType$1.methods = [{prop: "Sign", name: "Sign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetInt64", name: "SetInt64", pkg: "", typ: $funcType([$Int64], [ptrType$1], false)}, {prop: "SetUint64", name: "SetUint64", pkg: "", typ: $funcType([$Uint64], [ptrType$1], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [sliceType$2], false)}, {prop: "SetBits", name: "SetBits", pkg: "", typ: $funcType([sliceType$2], [ptrType$1], false)}, {prop: "Abs", name: "Abs", pkg: "", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "Neg", name: "Neg", pkg: "", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Sub", name: "Sub", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Mul", name: "Mul", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "MulRange", name: "MulRange", pkg: "", typ: $funcType([$Int64, $Int64], [ptrType$1], false)}, {prop: "Binomial", name: "Binomial", pkg: "", typ: $funcType([$Int64, $Int64], [ptrType$1], false)}, {prop: "Quo", name: "Quo", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Rem", name: "Rem", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "QuoRem", name: "QuoRem", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "Div", name: "Div", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Mod", name: "Mod", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "DivMod", name: "DivMod", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "Cmp", name: "Cmp", pkg: "", typ: $funcType([ptrType$1], [$Int], false)}, {prop: "Int64", name: "Int64", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "SetString", name: "SetString", pkg: "", typ: $funcType([$String, $Int], [ptrType$1, $Bool], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType], [ptrType$1], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "BitLen", name: "BitLen", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Exp", name: "Exp", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "GCD", name: "GCD", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "binaryGCD", name: "binaryGCD", pkg: "math/big", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "ProbablyPrime", name: "ProbablyPrime", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "Rand", name: "Rand", pkg: "", typ: $funcType([ptrType$6, ptrType$1], [ptrType$1], false)}, {prop: "ModInverse", name: "ModInverse", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "modSqrt3Mod4Prime", name: "modSqrt3Mod4Prime", pkg: "math/big", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "modSqrtTonelliShanks", name: "modSqrtTonelliShanks", pkg: "math/big", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "ModSqrt", name: "ModSqrt", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Lsh", name: "Lsh", pkg: "", typ: $funcType([ptrType$1, $Uint], [ptrType$1], false)}, {prop: "Rsh", name: "Rsh", pkg: "", typ: $funcType([ptrType$1, $Uint], [ptrType$1], false)}, {prop: "Bit", name: "Bit", pkg: "", typ: $funcType([$Int], [$Uint], false)}, {prop: "SetBit", name: "SetBit", pkg: "", typ: $funcType([ptrType$1, $Int, $Uint], [ptrType$1], false)}, {prop: "And", name: "And", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "AndNot", name: "AndNot", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Or", name: "Or", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Xor", name: "Xor", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Not", name: "Not", pkg: "", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "Text", name: "Text", pkg: "", typ: $funcType([$Int], [$String], false)}, {prop: "Append", name: "Append", pkg: "", typ: $funcType([sliceType, $Int], [sliceType], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Format", name: "Format", pkg: "", typ: $funcType([fmt.State, $Int32], [], false)}, {prop: "scan", name: "scan", pkg: "math/big", typ: $funcType([io.ByteScanner, $Int], [ptrType$1, $Int, $error], false)}, {prop: "Scan", name: "Scan", pkg: "", typ: $funcType([fmt.ScanState, $Int32], [$error], false)}, {prop: "GobEncode", name: "GobEncode", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "GobDecode", name: "GobDecode", pkg: "", typ: $funcType([sliceType], [$error], false)}, {prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "UnmarshalText", name: "UnmarshalText", pkg: "", typ: $funcType([sliceType], [$error], false)}, {prop: "MarshalJSON", name: "MarshalJSON", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "UnmarshalJSON", name: "UnmarshalJSON", pkg: "", typ: $funcType([sliceType], [$error], false)}]; + byteReader.methods = [{prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}]; + nat.methods = [{prop: "clear", name: "clear", pkg: "math/big", typ: $funcType([], [], false)}, {prop: "norm", name: "norm", pkg: "math/big", typ: $funcType([], [nat], false)}, {prop: "make", name: "make", pkg: "math/big", typ: $funcType([$Int], [nat], false)}, {prop: "setWord", name: "setWord", pkg: "math/big", typ: $funcType([Word], [nat], false)}, {prop: "setUint64", name: "setUint64", pkg: "math/big", typ: $funcType([$Uint64], [nat], false)}, {prop: "set", name: "set", pkg: "math/big", typ: $funcType([nat], [nat], false)}, {prop: "add", name: "add", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "sub", name: "sub", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "cmp", name: "cmp", pkg: "math/big", typ: $funcType([nat], [$Int], false)}, {prop: "mulAddWW", name: "mulAddWW", pkg: "math/big", typ: $funcType([nat, Word, Word], [nat], false)}, {prop: "montgomery", name: "montgomery", pkg: "math/big", typ: $funcType([nat, nat, nat, Word, $Int], [nat], false)}, {prop: "mul", name: "mul", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "mulRange", name: "mulRange", pkg: "math/big", typ: $funcType([$Uint64, $Uint64], [nat], false)}, {prop: "divW", name: "divW", pkg: "math/big", typ: $funcType([nat, Word], [nat, Word], false)}, {prop: "div", name: "div", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat, nat], false)}, {prop: "divLarge", name: "divLarge", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat, nat], false)}, {prop: "bitLen", name: "bitLen", pkg: "math/big", typ: $funcType([], [$Int], false)}, {prop: "trailingZeroBits", name: "trailingZeroBits", pkg: "math/big", typ: $funcType([], [$Uint], false)}, {prop: "shl", name: "shl", pkg: "math/big", typ: $funcType([nat, $Uint], [nat], false)}, {prop: "shr", name: "shr", pkg: "math/big", typ: $funcType([nat, $Uint], [nat], false)}, {prop: "setBit", name: "setBit", pkg: "math/big", typ: $funcType([nat, $Uint, $Uint], [nat], false)}, {prop: "bit", name: "bit", pkg: "math/big", typ: $funcType([$Uint], [$Uint], false)}, {prop: "sticky", name: "sticky", pkg: "math/big", typ: $funcType([$Uint], [$Uint], false)}, {prop: "and", name: "and", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "andNot", name: "andNot", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "or", name: "or", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "xor", name: "xor", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "modW", name: "modW", pkg: "math/big", typ: $funcType([Word], [Word], false)}, {prop: "random", name: "random", pkg: "math/big", typ: $funcType([ptrType$6, nat, $Int], [nat], false)}, {prop: "expNN", name: "expNN", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat], false)}, {prop: "expNNWindowed", name: "expNNWindowed", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat], false)}, {prop: "expNNMontgomery", name: "expNNMontgomery", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat], false)}, {prop: "probablyPrime", name: "probablyPrime", pkg: "math/big", typ: $funcType([$Int], [$Bool], false)}, {prop: "bytes", name: "bytes", pkg: "math/big", typ: $funcType([sliceType], [$Int], false)}, {prop: "setBytes", name: "setBytes", pkg: "math/big", typ: $funcType([sliceType], [nat], false)}, {prop: "scan", name: "scan", pkg: "math/big", typ: $funcType([io.ByteScanner, $Int, $Bool], [nat, $Int, $Int, $error], false)}, {prop: "utoa", name: "utoa", pkg: "math/big", typ: $funcType([$Int], [sliceType], false)}, {prop: "itoa", name: "itoa", pkg: "math/big", typ: $funcType([$Bool, $Int], [sliceType], false)}, {prop: "convertWords", name: "convertWords", pkg: "math/big", typ: $funcType([sliceType, Word, $Int, Word, sliceType$3], [], false)}, {prop: "expWW", name: "expWW", pkg: "math/big", typ: $funcType([Word, Word], [nat], false)}]; + Int.init([{prop: "neg", name: "neg", pkg: "math/big", typ: $Bool, tag: ""}, {prop: "abs", name: "abs", pkg: "math/big", typ: nat, tag: ""}]); + byteReader.init([{prop: "ScanState", name: "", pkg: "", typ: fmt.ScanState, tag: ""}]); + nat.init(Word); + divisor.init([{prop: "bbb", name: "bbb", pkg: "math/big", typ: nat, tag: ""}, {prop: "nbits", name: "nbits", pkg: "math/big", typ: $Int, tag: ""}, {prop: "ndigits", name: "ndigits", pkg: "math/big", typ: $Int, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = binary.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = errors.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = fmt.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = nosync.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = math.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = rand.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strconv.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strings.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + cacheBase10 = new structType.ptr(new nosync.Mutex.ptr(false), arrayType.zero()); + natOne = new nat([1]); + intOne = new Int.ptr(false, natOne); + natTwo = new nat([2]); + karatsubaThreshold = 40; + deBruijn32Lookup = new sliceType([0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9]); + deBruijn64Lookup = new sliceType([0, 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4, 62, 47, 59, 36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5, 63, 55, 48, 27, 60, 41, 37, 16, 46, 35, 44, 21, 52, 32, 23, 11, 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6]); + leafSize = 8; + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["crypto/rand"] = (function() { + var $pkg = {}, $init, errors, js, io, big, rngReader, sliceType, ptrType$1, smallPrimesProduct, init, Read; + errors = $packages["errors"]; + js = $packages["github.com/gopherjs/gopherjs/js"]; + io = $packages["io"]; + big = $packages["math/big"]; + rngReader = $pkg.rngReader = $newType(0, $kindStruct, "rand.rngReader", "rngReader", "crypto/rand", function() { + this.$val = this; + if (arguments.length === 0) { + return; + } + }); + sliceType = $sliceType($Uint8); + ptrType$1 = $ptrType(rngReader); + init = function() { + var $ptr; + $pkg.Reader = new rngReader.ptr(); + }; + rngReader.ptr.prototype.Read = function(b) { + var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, array, b, crypto, err, n, offset, r, randomBytes, require; + n = 0; + err = $ifaceNil; + r = this; + array = b.$array; + offset = $parseInt(b.$offset) >> 0; + crypto = $global.crypto; + if (crypto === undefined) { + crypto = $global.msCrypto; + } + if (!(crypto === undefined)) { + if (!(crypto.getRandomValues === undefined)) { + n = b.$length; + if (n > 65536) { + n = 65536; + } + crypto.getRandomValues(array.subarray(offset, offset + n >> 0)); + _tmp = n; + _tmp$1 = $ifaceNil; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + } + require = $global.require; + if (!(require === undefined)) { + randomBytes = require($externalize("crypto", $String)).randomBytes; + if (!(randomBytes === undefined)) { + array.set(randomBytes(b.$length), offset); + _tmp$2 = b.$length; + _tmp$3 = $ifaceNil; + n = _tmp$2; + err = _tmp$3; + return [n, err]; + } + } + _tmp$4 = 0; + _tmp$5 = errors.New("crypto/rand not available in this environment"); + n = _tmp$4; + err = _tmp$5; + return [n, err]; + }; + rngReader.prototype.Read = function(b) { return this.$val.Read(b); }; + Read = function(b) { + var $ptr, _r, _tuple, b, err, n, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + _r = io.ReadFull($pkg.Reader, b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + n = _tuple[0]; + err = _tuple[1]; + /* */ $s = 2; case 2: + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Read }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Read = Read; + ptrType$1.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]; + rngReader.init([]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = big.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.Reader = $ifaceNil; + smallPrimesProduct = new big.Int.ptr(false, big.nat.nil).SetUint64(new $Uint64(3793877372, 820596253)); + init(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["hash"] = (function() { + var $pkg = {}, $init, io, Hash, sliceType; + io = $packages["io"]; + Hash = $pkg.Hash = $newType(8, $kindInterface, "hash.Hash", "Hash", "hash", null); + sliceType = $sliceType($Uint8); + Hash.init([{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType], [sliceType], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = io.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["crypto"] = (function() { + var $pkg = {}, $init, hash, io, strconv, funcType, sliceType$1, hashes, RegisterHash; + hash = $packages["hash"]; + io = $packages["io"]; + strconv = $packages["strconv"]; + funcType = $funcType([], [hash.Hash], false); + sliceType$1 = $sliceType(funcType); + RegisterHash = function(h, f) { + var $ptr, f, h; + if (h >= 16) { + $panic(new $String("crypto: RegisterHash of unknown hash function")); + } + ((h < 0 || h >= hashes.$length) ? $throwRuntimeError("index out of range") : hashes.$array[hashes.$offset + h] = f); + }; + $pkg.RegisterHash = RegisterHash; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = hash.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strconv.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + hashes = $makeSlice(sliceType$1, 16); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["crypto/sha256"] = (function() { + var $pkg = {}, $init, crypto, hash, digest, sliceType, arrayType, arrayType$1, sliceType$1, arrayType$2, arrayType$4, ptrType, _K, init, New, New224, Sum256, block; + crypto = $packages["crypto"]; + hash = $packages["hash"]; + digest = $pkg.digest = $newType(0, $kindStruct, "sha256.digest", "digest", "crypto/sha256", function(h_, x_, nx_, len_, is224_) { + this.$val = this; + if (arguments.length === 0) { + this.h = arrayType.zero(); + this.x = arrayType$1.zero(); + this.nx = 0; + this.len = new $Uint64(0, 0); + this.is224 = false; + return; + } + this.h = h_; + this.x = x_; + this.nx = nx_; + this.len = len_; + this.is224 = is224_; + }); + sliceType = $sliceType($Uint32); + arrayType = $arrayType($Uint32, 8); + arrayType$1 = $arrayType($Uint8, 64); + sliceType$1 = $sliceType($Uint8); + arrayType$2 = $arrayType($Uint8, 32); + arrayType$4 = $arrayType($Uint32, 64); + ptrType = $ptrType(digest); + init = function() { + var $ptr; + crypto.RegisterHash(4, New224); + crypto.RegisterHash(5, New); + }; + digest.ptr.prototype.Reset = function() { + var $ptr, d; + d = this; + if (!d.is224) { + d.h[0] = 1779033703; + d.h[1] = 3144134277; + d.h[2] = 1013904242; + d.h[3] = 2773480762; + d.h[4] = 1359893119; + d.h[5] = 2600822924; + d.h[6] = 528734635; + d.h[7] = 1541459225; + } else { + d.h[0] = 3238371032; + d.h[1] = 914150663; + d.h[2] = 812702999; + d.h[3] = 4144912697; + d.h[4] = 4290775857; + d.h[5] = 1750603025; + d.h[6] = 1694076839; + d.h[7] = 3204075428; + } + d.nx = 0; + d.len = new $Uint64(0, 0); + }; + digest.prototype.Reset = function() { return this.$val.Reset(); }; + New = function() { + var $ptr, d; + d = new digest.ptr(arrayType.zero(), arrayType$1.zero(), 0, new $Uint64(0, 0), false); + d.Reset(); + return d; + }; + $pkg.New = New; + New224 = function() { + var $ptr, d; + d = new digest.ptr(arrayType.zero(), arrayType$1.zero(), 0, new $Uint64(0, 0), false); + d.is224 = true; + d.Reset(); + return d; + }; + $pkg.New224 = New224; + digest.ptr.prototype.Size = function() { + var $ptr, d; + d = this; + if (!d.is224) { + return 32; + } + return 28; + }; + digest.prototype.Size = function() { return this.$val.Size(); }; + digest.ptr.prototype.BlockSize = function() { + var $ptr, d; + d = this; + return 64; + }; + digest.prototype.BlockSize = function() { return this.$val.BlockSize(); }; + digest.ptr.prototype.Write = function(p) { + var $ptr, d, err, n, n$1, nn, p, x, x$1; + nn = 0; + err = $ifaceNil; + d = this; + nn = p.$length; + d.len = (x = d.len, x$1 = new $Uint64(0, nn), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); + if (d.nx > 0) { + n = $copySlice($subslice(new sliceType$1(d.x), d.nx), p); + d.nx = d.nx + (n) >> 0; + if (d.nx === 64) { + block(d, new sliceType$1(d.x)); + d.nx = 0; + } + p = $subslice(p, n); + } + if (p.$length >= 64) { + n$1 = (p.$length & ~63) >> 0; + block(d, $subslice(p, 0, n$1)); + p = $subslice(p, n$1); + } + if (p.$length > 0) { + d.nx = $copySlice(new sliceType$1(d.x), p); + } + return [nn, err]; + }; + digest.prototype.Write = function(p) { return this.$val.Write(p); }; + digest.ptr.prototype.Sum = function(in$1) { + var $ptr, d, d0, hash$1, in$1; + d0 = this; + d = $clone(d0, digest); + hash$1 = $clone(d.checkSum(), arrayType$2); + if (d.is224) { + return $appendSlice(in$1, $subslice(new sliceType$1(hash$1), 0, 28)); + } + return $appendSlice(in$1, new sliceType$1(hash$1)); + }; + digest.prototype.Sum = function(in$1) { return this.$val.Sum(in$1); }; + digest.ptr.prototype.checkSum = function() { + var $ptr, _i, _ref, d, digest$1, h, i, i$1, len, s, tmp, x, x$1, x$2, x$3, x$4, x$5, x$6; + d = this; + len = d.len; + tmp = arrayType$1.zero(); + tmp[0] = 128; + if ((x = $div64(len, new $Uint64(0, 64), true), (x.$high < 0 || (x.$high === 0 && x.$low < 56)))) { + d.Write($subslice(new sliceType$1(tmp), 0, $flatten64((x$1 = $div64(len, new $Uint64(0, 64), true), new $Uint64(0 - x$1.$high, 56 - x$1.$low))))); + } else { + d.Write($subslice(new sliceType$1(tmp), 0, $flatten64((x$2 = $div64(len, new $Uint64(0, 64), true), new $Uint64(0 - x$2.$high, 120 - x$2.$low))))); + } + len = $shiftLeft64(len, (3)); + i = 0; + while (true) { + if (!(i < 8)) { break; } + ((i < 0 || i >= tmp.length) ? $throwRuntimeError("index out of range") : tmp[i] = ($shiftRightUint64(len, ((56 - (8 * i >>> 0) >>> 0))).$low << 24 >>> 24)); + i = i + (1) >>> 0; + } + d.Write($subslice(new sliceType$1(tmp), 0, 8)); + if (!((d.nx === 0))) { + $panic(new $String("d.nx != 0")); + } + h = new sliceType(d.h); + if (d.is224) { + h = $subslice(new sliceType(d.h), 0, 7); + } + digest$1 = arrayType$2.zero(); + _ref = h; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i$1 = _i; + s = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + (x$3 = $imul(i$1, 4), ((x$3 < 0 || x$3 >= digest$1.length) ? $throwRuntimeError("index out of range") : digest$1[x$3] = ((s >>> 24 >>> 0) << 24 >>> 24))); + (x$4 = ($imul(i$1, 4)) + 1 >> 0, ((x$4 < 0 || x$4 >= digest$1.length) ? $throwRuntimeError("index out of range") : digest$1[x$4] = ((s >>> 16 >>> 0) << 24 >>> 24))); + (x$5 = ($imul(i$1, 4)) + 2 >> 0, ((x$5 < 0 || x$5 >= digest$1.length) ? $throwRuntimeError("index out of range") : digest$1[x$5] = ((s >>> 8 >>> 0) << 24 >>> 24))); + (x$6 = ($imul(i$1, 4)) + 3 >> 0, ((x$6 < 0 || x$6 >= digest$1.length) ? $throwRuntimeError("index out of range") : digest$1[x$6] = (s << 24 >>> 24))); + _i++; + } + return digest$1; + }; + digest.prototype.checkSum = function() { return this.$val.checkSum(); }; + Sum256 = function(data) { + var $ptr, d, data; + d = new digest.ptr(arrayType.zero(), arrayType$1.zero(), 0, new $Uint64(0, 0), false); + d.Reset(); + d.Write(data); + return d.checkSum(); + }; + $pkg.Sum256 = Sum256; + block = function(dig, p) { + var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, a, b, c, d, dig, e, f, g, h, h0, h1, h2, h3, h4, h5, h6, h7, i, i$1, i$2, j, p, t1, t1$1, t2, t2$1, v1, v2, w, x, x$1, x$2, x$3, x$4, x$5, x$6; + w = arrayType$4.zero(); + _tmp = dig.h[0]; + _tmp$1 = dig.h[1]; + _tmp$2 = dig.h[2]; + _tmp$3 = dig.h[3]; + _tmp$4 = dig.h[4]; + _tmp$5 = dig.h[5]; + _tmp$6 = dig.h[6]; + _tmp$7 = dig.h[7]; + h0 = _tmp; + h1 = _tmp$1; + h2 = _tmp$2; + h3 = _tmp$3; + h4 = _tmp$4; + h5 = _tmp$5; + h6 = _tmp$6; + h7 = _tmp$7; + while (true) { + if (!(p.$length >= 64)) { break; } + i = 0; + while (true) { + if (!(i < 16)) { break; } + j = $imul(i, 4); + ((i < 0 || i >= w.length) ? $throwRuntimeError("index out of range") : w[i] = ((((((((((j < 0 || j >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + j]) >>> 0) << 24 >>> 0) | (((x = j + 1 >> 0, ((x < 0 || x >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x])) >>> 0) << 16 >>> 0)) >>> 0) | (((x$1 = j + 2 >> 0, ((x$1 < 0 || x$1 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x$1])) >>> 0) << 8 >>> 0)) >>> 0) | ((x$2 = j + 3 >> 0, ((x$2 < 0 || x$2 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x$2])) >>> 0)) >>> 0)); + i = i + (1) >> 0; + } + i$1 = 16; + while (true) { + if (!(i$1 < 64)) { break; } + v1 = (x$3 = i$1 - 2 >> 0, ((x$3 < 0 || x$3 >= w.length) ? $throwRuntimeError("index out of range") : w[x$3])); + t1 = (((((((v1 >>> 17 >>> 0) | (v1 << 15 >>> 0)) >>> 0)) ^ ((((v1 >>> 19 >>> 0) | (v1 << 13 >>> 0)) >>> 0))) >>> 0) ^ ((v1 >>> 10 >>> 0))) >>> 0; + v2 = (x$4 = i$1 - 15 >> 0, ((x$4 < 0 || x$4 >= w.length) ? $throwRuntimeError("index out of range") : w[x$4])); + t2 = (((((((v2 >>> 7 >>> 0) | (v2 << 25 >>> 0)) >>> 0)) ^ ((((v2 >>> 18 >>> 0) | (v2 << 14 >>> 0)) >>> 0))) >>> 0) ^ ((v2 >>> 3 >>> 0))) >>> 0; + ((i$1 < 0 || i$1 >= w.length) ? $throwRuntimeError("index out of range") : w[i$1] = (((t1 + (x$5 = i$1 - 7 >> 0, ((x$5 < 0 || x$5 >= w.length) ? $throwRuntimeError("index out of range") : w[x$5])) >>> 0) + t2 >>> 0) + (x$6 = i$1 - 16 >> 0, ((x$6 < 0 || x$6 >= w.length) ? $throwRuntimeError("index out of range") : w[x$6])) >>> 0)); + i$1 = i$1 + (1) >> 0; + } + _tmp$8 = h0; + _tmp$9 = h1; + _tmp$10 = h2; + _tmp$11 = h3; + _tmp$12 = h4; + _tmp$13 = h5; + _tmp$14 = h6; + _tmp$15 = h7; + a = _tmp$8; + b = _tmp$9; + c = _tmp$10; + d = _tmp$11; + e = _tmp$12; + f = _tmp$13; + g = _tmp$14; + h = _tmp$15; + i$2 = 0; + while (true) { + if (!(i$2 < 64)) { break; } + t1$1 = (((h + (((((((((e >>> 6 >>> 0) | (e << 26 >>> 0)) >>> 0)) ^ ((((e >>> 11 >>> 0) | (e << 21 >>> 0)) >>> 0))) >>> 0) ^ ((((e >>> 25 >>> 0) | (e << 7 >>> 0)) >>> 0))) >>> 0)) >>> 0) + ((((((e & f) >>> 0)) ^ ((((~e >>> 0) & g) >>> 0))) >>> 0)) >>> 0) + ((i$2 < 0 || i$2 >= _K.$length) ? $throwRuntimeError("index out of range") : _K.$array[_K.$offset + i$2]) >>> 0) + ((i$2 < 0 || i$2 >= w.length) ? $throwRuntimeError("index out of range") : w[i$2]) >>> 0; + t2$1 = (((((((((a >>> 2 >>> 0) | (a << 30 >>> 0)) >>> 0)) ^ ((((a >>> 13 >>> 0) | (a << 19 >>> 0)) >>> 0))) >>> 0) ^ ((((a >>> 22 >>> 0) | (a << 10 >>> 0)) >>> 0))) >>> 0)) + ((((((((a & b) >>> 0)) ^ (((a & c) >>> 0))) >>> 0) ^ (((b & c) >>> 0))) >>> 0)) >>> 0; + h = g; + g = f; + f = e; + e = d + t1$1 >>> 0; + d = c; + c = b; + b = a; + a = t1$1 + t2$1 >>> 0; + i$2 = i$2 + (1) >> 0; + } + h0 = h0 + (a) >>> 0; + h1 = h1 + (b) >>> 0; + h2 = h2 + (c) >>> 0; + h3 = h3 + (d) >>> 0; + h4 = h4 + (e) >>> 0; + h5 = h5 + (f) >>> 0; + h6 = h6 + (g) >>> 0; + h7 = h7 + (h) >>> 0; + p = $subslice(p, 64); + } + _tmp$16 = h0; + _tmp$17 = h1; + _tmp$18 = h2; + _tmp$19 = h3; + _tmp$20 = h4; + _tmp$21 = h5; + _tmp$22 = h6; + _tmp$23 = h7; + dig.h[0] = _tmp$16; + dig.h[1] = _tmp$17; + dig.h[2] = _tmp$18; + dig.h[3] = _tmp$19; + dig.h[4] = _tmp$20; + dig.h[5] = _tmp$21; + dig.h[6] = _tmp$22; + dig.h[7] = _tmp$23; + }; + ptrType.methods = [{prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType$1], [sliceType$1], false)}, {prop: "checkSum", name: "checkSum", pkg: "crypto/sha256", typ: $funcType([], [arrayType$2], false)}]; + digest.init([{prop: "h", name: "h", pkg: "crypto/sha256", typ: arrayType, tag: ""}, {prop: "x", name: "x", pkg: "crypto/sha256", typ: arrayType$1, tag: ""}, {prop: "nx", name: "nx", pkg: "crypto/sha256", typ: $Int, tag: ""}, {prop: "len", name: "len", pkg: "crypto/sha256", typ: $Uint64, tag: ""}, {prop: "is224", name: "is224", pkg: "crypto/sha256", typ: $Bool, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = crypto.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = hash.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _K = new sliceType([1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298]); + init(); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["encoding/base64"] = (function() { + var $pkg = {}, $init, io, strconv, Encoding, encoder, CorruptInputError, arrayType, arrayType$1, sliceType, ptrType, arrayType$2, arrayType$3, arrayType$4, ptrType$1, NewEncoding, NewEncoder; + io = $packages["io"]; + strconv = $packages["strconv"]; + Encoding = $pkg.Encoding = $newType(0, $kindStruct, "base64.Encoding", "Encoding", "encoding/base64", function(encode_, decodeMap_, padChar_) { + this.$val = this; + if (arguments.length === 0) { + this.encode = arrayType.zero(); + this.decodeMap = arrayType$1.zero(); + this.padChar = 0; + return; + } + this.encode = encode_; + this.decodeMap = decodeMap_; + this.padChar = padChar_; + }); + encoder = $pkg.encoder = $newType(0, $kindStruct, "base64.encoder", "encoder", "encoding/base64", function(err_, enc_, w_, buf_, nbuf_, out_) { + this.$val = this; + if (arguments.length === 0) { + this.err = $ifaceNil; + this.enc = ptrType.nil; + this.w = $ifaceNil; + this.buf = arrayType$2.zero(); + this.nbuf = 0; + this.out = arrayType$3.zero(); + return; + } + this.err = err_; + this.enc = enc_; + this.w = w_; + this.buf = buf_; + this.nbuf = nbuf_; + this.out = out_; + }); + CorruptInputError = $pkg.CorruptInputError = $newType(8, $kindInt64, "base64.CorruptInputError", "CorruptInputError", "encoding/base64", null); + arrayType = $arrayType($Uint8, 64); + arrayType$1 = $arrayType($Uint8, 256); + sliceType = $sliceType($Uint8); + ptrType = $ptrType(Encoding); + arrayType$2 = $arrayType($Uint8, 3); + arrayType$3 = $arrayType($Uint8, 1024); + arrayType$4 = $arrayType($Uint8, 4); + ptrType$1 = $ptrType(encoder); + NewEncoding = function(encoder$1) { + var $ptr, e, encoder$1, i, i$1, x, x$1, x$2; + if (!((encoder$1.length === 64))) { + $panic(new $String("encoding alphabet is not 64-bytes long")); + } + e = new Encoding.ptr(arrayType.zero(), arrayType$1.zero(), 0); + e.padChar = 61; + $copyString(new sliceType(e.encode), encoder$1); + i = 0; + while (true) { + if (!(i < 256)) { break; } + (x = e.decodeMap, ((i < 0 || i >= x.length) ? $throwRuntimeError("index out of range") : x[i] = 255)); + i = i + (1) >> 0; + } + i$1 = 0; + while (true) { + if (!(i$1 < encoder$1.length)) { break; } + (x$1 = e.decodeMap, x$2 = encoder$1.charCodeAt(i$1), ((x$2 < 0 || x$2 >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[x$2] = (i$1 << 24 >>> 24))); + i$1 = i$1 + (1) >> 0; + } + return e; + }; + $pkg.NewEncoding = NewEncoding; + Encoding.ptr.prototype.WithPadding = function(padding) { + var $ptr, enc, padding; + enc = $clone(this, Encoding); + enc.padChar = padding; + return enc; + }; + Encoding.prototype.WithPadding = function(padding) { return this.$val.WithPadding(padding); }; + Encoding.ptr.prototype.Encode = function(dst, src) { + var $ptr, _1, _q, _tmp, _tmp$1, di, dst, enc, n, remain, si, src, val, val$1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$22, x$23, x$24, x$25, x$26, x$27, x$28, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + enc = this; + if (src.$length === 0) { + return; + } + _tmp = 0; + _tmp$1 = 0; + di = _tmp; + si = _tmp$1; + n = $imul(((_q = src.$length / 3, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))), 3); + while (true) { + if (!(si < n)) { break; } + val = ((((((x = si + 0 >> 0, ((x < 0 || x >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x])) >>> 0) << 16 >>> 0) | (((x$1 = si + 1 >> 0, ((x$1 < 0 || x$1 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$1])) >>> 0) << 8 >>> 0)) >>> 0) | ((x$2 = si + 2 >> 0, ((x$2 < 0 || x$2 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$2])) >>> 0)) >>> 0; + (x$5 = di + 0 >> 0, ((x$5 < 0 || x$5 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$5] = (x$3 = enc.encode, x$4 = ((val >>> 18 >>> 0) & 63) >>> 0, ((x$4 < 0 || x$4 >= x$3.length) ? $throwRuntimeError("index out of range") : x$3[x$4])))); + (x$8 = di + 1 >> 0, ((x$8 < 0 || x$8 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$8] = (x$6 = enc.encode, x$7 = ((val >>> 12 >>> 0) & 63) >>> 0, ((x$7 < 0 || x$7 >= x$6.length) ? $throwRuntimeError("index out of range") : x$6[x$7])))); + (x$11 = di + 2 >> 0, ((x$11 < 0 || x$11 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$11] = (x$9 = enc.encode, x$10 = ((val >>> 6 >>> 0) & 63) >>> 0, ((x$10 < 0 || x$10 >= x$9.length) ? $throwRuntimeError("index out of range") : x$9[x$10])))); + (x$14 = di + 3 >> 0, ((x$14 < 0 || x$14 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$14] = (x$12 = enc.encode, x$13 = (val & 63) >>> 0, ((x$13 < 0 || x$13 >= x$12.length) ? $throwRuntimeError("index out of range") : x$12[x$13])))); + si = si + (3) >> 0; + di = di + (4) >> 0; + } + remain = src.$length - si >> 0; + if (remain === 0) { + return; + } + val$1 = ((x$15 = si + 0 >> 0, ((x$15 < 0 || x$15 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$15])) >>> 0) << 16 >>> 0; + if (remain === 2) { + val$1 = (val$1 | ((((x$16 = si + 1 >> 0, ((x$16 < 0 || x$16 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$16])) >>> 0) << 8 >>> 0))) >>> 0; + } + (x$19 = di + 0 >> 0, ((x$19 < 0 || x$19 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$19] = (x$17 = enc.encode, x$18 = ((val$1 >>> 18 >>> 0) & 63) >>> 0, ((x$18 < 0 || x$18 >= x$17.length) ? $throwRuntimeError("index out of range") : x$17[x$18])))); + (x$22 = di + 1 >> 0, ((x$22 < 0 || x$22 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$22] = (x$20 = enc.encode, x$21 = ((val$1 >>> 12 >>> 0) & 63) >>> 0, ((x$21 < 0 || x$21 >= x$20.length) ? $throwRuntimeError("index out of range") : x$20[x$21])))); + _1 = remain; + if (_1 === (2)) { + (x$25 = di + 2 >> 0, ((x$25 < 0 || x$25 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$25] = (x$23 = enc.encode, x$24 = ((val$1 >>> 6 >>> 0) & 63) >>> 0, ((x$24 < 0 || x$24 >= x$23.length) ? $throwRuntimeError("index out of range") : x$23[x$24])))); + if (!((enc.padChar === -1))) { + (x$26 = di + 3 >> 0, ((x$26 < 0 || x$26 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$26] = (enc.padChar << 24 >>> 24))); + } + } else if (_1 === (1)) { + if (!((enc.padChar === -1))) { + (x$27 = di + 2 >> 0, ((x$27 < 0 || x$27 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$27] = (enc.padChar << 24 >>> 24))); + (x$28 = di + 3 >> 0, ((x$28 < 0 || x$28 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$28] = (enc.padChar << 24 >>> 24))); + } + } + }; + Encoding.prototype.Encode = function(dst, src) { return this.$val.Encode(dst, src); }; + Encoding.ptr.prototype.EncodeToString = function(src) { + var $ptr, buf, enc, src; + enc = this; + buf = $makeSlice(sliceType, enc.EncodedLen(src.$length)); + enc.Encode(buf, src); + return $bytesToString(buf); + }; + Encoding.prototype.EncodeToString = function(src) { return this.$val.EncodeToString(src); }; + encoder.ptr.prototype.Write = function(p) { + var $ptr, _q, _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, e, err, i, i$1, n, nn, p, x, x$1, x$2, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; e = $f.e; err = $f.err; i = $f.i; i$1 = $f.i$1; n = $f.n; nn = $f.nn; p = $f.p; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + n = 0; + err = $ifaceNil; + e = this; + if (!($interfaceIsEqual(e.err, $ifaceNil))) { + _tmp = 0; + _tmp$1 = e.err; + n = _tmp; + err = _tmp$1; + return [n, err]; + } + /* */ if (e.nbuf > 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (e.nbuf > 0) { */ case 1: + i = 0; + i = 0; + while (true) { + if (!(i < p.$length && e.nbuf < 3)) { break; } + (x = e.buf, x$1 = e.nbuf, ((x$1 < 0 || x$1 >= x.length) ? $throwRuntimeError("index out of range") : x[x$1] = ((i < 0 || i >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i]))); + e.nbuf = e.nbuf + (1) >> 0; + i = i + (1) >> 0; + } + n = n + (i) >> 0; + p = $subslice(p, i); + if (e.nbuf < 3) { + return [n, err]; + } + e.enc.Encode(new sliceType(e.out), new sliceType(e.buf)); + _r = e.w.Write($subslice(new sliceType(e.out), 0, 4)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + e.err = _tuple[1]; + if (!($interfaceIsEqual(e.err, $ifaceNil))) { + _tmp$2 = n; + _tmp$3 = e.err; + n = _tmp$2; + err = _tmp$3; + return [n, err]; + } + e.nbuf = 0; + /* } */ case 2: + /* while (true) { */ case 4: + /* if (!(p.$length >= 3)) { break; } */ if(!(p.$length >= 3)) { $s = 5; continue; } + nn = 768; + if (nn > p.$length) { + nn = p.$length; + nn = nn - ((_r$1 = nn % 3, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero"))) >> 0; + } + e.enc.Encode(new sliceType(e.out), $subslice(p, 0, nn)); + _r$2 = e.w.Write($subslice(new sliceType(e.out), 0, ($imul((_q = nn / 3, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), 4)))); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _tuple$1 = _r$2; + e.err = _tuple$1[1]; + if (!($interfaceIsEqual(e.err, $ifaceNil))) { + _tmp$4 = n; + _tmp$5 = e.err; + n = _tmp$4; + err = _tmp$5; + return [n, err]; + } + n = n + (nn) >> 0; + p = $subslice(p, nn); + /* } */ $s = 4; continue; case 5: + i$1 = 0; + while (true) { + if (!(i$1 < p.$length)) { break; } + (x$2 = e.buf, ((i$1 < 0 || i$1 >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[i$1] = ((i$1 < 0 || i$1 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i$1]))); + i$1 = i$1 + (1) >> 0; + } + e.nbuf = p.$length; + n = n + (p.$length) >> 0; + return [n, err]; + /* */ } return; } if ($f === undefined) { $f = { $blk: encoder.ptr.prototype.Write }; } $f.$ptr = $ptr; $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.e = e; $f.err = err; $f.i = i; $f.i$1 = i$1; $f.n = n; $f.nn = nn; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; + }; + encoder.prototype.Write = function(p) { return this.$val.Write(p); }; + encoder.ptr.prototype.Close = function() { + var $ptr, _r, _tuple, e, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + e = this; + /* */ if ($interfaceIsEqual(e.err, $ifaceNil) && e.nbuf > 0) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ($interfaceIsEqual(e.err, $ifaceNil) && e.nbuf > 0) { */ case 1: + e.enc.Encode(new sliceType(e.out), $subslice(new sliceType(e.buf), 0, e.nbuf)); + _r = e.w.Write($subslice(new sliceType(e.out), 0, e.enc.EncodedLen(e.nbuf))); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + e.err = _tuple[1]; + e.nbuf = 0; + /* } */ case 2: + return e.err; + /* */ } return; } if ($f === undefined) { $f = { $blk: encoder.ptr.prototype.Close }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; + }; + encoder.prototype.Close = function() { return this.$val.Close(); }; + NewEncoder = function(enc, w) { + var $ptr, enc, w; + return new encoder.ptr($ifaceNil, enc, w, arrayType$2.zero(), 0, arrayType$3.zero()); + }; + $pkg.NewEncoder = NewEncoder; + Encoding.ptr.prototype.EncodedLen = function(n) { + var $ptr, _q, _q$1, enc, n; + enc = this; + if (enc.padChar === -1) { + return (_q = ((($imul(n, 8)) + 5 >> 0)) / 6, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + } + return $imul((_q$1 = ((n + 2 >> 0)) / 3, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), 4); + }; + Encoding.prototype.EncodedLen = function(n) { return this.$val.EncodedLen(n); }; + CorruptInputError.prototype.Error = function() { + var $ptr, e; + e = this; + return "illegal base64 data at input byte " + strconv.FormatInt(new $Int64(e.$high, e.$low), 10); + }; + $ptrType(CorruptInputError).prototype.Error = function() { return this.$get().Error(); }; + Encoding.ptr.prototype.decode = function(dst, src) { + var $ptr, _2, _3, _i, _ref, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, dbuf, dinc, dlen, dst, enc, end, err, in$1, j, n, si, src, val, x; + n = 0; + end = false; + err = $ifaceNil; + enc = this; + si = 0; + while (true) { + if (!(si < src.$length && ((((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 10) || (((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 13)))) { break; } + si = si + (1) >> 0; + } + while (true) { + if (!(si < src.$length && !end)) { break; } + dbuf = arrayType$4.zero(); + _tmp = 3; + _tmp$1 = 4; + dinc = _tmp; + dlen = _tmp$1; + _ref = dbuf; + _i = 0; + while (true) { + if (!(_i < 4)) { break; } + j = _i; + if (src.$length === si) { + if (!((enc.padChar === -1)) || j < 2) { + _tmp$2 = n; + _tmp$3 = false; + _tmp$4 = new CorruptInputError(0, (si - j >> 0)); + n = _tmp$2; + end = _tmp$3; + err = _tmp$4; + return [n, end, err]; + } + _tmp$5 = j - 1 >> 0; + _tmp$6 = j; + _tmp$7 = true; + dinc = _tmp$5; + dlen = _tmp$6; + end = _tmp$7; + break; + } + in$1 = ((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]); + si = si + (1) >> 0; + while (true) { + if (!(si < src.$length && ((((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 10) || (((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 13)))) { break; } + si = si + (1) >> 0; + } + if ((in$1 >> 0) === enc.padChar) { + _2 = j; + if ((_2 === (0)) || (_2 === (1))) { + _tmp$8 = n; + _tmp$9 = false; + _tmp$10 = new CorruptInputError(0, (si - 1 >> 0)); + n = _tmp$8; + end = _tmp$9; + err = _tmp$10; + return [n, end, err]; + } else if (_2 === (2)) { + if (si === src.$length) { + _tmp$11 = n; + _tmp$12 = false; + _tmp$13 = new CorruptInputError(0, src.$length); + n = _tmp$11; + end = _tmp$12; + err = _tmp$13; + return [n, end, err]; + } + if (!(((((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) >> 0) === enc.padChar))) { + _tmp$14 = n; + _tmp$15 = false; + _tmp$16 = new CorruptInputError(0, (si - 1 >> 0)); + n = _tmp$14; + end = _tmp$15; + err = _tmp$16; + return [n, end, err]; + } + si = si + (1) >> 0; + while (true) { + if (!(si < src.$length && ((((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 10) || (((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 13)))) { break; } + si = si + (1) >> 0; + } + } + if (si < src.$length) { + err = new CorruptInputError(0, si); + } + _tmp$17 = 3; + _tmp$18 = j; + _tmp$19 = true; + dinc = _tmp$17; + dlen = _tmp$18; + end = _tmp$19; + break; + } + ((j < 0 || j >= dbuf.length) ? $throwRuntimeError("index out of range") : dbuf[j] = (x = enc.decodeMap, ((in$1 < 0 || in$1 >= x.length) ? $throwRuntimeError("index out of range") : x[in$1]))); + if (((j < 0 || j >= dbuf.length) ? $throwRuntimeError("index out of range") : dbuf[j]) === 255) { + _tmp$20 = n; + _tmp$21 = false; + _tmp$22 = new CorruptInputError(0, (si - 1 >> 0)); + n = _tmp$20; + end = _tmp$21; + err = _tmp$22; + return [n, end, err]; + } + _i++; + } + val = (((((((dbuf[0] >>> 0) << 18 >>> 0) | ((dbuf[1] >>> 0) << 12 >>> 0)) >>> 0) | ((dbuf[2] >>> 0) << 6 >>> 0)) >>> 0) | (dbuf[3] >>> 0)) >>> 0; + _3 = dlen; + if (_3 === (4)) { + (2 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 2] = ((val >>> 0 >>> 0) << 24 >>> 24)); + (1 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 1] = ((val >>> 8 >>> 0) << 24 >>> 24)); + (0 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 0] = ((val >>> 16 >>> 0) << 24 >>> 24)); + } else if (_3 === (3)) { + (1 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 1] = ((val >>> 8 >>> 0) << 24 >>> 24)); + (0 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 0] = ((val >>> 16 >>> 0) << 24 >>> 24)); + } else if (_3 === (2)) { + (0 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 0] = ((val >>> 16 >>> 0) << 24 >>> 24)); + } + dst = $subslice(dst, dinc); + n = n + ((dlen - 1 >> 0)) >> 0; + } + _tmp$23 = n; + _tmp$24 = end; + _tmp$25 = err; + n = _tmp$23; + end = _tmp$24; + err = _tmp$25; + return [n, end, err]; + }; + Encoding.prototype.decode = function(dst, src) { return this.$val.decode(dst, src); }; + Encoding.ptr.prototype.Decode = function(dst, src) { + var $ptr, _tuple, dst, enc, err, n, src; + n = 0; + err = $ifaceNil; + enc = this; + _tuple = enc.decode(dst, src); + n = _tuple[0]; + err = _tuple[2]; + return [n, err]; + }; + Encoding.prototype.Decode = function(dst, src) { return this.$val.Decode(dst, src); }; + Encoding.ptr.prototype.DecodeString = function(s) { + var $ptr, _tuple, dbuf, enc, err, n, s; + enc = this; + dbuf = $makeSlice(sliceType, enc.DecodedLen(s.length)); + _tuple = enc.decode(dbuf, new sliceType($stringToBytes(s))); + n = _tuple[0]; + err = _tuple[2]; + return [$subslice(dbuf, 0, n), err]; + }; + Encoding.prototype.DecodeString = function(s) { return this.$val.DecodeString(s); }; + Encoding.ptr.prototype.DecodedLen = function(n) { + var $ptr, _q, _q$1, enc, n; + enc = this; + if (enc.padChar === -1) { + return (_q = ((($imul(n, 6)) + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + } + return $imul((_q$1 = n / 4, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), 3); + }; + Encoding.prototype.DecodedLen = function(n) { return this.$val.DecodedLen(n); }; + Encoding.methods = [{prop: "WithPadding", name: "WithPadding", pkg: "", typ: $funcType([$Int32], [ptrType], false)}]; + ptrType.methods = [{prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType, sliceType], [], false)}, {prop: "EncodeToString", name: "EncodeToString", pkg: "", typ: $funcType([sliceType], [$String], false)}, {prop: "EncodedLen", name: "EncodedLen", pkg: "", typ: $funcType([$Int], [$Int], false)}, {prop: "decode", name: "decode", pkg: "encoding/base64", typ: $funcType([sliceType, sliceType], [$Int, $Bool, $error], false)}, {prop: "Decode", name: "Decode", pkg: "", typ: $funcType([sliceType, sliceType], [$Int, $error], false)}, {prop: "DecodeString", name: "DecodeString", pkg: "", typ: $funcType([$String], [sliceType, $error], false)}, {prop: "DecodedLen", name: "DecodedLen", pkg: "", typ: $funcType([$Int], [$Int], false)}]; + ptrType$1.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; + CorruptInputError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + Encoding.init([{prop: "encode", name: "encode", pkg: "encoding/base64", typ: arrayType, tag: ""}, {prop: "decodeMap", name: "decodeMap", pkg: "encoding/base64", typ: arrayType$1, tag: ""}, {prop: "padChar", name: "padChar", pkg: "encoding/base64", typ: $Int32, tag: ""}]); + encoder.init([{prop: "err", name: "err", pkg: "encoding/base64", typ: $error, tag: ""}, {prop: "enc", name: "enc", pkg: "encoding/base64", typ: ptrType, tag: ""}, {prop: "w", name: "w", pkg: "encoding/base64", typ: io.Writer, tag: ""}, {prop: "buf", name: "buf", pkg: "encoding/base64", typ: arrayType$2, tag: ""}, {prop: "nbuf", name: "nbuf", pkg: "encoding/base64", typ: $Int, tag: ""}, {prop: "out", name: "out", pkg: "encoding/base64", typ: arrayType$3, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = io.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strconv.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.StdEncoding = NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"); + $pkg.URLEncoding = NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"); + $pkg.RawStdEncoding = $pkg.StdEncoding.WithPadding(-1); + $pkg.RawURLEncoding = $pkg.URLEncoding.WithPadding(-1); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["encoding"] = (function() { + var $pkg = {}, $init, TextMarshaler, sliceType; + TextMarshaler = $pkg.TextMarshaler = $newType(8, $kindInterface, "encoding.TextMarshaler", "TextMarshaler", "encoding", null); + sliceType = $sliceType($Uint8); + TextMarshaler.init([{prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType, $error], false)}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["sort"] = (function() { + var $pkg = {}, $init, StringSlice, sliceType$2, Search, SearchStrings, insertionSort, siftDown, heapSort, medianOfThree, doPivot, quickSort, Sort; + StringSlice = $pkg.StringSlice = $newType(12, $kindSlice, "sort.StringSlice", "StringSlice", "sort", null); + sliceType$2 = $sliceType($String); + Search = function(n, f) { + var $ptr, _q, _r, _tmp, _tmp$1, f, h, i, j, n, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; f = $f.f; h = $f.h; i = $f.i; j = $f.j; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _tmp = 0; + _tmp$1 = n; + i = _tmp; + j = _tmp$1; + /* while (true) { */ case 1: + /* if (!(i < j)) { break; } */ if(!(i < j)) { $s = 2; continue; } + h = i + (_q = ((j - i >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; + _r = f(h); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (!_r) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (!_r) { */ case 3: + i = h + 1 >> 0; + $s = 5; continue; + /* } else { */ case 4: + j = h; + /* } */ case 5: + /* } */ $s = 1; continue; case 2: + return i; + /* */ } return; } if ($f === undefined) { $f = { $blk: Search }; } $f.$ptr = $ptr; $f._q = _q; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.f = f; $f.h = h; $f.i = i; $f.j = j; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Search = Search; + SearchStrings = function(a, x) { + var $ptr, _r, a, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; a = $f.a; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + a = [a]; + x = [x]; + _r = Search(a[0].$length, (function(a, x) { return function(i) { + var $ptr, i; + return ((i < 0 || i >= a[0].$length) ? $throwRuntimeError("index out of range") : a[0].$array[a[0].$offset + i]) >= x[0]; + }; })(a, x)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: SearchStrings }; } $f.$ptr = $ptr; $f._r = _r; $f.a = a; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.SearchStrings = SearchStrings; + StringSlice.prototype.Search = function(x) { + var $ptr, _r, p, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; p = $f.p; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + _r = SearchStrings($subslice(new sliceType$2(p.$array), p.$offset, p.$offset + p.$length), x); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: StringSlice.prototype.Search }; } $f.$ptr = $ptr; $f._r = _r; $f.p = p; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + $ptrType(StringSlice).prototype.Search = function(x) { return this.$get().Search(x); }; + insertionSort = function(data, a, b) { + var $ptr, _r, _v, a, b, data, i, j, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _v = $f._v; a = $f.a; b = $f.b; data = $f.data; i = $f.i; j = $f.j; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + i = a + 1 >> 0; + /* while (true) { */ case 1: + /* if (!(i < b)) { break; } */ if(!(i < b)) { $s = 2; continue; } + j = i; + /* while (true) { */ case 3: + if (!(j > a)) { _v = false; $s = 5; continue s; } + _r = data.Less(j, j - 1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r; case 5: + /* if (!(_v)) { break; } */ if(!(_v)) { $s = 4; continue; } + $r = data.Swap(j, j - 1 >> 0); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + j = j - (1) >> 0; + /* } */ $s = 3; continue; case 4: + i = i + (1) >> 0; + /* } */ $s = 1; continue; case 2: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: insertionSort }; } $f.$ptr = $ptr; $f._r = _r; $f._v = _v; $f.a = a; $f.b = b; $f.data = data; $f.i = i; $f.j = j; $f.$s = $s; $f.$r = $r; return $f; + }; + siftDown = function(data, lo, hi, first) { + var $ptr, _r, _r$1, _v, child, data, first, hi, lo, root, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _v = $f._v; child = $f.child; data = $f.data; first = $f.first; hi = $f.hi; lo = $f.lo; root = $f.root; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + root = lo; + /* while (true) { */ case 1: + child = ($imul(2, root)) + 1 >> 0; + if (child >= hi) { + /* break; */ $s = 2; continue; + } + if (!((child + 1 >> 0) < hi)) { _v = false; $s = 5; continue s; } + _r = data.Less(first + child >> 0, (first + child >> 0) + 1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r; case 5: + /* */ if (_v) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (_v) { */ case 3: + child = child + (1) >> 0; + /* } */ case 4: + _r$1 = data.Less(first + root >> 0, first + child >> 0); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (!_r$1) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (!_r$1) { */ case 7: + return; + /* } */ case 8: + $r = data.Swap(first + root >> 0, first + child >> 0); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + root = child; + /* } */ $s = 1; continue; case 2: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: siftDown }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._v = _v; $f.child = child; $f.data = data; $f.first = first; $f.hi = hi; $f.lo = lo; $f.root = root; $f.$s = $s; $f.$r = $r; return $f; + }; + heapSort = function(data, a, b) { + var $ptr, _q, a, b, data, first, hi, i, i$1, lo, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; a = $f.a; b = $f.b; data = $f.data; first = $f.first; hi = $f.hi; i = $f.i; i$1 = $f.i$1; lo = $f.lo; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + first = a; + lo = 0; + hi = b - a >> 0; + i = (_q = ((hi - 1 >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); + /* while (true) { */ case 1: + /* if (!(i >= 0)) { break; } */ if(!(i >= 0)) { $s = 2; continue; } + $r = siftDown(data, i, hi, first); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + i = i - (1) >> 0; + /* } */ $s = 1; continue; case 2: + i$1 = hi - 1 >> 0; + /* while (true) { */ case 4: + /* if (!(i$1 >= 0)) { break; } */ if(!(i$1 >= 0)) { $s = 5; continue; } + $r = data.Swap(first, first + i$1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = siftDown(data, lo, i$1, first); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + i$1 = i$1 - (1) >> 0; + /* } */ $s = 4; continue; case 5: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: heapSort }; } $f.$ptr = $ptr; $f._q = _q; $f.a = a; $f.b = b; $f.data = data; $f.first = first; $f.hi = hi; $f.i = i; $f.i$1 = i$1; $f.lo = lo; $f.$s = $s; $f.$r = $r; return $f; + }; + medianOfThree = function(data, m1, m0, m2) { + var $ptr, _r, _r$1, _r$2, data, m0, m1, m2, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; data = $f.data; m0 = $f.m0; m1 = $f.m1; m2 = $f.m2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = data.Less(m1, m0); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ if (_r) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_r) { */ case 1: + $r = data.Swap(m1, m0); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + _r$1 = data.Less(m2, m1); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (_r$1) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (_r$1) { */ case 5: + $r = data.Swap(m2, m1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r$2 = data.Less(m1, m0); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ if (_r$2) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (_r$2) { */ case 9: + $r = data.Swap(m1, m0); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 10: + /* } */ case 6: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: medianOfThree }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.data = data; $f.m0 = m0; $f.m1 = m1; $f.m2 = m2; $f.$s = $s; $f.$r = $r; return $f; + }; + doPivot = function(data, lo, hi) { + var $ptr, _q, _q$1, _q$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tmp, _tmp$1, _tmp$2, _tmp$3, _v, _v$1, _v$2, _v$3, _v$4, a, b, c, data, dups, hi, lo, m, midhi, midlo, pivot, protect, s, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _q$1 = $f._q$1; _q$2 = $f._q$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; _v$4 = $f._v$4; a = $f.a; b = $f.b; c = $f.c; data = $f.data; dups = $f.dups; hi = $f.hi; lo = $f.lo; m = $f.m; midhi = $f.midhi; midlo = $f.midlo; pivot = $f.pivot; protect = $f.protect; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + midlo = 0; + midhi = 0; + m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; + /* */ if ((hi - lo >> 0) > 40) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ((hi - lo >> 0) > 40) { */ case 1: + s = (_q$1 = ((hi - lo >> 0)) / 8, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); + $r = medianOfThree(data, lo, lo + s >> 0, lo + ($imul(2, s)) >> 0); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = medianOfThree(data, m, m - s >> 0, m + s >> 0); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = medianOfThree(data, hi - 1 >> 0, (hi - 1 >> 0) - s >> 0, (hi - 1 >> 0) - ($imul(2, s)) >> 0); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 2: + $r = medianOfThree(data, lo, m, hi - 1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + pivot = lo; + _tmp = lo + 1 >> 0; + _tmp$1 = hi - 1 >> 0; + a = _tmp; + c = _tmp$1; + /* while (true) { */ case 7: + if (!(!((a === c)))) { _v = false; $s = 9; continue s; } + _r = data.Less(a, pivot); /* */ $s = 10; case 10: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _v = _r; case 9: + /* if (!(_v)) { break; } */ if(!(_v)) { $s = 8; continue; } + a = a + (1) >> 0; + /* } */ $s = 7; continue; case 8: + b = a; + /* while (true) { */ case 11: + /* while (true) { */ case 13: + if (!(!((b === c)))) { _v$1 = false; $s = 15; continue s; } + _r$1 = data.Less(pivot, b); /* */ $s = 16; case 16: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _v$1 = !_r$1; case 15: + /* if (!(_v$1)) { break; } */ if(!(_v$1)) { $s = 14; continue; } + b = b + (1) >> 0; + /* } */ $s = 13; continue; case 14: + /* while (true) { */ case 17: + if (!(!((b === c)))) { _v$2 = false; $s = 19; continue s; } + _r$2 = data.Less(pivot, c - 1 >> 0); /* */ $s = 20; case 20: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v$2 = _r$2; case 19: + /* if (!(_v$2)) { break; } */ if(!(_v$2)) { $s = 18; continue; } + c = c - (1) >> 0; + /* } */ $s = 17; continue; case 18: + if (b === c) { + /* break; */ $s = 12; continue; + } + $r = data.Swap(b, c - 1 >> 0); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + b = b + (1) >> 0; + c = c - (1) >> 0; + /* } */ $s = 11; continue; case 12: + protect = (hi - c >> 0) < 5; + /* */ if (!protect && (hi - c >> 0) < (_q$2 = ((hi - lo >> 0)) / 4, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero"))) { $s = 22; continue; } + /* */ $s = 23; continue; + /* if (!protect && (hi - c >> 0) < (_q$2 = ((hi - lo >> 0)) / 4, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero"))) { */ case 22: + dups = 0; + _r$3 = data.Less(pivot, hi - 1 >> 0); /* */ $s = 26; case 26: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (!_r$3) { $s = 24; continue; } + /* */ $s = 25; continue; + /* if (!_r$3) { */ case 24: + $r = data.Swap(c, hi - 1 >> 0); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + c = c + (1) >> 0; + dups = dups + (1) >> 0; + /* } */ case 25: + _r$4 = data.Less(b - 1 >> 0, pivot); /* */ $s = 30; case 30: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + /* */ if (!_r$4) { $s = 28; continue; } + /* */ $s = 29; continue; + /* if (!_r$4) { */ case 28: + b = b - (1) >> 0; + dups = dups + (1) >> 0; + /* } */ case 29: + _r$5 = data.Less(m, pivot); /* */ $s = 33; case 33: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + /* */ if (!_r$5) { $s = 31; continue; } + /* */ $s = 32; continue; + /* if (!_r$5) { */ case 31: + $r = data.Swap(m, b - 1 >> 0); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + b = b - (1) >> 0; + dups = dups + (1) >> 0; + /* } */ case 32: + protect = dups > 1; + /* } */ case 23: + /* */ if (protect) { $s = 35; continue; } + /* */ $s = 36; continue; + /* if (protect) { */ case 35: + /* while (true) { */ case 37: + /* while (true) { */ case 39: + if (!(!((a === b)))) { _v$3 = false; $s = 41; continue s; } + _r$6 = data.Less(b - 1 >> 0, pivot); /* */ $s = 42; case 42: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _v$3 = !_r$6; case 41: + /* if (!(_v$3)) { break; } */ if(!(_v$3)) { $s = 40; continue; } + b = b - (1) >> 0; + /* } */ $s = 39; continue; case 40: + /* while (true) { */ case 43: + if (!(!((a === b)))) { _v$4 = false; $s = 45; continue s; } + _r$7 = data.Less(a, pivot); /* */ $s = 46; case 46: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + _v$4 = _r$7; case 45: + /* if (!(_v$4)) { break; } */ if(!(_v$4)) { $s = 44; continue; } + a = a + (1) >> 0; + /* } */ $s = 43; continue; case 44: + if (a === b) { + /* break; */ $s = 38; continue; + } + $r = data.Swap(a, b - 1 >> 0); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + a = a + (1) >> 0; + b = b - (1) >> 0; + /* } */ $s = 37; continue; case 38: + /* } */ case 36: + $r = data.Swap(pivot, b - 1 >> 0); /* */ $s = 48; case 48: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _tmp$2 = b - 1 >> 0; + _tmp$3 = c; + midlo = _tmp$2; + midhi = _tmp$3; + return [midlo, midhi]; + /* */ } return; } if ($f === undefined) { $f = { $blk: doPivot }; } $f.$ptr = $ptr; $f._q = _q; $f._q$1 = _q$1; $f._q$2 = _q$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f._v$4 = _v$4; $f.a = a; $f.b = b; $f.c = c; $f.data = data; $f.dups = dups; $f.hi = hi; $f.lo = lo; $f.m = m; $f.midhi = midhi; $f.midlo = midlo; $f.pivot = pivot; $f.protect = protect; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; + }; + quickSort = function(data, a, b, maxDepth) { + var $ptr, _r, _r$1, _tuple, a, b, data, i, maxDepth, mhi, mlo, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; b = $f.b; data = $f.data; i = $f.i; maxDepth = $f.maxDepth; mhi = $f.mhi; mlo = $f.mlo; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* while (true) { */ case 1: + /* if (!((b - a >> 0) > 12)) { break; } */ if(!((b - a >> 0) > 12)) { $s = 2; continue; } + /* */ if (maxDepth === 0) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (maxDepth === 0) { */ case 3: + $r = heapSort(data, a, b); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return; + /* } */ case 4: + maxDepth = maxDepth - (1) >> 0; + _r = doPivot(data, a, b); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + mlo = _tuple[0]; + mhi = _tuple[1]; + /* */ if ((mlo - a >> 0) < (b - mhi >> 0)) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if ((mlo - a >> 0) < (b - mhi >> 0)) { */ case 7: + $r = quickSort(data, a, mlo, maxDepth); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + a = mhi; + $s = 9; continue; + /* } else { */ case 8: + $r = quickSort(data, mhi, b, maxDepth); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + b = mlo; + /* } */ case 9: + /* } */ $s = 1; continue; case 2: + /* */ if ((b - a >> 0) > 1) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if ((b - a >> 0) > 1) { */ case 12: + i = a + 6 >> 0; + /* while (true) { */ case 14: + /* if (!(i < b)) { break; } */ if(!(i < b)) { $s = 15; continue; } + _r$1 = data.Less(i, i - 6 >> 0); /* */ $s = 18; case 18: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ if (_r$1) { $s = 16; continue; } + /* */ $s = 17; continue; + /* if (_r$1) { */ case 16: + $r = data.Swap(i, i - 6 >> 0); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 17: + i = i + (1) >> 0; + /* } */ $s = 14; continue; case 15: + $r = insertionSort(data, a, b); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 13: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: quickSort }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.a = a; $f.b = b; $f.data = data; $f.i = i; $f.maxDepth = maxDepth; $f.mhi = mhi; $f.mlo = mlo; $f.$s = $s; $f.$r = $r; return $f; + }; + Sort = function(data) { + var $ptr, _r, data, i, maxDepth, n, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; data = $f.data; i = $f.i; maxDepth = $f.maxDepth; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = data.Len(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + n = _r; + maxDepth = 0; + i = n; + while (true) { + if (!(i > 0)) { break; } + maxDepth = maxDepth + (1) >> 0; + i = (i >> $min((1), 31)) >> 0; + } + maxDepth = $imul(maxDepth, (2)); + $r = quickSort(data, 0, n, maxDepth); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Sort }; } $f.$ptr = $ptr; $f._r = _r; $f.data = data; $f.i = i; $f.maxDepth = maxDepth; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Sort = Sort; + StringSlice.prototype.Len = function() { + var $ptr, p; + p = this; + return p.$length; + }; + $ptrType(StringSlice).prototype.Len = function() { return this.$get().Len(); }; + StringSlice.prototype.Less = function(i, j) { + var $ptr, i, j, p; + p = this; + return ((i < 0 || i >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i]) < ((j < 0 || j >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + j]); + }; + $ptrType(StringSlice).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; + StringSlice.prototype.Swap = function(i, j) { + var $ptr, _tmp, _tmp$1, i, j, p; + p = this; + _tmp = ((j < 0 || j >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + j]); + _tmp$1 = ((i < 0 || i >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i]); + ((i < 0 || i >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i] = _tmp); + ((j < 0 || j >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + j] = _tmp$1); + }; + $ptrType(StringSlice).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; + StringSlice.prototype.Sort = function() { + var $ptr, p, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + p = this; + $r = Sort(p); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: StringSlice.prototype.Sort }; } $f.$ptr = $ptr; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; + }; + $ptrType(StringSlice).prototype.Sort = function() { return this.$get().Sort(); }; + StringSlice.methods = [{prop: "Search", name: "Search", pkg: "", typ: $funcType([$String], [$Int], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Less", name: "Less", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "Sort", name: "Sort", pkg: "", typ: $funcType([], [], false)}]; + StringSlice.init($String); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["flag"] = (function() { + var $pkg = {}, $init, errors, fmt, io, os, sort, strconv, time, boolValue, boolFlag, intValue, int64Value, uintValue, uint64Value, stringValue, float64Value, durationValue, Value, ErrorHandling, FlagSet, Flag, sliceType, ptrType, ptrType$1, ptrType$2, ptrType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, sliceType$1, ptrType$10, ptrType$11, ptrType$12, ptrType$13, ptrType$14, ptrType$15, ptrType$16, sliceType$2, funcType, ptrType$17, funcType$1, mapType, x, newBoolValue, newIntValue, newInt64Value, newUintValue, newUint64Value, newStringValue, newFloat64Value, newDurationValue, sortFlags, isZeroValue, UnquoteUsage, PrintDefaults, defaultUsage, Bool, Int, Uint, String, Duration, NewFlagSet; + errors = $packages["errors"]; + fmt = $packages["fmt"]; + io = $packages["io"]; + os = $packages["os"]; + sort = $packages["sort"]; + strconv = $packages["strconv"]; + time = $packages["time"]; + boolValue = $pkg.boolValue = $newType(1, $kindBool, "flag.boolValue", "boolValue", "flag", null); + boolFlag = $pkg.boolFlag = $newType(8, $kindInterface, "flag.boolFlag", "boolFlag", "flag", null); + intValue = $pkg.intValue = $newType(4, $kindInt, "flag.intValue", "intValue", "flag", null); + int64Value = $pkg.int64Value = $newType(8, $kindInt64, "flag.int64Value", "int64Value", "flag", null); + uintValue = $pkg.uintValue = $newType(4, $kindUint, "flag.uintValue", "uintValue", "flag", null); + uint64Value = $pkg.uint64Value = $newType(8, $kindUint64, "flag.uint64Value", "uint64Value", "flag", null); + stringValue = $pkg.stringValue = $newType(8, $kindString, "flag.stringValue", "stringValue", "flag", null); + float64Value = $pkg.float64Value = $newType(8, $kindFloat64, "flag.float64Value", "float64Value", "flag", null); + durationValue = $pkg.durationValue = $newType(8, $kindInt64, "flag.durationValue", "durationValue", "flag", null); + Value = $pkg.Value = $newType(8, $kindInterface, "flag.Value", "Value", "flag", null); + ErrorHandling = $pkg.ErrorHandling = $newType(4, $kindInt, "flag.ErrorHandling", "ErrorHandling", "flag", null); + FlagSet = $pkg.FlagSet = $newType(0, $kindStruct, "flag.FlagSet", "FlagSet", "flag", function(Usage_, name_, parsed_, actual_, formal_, args_, errorHandling_, output_) { + this.$val = this; + if (arguments.length === 0) { + this.Usage = $throwNilPointerError; + this.name = ""; + this.parsed = false; + this.actual = false; + this.formal = false; + this.args = sliceType$2.nil; + this.errorHandling = 0; + this.output = $ifaceNil; + return; + } + this.Usage = Usage_; + this.name = name_; + this.parsed = parsed_; + this.actual = actual_; + this.formal = formal_; + this.args = args_; + this.errorHandling = errorHandling_; + this.output = output_; + }); + Flag = $pkg.Flag = $newType(0, $kindStruct, "flag.Flag", "Flag", "flag", function(Name_, Usage_, Value_, DefValue_) { + this.$val = this; + if (arguments.length === 0) { + this.Name = ""; + this.Usage = ""; + this.Value = $ifaceNil; + this.DefValue = ""; + return; + } + this.Name = Name_; + this.Usage = Usage_; + this.Value = Value_; + this.DefValue = DefValue_; + }); + sliceType = $sliceType($emptyInterface); + ptrType = $ptrType(boolValue); + ptrType$1 = $ptrType(intValue); + ptrType$2 = $ptrType(int64Value); + ptrType$3 = $ptrType(uintValue); + ptrType$4 = $ptrType(uint64Value); + ptrType$5 = $ptrType(stringValue); + ptrType$6 = $ptrType(float64Value); + ptrType$7 = $ptrType(durationValue); + ptrType$8 = $ptrType(time.Duration); + ptrType$9 = $ptrType(Flag); + sliceType$1 = $sliceType(ptrType$9); + ptrType$10 = $ptrType($Bool); + ptrType$11 = $ptrType($Int); + ptrType$12 = $ptrType($Int64); + ptrType$13 = $ptrType($Uint); + ptrType$14 = $ptrType($Uint64); + ptrType$15 = $ptrType($String); + ptrType$16 = $ptrType($Float64); + sliceType$2 = $sliceType($String); + funcType = $funcType([ptrType$9], [], false); + ptrType$17 = $ptrType(FlagSet); + funcType$1 = $funcType([], [], false); + mapType = $mapType($String, ptrType$9); + newBoolValue = function(val, p) { + var $ptr, _ptr, p, val; + p.$set(val); + return (_ptr = p, new ptrType(function() { return _ptr.$get(); }, function($v) { _ptr.$set($v); }, _ptr.$target)); + }; + $ptrType(boolValue).prototype.Set = function(s) { + var $ptr, _tuple, b, err, s, v; + b = this; + _tuple = strconv.ParseBool(s); + v = _tuple[0]; + err = _tuple[1]; + b.$set(v); + return err; + }; + $ptrType(boolValue).prototype.Get = function() { + var $ptr, b; + b = this; + return new $Bool(b.$get()); + }; + $ptrType(boolValue).prototype.String = function() { + var $ptr, _r, b, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; b = $f.b; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + b = this; + _r = fmt.Sprintf("%v", new sliceType([new boolValue(b.$get())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(boolValue).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.b = b; $f.$s = $s; $f.$r = $r; return $f; + }; + $ptrType(boolValue).prototype.IsBoolFlag = function() { + var $ptr, b; + b = this; + return true; + }; + newIntValue = function(val, p) { + var $ptr, _ptr, p, val; + p.$set(val); + return (_ptr = p, new ptrType$1(function() { return (_ptr.$get() >> 0); }, function($v) { _ptr.$set(($v >> 0)); }, _ptr.$target)); + }; + $ptrType(intValue).prototype.Set = function(s) { + var $ptr, _tuple, err, i, s, v; + i = this; + _tuple = strconv.ParseInt(s, 0, 64); + v = _tuple[0]; + err = _tuple[1]; + i.$set(((v.$low + ((v.$high >> 31) * 4294967296)) >> 0)); + return err; + }; + $ptrType(intValue).prototype.Get = function() { + var $ptr, i; + i = this; + return new $Int((i.$get() >> 0)); + }; + $ptrType(intValue).prototype.String = function() { + var $ptr, _r, i, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + i = this; + _r = fmt.Sprintf("%v", new sliceType([new intValue(i.$get())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(intValue).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; + }; + newInt64Value = function(val, p) { + var $ptr, _ptr, p, val, x$1; + p.$set(val); + return (_ptr = p, new ptrType$2(function() { return (x$1 = _ptr.$get(), new int64Value(x$1.$high, x$1.$low)); }, function($v) { _ptr.$set(new $Int64($v.$high, $v.$low)); }, _ptr.$target)); + }; + $ptrType(int64Value).prototype.Set = function(s) { + var $ptr, _tuple, err, i, s, v; + i = this; + _tuple = strconv.ParseInt(s, 0, 64); + v = _tuple[0]; + err = _tuple[1]; + i.$set(new int64Value(v.$high, v.$low)); + return err; + }; + $ptrType(int64Value).prototype.Get = function() { + var $ptr, i, x$1; + i = this; + return (x$1 = i.$get(), new $Int64(x$1.$high, x$1.$low)); + }; + $ptrType(int64Value).prototype.String = function() { + var $ptr, _r, i, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + i = this; + _r = fmt.Sprintf("%v", new sliceType([i.$get()])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(int64Value).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; + }; + newUintValue = function(val, p) { + var $ptr, _ptr, p, val; + p.$set(val); + return (_ptr = p, new ptrType$3(function() { return (_ptr.$get() >>> 0); }, function($v) { _ptr.$set(($v >>> 0)); }, _ptr.$target)); + }; + $ptrType(uintValue).prototype.Set = function(s) { + var $ptr, _tuple, err, i, s, v; + i = this; + _tuple = strconv.ParseUint(s, 0, 64); + v = _tuple[0]; + err = _tuple[1]; + i.$set((v.$low >>> 0)); + return err; + }; + $ptrType(uintValue).prototype.Get = function() { + var $ptr, i; + i = this; + return new $Uint((i.$get() >>> 0)); + }; + $ptrType(uintValue).prototype.String = function() { + var $ptr, _r, i, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + i = this; + _r = fmt.Sprintf("%v", new sliceType([new uintValue(i.$get())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(uintValue).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; + }; + newUint64Value = function(val, p) { + var $ptr, _ptr, p, val, x$1; + p.$set(val); + return (_ptr = p, new ptrType$4(function() { return (x$1 = _ptr.$get(), new uint64Value(x$1.$high, x$1.$low)); }, function($v) { _ptr.$set(new $Uint64($v.$high, $v.$low)); }, _ptr.$target)); + }; + $ptrType(uint64Value).prototype.Set = function(s) { + var $ptr, _tuple, err, i, s, v; + i = this; + _tuple = strconv.ParseUint(s, 0, 64); + v = _tuple[0]; + err = _tuple[1]; + i.$set(new uint64Value(v.$high, v.$low)); + return err; + }; + $ptrType(uint64Value).prototype.Get = function() { + var $ptr, i, x$1; + i = this; + return (x$1 = i.$get(), new $Uint64(x$1.$high, x$1.$low)); + }; + $ptrType(uint64Value).prototype.String = function() { + var $ptr, _r, i, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + i = this; + _r = fmt.Sprintf("%v", new sliceType([i.$get()])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(uint64Value).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; + }; + newStringValue = function(val, p) { + var $ptr, _ptr, p, val; + p.$set(val); + return (_ptr = p, new ptrType$5(function() { return _ptr.$get(); }, function($v) { _ptr.$set($v); }, _ptr.$target)); + }; + $ptrType(stringValue).prototype.Set = function(val) { + var $ptr, s, val; + s = this; + s.$set(val); + return $ifaceNil; + }; + $ptrType(stringValue).prototype.Get = function() { + var $ptr, s; + s = this; + return new $String(s.$get()); + }; + $ptrType(stringValue).prototype.String = function() { + var $ptr, _r, s, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + s = this; + _r = fmt.Sprintf("%s", new sliceType([new stringValue(s.$get())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(stringValue).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; + }; + newFloat64Value = function(val, p) { + var $ptr, _ptr, p, val; + p.$set(val); + return (_ptr = p, new ptrType$6(function() { return _ptr.$get(); }, function($v) { _ptr.$set($v); }, _ptr.$target)); + }; + $ptrType(float64Value).prototype.Set = function(s) { + var $ptr, _tuple, err, f, s, v; + f = this; + _tuple = strconv.ParseFloat(s, 64); + v = _tuple[0]; + err = _tuple[1]; + f.$set(v); + return err; + }; + $ptrType(float64Value).prototype.Get = function() { + var $ptr, f; + f = this; + return new $Float64(f.$get()); + }; + $ptrType(float64Value).prototype.String = function() { + var $ptr, _r, f, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + _r = fmt.Sprintf("%v", new sliceType([new float64Value(f.$get())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(float64Value).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; + }; + newDurationValue = function(val, p) { + var $ptr, _ptr, p, val, x$1; + p.$set(val); + return (_ptr = p, new ptrType$7(function() { return (x$1 = _ptr.$get(), new durationValue(x$1.$high, x$1.$low)); }, function($v) { _ptr.$set(new time.Duration($v.$high, $v.$low)); }, _ptr.$target)); + }; + $ptrType(durationValue).prototype.Set = function(s) { + var $ptr, _tuple, d, err, s, v; + d = this; + _tuple = time.ParseDuration(s); + v = _tuple[0]; + err = _tuple[1]; + d.$set(new durationValue(v.$high, v.$low)); + return err; + }; + $ptrType(durationValue).prototype.Get = function() { + var $ptr, d, x$1; + d = this; + return (x$1 = d.$get(), new time.Duration(x$1.$high, x$1.$low)); + }; + $ptrType(durationValue).prototype.String = function() { + var $ptr, _ptr, d, x$1; + d = this; + return (_ptr = d, new ptrType$8(function() { return (x$1 = _ptr.$get(), new time.Duration(x$1.$high, x$1.$low)); }, function($v) { _ptr.$set(new durationValue($v.$high, $v.$low)); }, _ptr.$target)).String(); + }; + sortFlags = function(flags) { + var $ptr, _entry, _entry$1, _i, _i$1, _keys, _ref, _ref$1, f, flags, i, i$1, list, name, result, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _i$1 = $f._i$1; _keys = $f._keys; _ref = $f._ref; _ref$1 = $f._ref$1; f = $f.f; flags = $f.flags; i = $f.i; i$1 = $f.i$1; list = $f.list; name = $f.name; result = $f.result; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + list = $makeSlice(sort.StringSlice, $keys(flags).length); + i = 0; + _ref = flags; + _i = 0; + _keys = $keys(_ref); + while (true) { + if (!(_i < _keys.length)) { break; } + _entry = _ref[_keys[_i]]; + if (_entry === undefined) { + _i++; + continue; + } + f = _entry.v; + ((i < 0 || i >= list.$length) ? $throwRuntimeError("index out of range") : list.$array[list.$offset + i] = f.Name); + i = i + (1) >> 0; + _i++; + } + $r = list.Sort(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + result = $makeSlice(sliceType$1, list.$length); + _ref$1 = list; + _i$1 = 0; + while (true) { + if (!(_i$1 < _ref$1.$length)) { break; } + i$1 = _i$1; + name = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); + ((i$1 < 0 || i$1 >= result.$length) ? $throwRuntimeError("index out of range") : result.$array[result.$offset + i$1] = (_entry$1 = flags[$String.keyFor(name)], _entry$1 !== undefined ? _entry$1.v : ptrType$9.nil)); + _i$1++; + } + return result; + /* */ } return; } if ($f === undefined) { $f = { $blk: sortFlags }; } $f.$ptr = $ptr; $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._i$1 = _i$1; $f._keys = _keys; $f._ref = _ref; $f._ref$1 = _ref$1; $f.f = f; $f.flags = flags; $f.i = i; $f.i$1 = i$1; $f.list = list; $f.name = name; $f.result = result; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.ptr.prototype.out = function() { + var $ptr, f; + f = this; + if ($interfaceIsEqual(f.output, $ifaceNil)) { + return os.Stderr; + } + return f.output; + }; + FlagSet.prototype.out = function() { return this.$val.out(); }; + FlagSet.ptr.prototype.SetOutput = function(output) { + var $ptr, f, output; + f = this; + f.output = output; + }; + FlagSet.prototype.SetOutput = function(output) { return this.$val.SetOutput(output); }; + FlagSet.ptr.prototype.VisitAll = function(fn) { + var $ptr, _i, _r, _ref, f, flag, fn, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _ref = $f._ref; f = $f.f; flag = $f.flag; fn = $f.fn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + _r = sortFlags(f.formal); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _ref = _r; + _i = 0; + /* while (true) { */ case 2: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } + flag = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + $r = fn(flag); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _i++; + /* } */ $s = 2; continue; case 3: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.VisitAll }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._ref = _ref; $f.f = f; $f.flag = flag; $f.fn = fn; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.VisitAll = function(fn) { return this.$val.VisitAll(fn); }; + FlagSet.ptr.prototype.Visit = function(fn) { + var $ptr, _i, _r, _ref, f, flag, fn, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _ref = $f._ref; f = $f.f; flag = $f.flag; fn = $f.fn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + _r = sortFlags(f.actual); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _ref = _r; + _i = 0; + /* while (true) { */ case 2: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } + flag = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + $r = fn(flag); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _i++; + /* } */ $s = 2; continue; case 3: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Visit }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._ref = _ref; $f.f = f; $f.flag = flag; $f.fn = fn; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Visit = function(fn) { return this.$val.Visit(fn); }; + FlagSet.ptr.prototype.Lookup = function(name) { + var $ptr, _entry, f, name; + f = this; + return (_entry = f.formal[$String.keyFor(name)], _entry !== undefined ? _entry.v : ptrType$9.nil); + }; + FlagSet.prototype.Lookup = function(name) { return this.$val.Lookup(name); }; + FlagSet.ptr.prototype.Set = function(name, value) { + var $ptr, _entry, _key, _r, _r$1, _tuple, err, f, flag, name, ok, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; f = $f.f; flag = $f.flag; name = $f.name; ok = $f.ok; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + _tuple = (_entry = f.formal[$String.keyFor(name)], _entry !== undefined ? [_entry.v, true] : [ptrType$9.nil, false]); + flag = _tuple[0]; + ok = _tuple[1]; + /* */ if (!ok) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!ok) { */ case 1: + _r = fmt.Errorf("no such flag -%v", new sliceType([new $String(name)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return _r; + /* } */ case 2: + _r$1 = flag.Value.Set(value); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + err = _r$1; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return err; + } + if (f.actual === false) { + f.actual = {}; + } + _key = name; (f.actual || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: flag }; + return $ifaceNil; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Set }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.flag = flag; $f.name = name; $f.ok = ok; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Set = function(name, value) { return this.$val.Set(name, value); }; + isZeroValue = function(value) { + var $ptr, _1, value; + _1 = value; + if (_1 === ("false")) { + return true; + } else if (_1 === ("")) { + return true; + } else if (_1 === ("0")) { + return true; + } + return false; + }; + UnquoteUsage = function(flag) { + var $ptr, _ref, _tmp, _tmp$1, flag, i, j, name, usage; + name = ""; + usage = ""; + usage = flag.Usage; + i = 0; + while (true) { + if (!(i < usage.length)) { break; } + if (usage.charCodeAt(i) === 96) { + j = i + 1 >> 0; + while (true) { + if (!(j < usage.length)) { break; } + if (usage.charCodeAt(j) === 96) { + name = usage.substring((i + 1 >> 0), j); + usage = usage.substring(0, i) + name + usage.substring((j + 1 >> 0)); + _tmp = name; + _tmp$1 = usage; + name = _tmp; + usage = _tmp$1; + return [name, usage]; + } + j = j + (1) >> 0; + } + break; + } + i = i + (1) >> 0; + } + name = "value"; + _ref = flag.Value; + if ($assertType(_ref, boolFlag, true)[1]) { + name = ""; + } else if ($assertType(_ref, ptrType$7, true)[1]) { + name = "duration"; + } else if ($assertType(_ref, ptrType$6, true)[1]) { + name = "float"; + } else if ($assertType(_ref, ptrType$1, true)[1] || $assertType(_ref, ptrType$2, true)[1]) { + name = "int"; + } else if ($assertType(_ref, ptrType$5, true)[1]) { + name = "string"; + } else if ($assertType(_ref, ptrType$3, true)[1] || $assertType(_ref, ptrType$4, true)[1]) { + name = "uint"; + } + return [name, usage]; + }; + $pkg.UnquoteUsage = UnquoteUsage; + FlagSet.ptr.prototype.PrintDefaults = function() { + var $ptr, f, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = [f]; + f[0] = this; + $r = f[0].VisitAll((function(f) { return function $b(flag) { + var $ptr, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, flag, name, ok, s, usage, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; flag = $f.flag; name = $f.name; ok = $f.ok; s = $f.s; usage = $f.usage; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = fmt.Sprintf(" -%s", new sliceType([new $String(flag.Name)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + s = _r; + _tuple = UnquoteUsage(flag); + name = _tuple[0]; + usage = _tuple[1]; + if (name.length > 0) { + s = s + (" " + name); + } + if (s.length <= 4) { + s = s + ("\t"); + } else { + s = s + ("\n \t"); + } + s = s + (usage); + /* */ if (!isZeroValue(flag.DefValue)) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (!isZeroValue(flag.DefValue)) { */ case 2: + _tuple$1 = $assertType(flag.Value, ptrType$5, true); + ok = _tuple$1[1]; + /* */ if (ok) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (ok) { */ case 4: + _r$1 = fmt.Sprintf(" (default %q)", new sliceType([new $String(flag.DefValue)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + s = s + (_r$1); + $s = 6; continue; + /* } else { */ case 5: + _r$2 = fmt.Sprintf(" (default %v)", new sliceType([new $String(flag.DefValue)])); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + s = s + (_r$2); + /* } */ case 6: + /* } */ case 3: + _r$3 = fmt.Fprint(f[0].out(), new sliceType([new $String(s), new $String("\n")])); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.flag = flag; $f.name = name; $f.ok = ok; $f.s = s; $f.usage = usage; $f.$s = $s; $f.$r = $r; return $f; + }; })(f)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.PrintDefaults }; } $f.$ptr = $ptr; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.PrintDefaults = function() { return this.$val.PrintDefaults(); }; + PrintDefaults = function() { + var $ptr, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = $pkg.CommandLine.PrintDefaults(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: PrintDefaults }; } $f.$ptr = $ptr; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.PrintDefaults = PrintDefaults; + defaultUsage = function(f) { + var $ptr, _r, _r$1, f, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ if (f.name === "") { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (f.name === "") { */ case 1: + _r = fmt.Fprintf(f.out(), "Usage:\n", new sliceType([])); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r; + $s = 3; continue; + /* } else { */ case 2: + _r$1 = fmt.Fprintf(f.out(), "Usage of %s:\n", new sliceType([new $String(f.name)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1; + /* } */ case 3: + $r = f.PrintDefaults(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: defaultUsage }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.ptr.prototype.NFlag = function() { + var $ptr, f; + f = this; + return $keys(f.actual).length; + }; + FlagSet.prototype.NFlag = function() { return this.$val.NFlag(); }; + FlagSet.ptr.prototype.Arg = function(i) { + var $ptr, f, i, x$1; + f = this; + if (i < 0 || i >= f.args.$length) { + return ""; + } + return (x$1 = f.args, ((i < 0 || i >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + i])); + }; + FlagSet.prototype.Arg = function(i) { return this.$val.Arg(i); }; + FlagSet.ptr.prototype.NArg = function() { + var $ptr, f; + f = this; + return f.args.$length; + }; + FlagSet.prototype.NArg = function() { return this.$val.NArg(); }; + FlagSet.ptr.prototype.Args = function() { + var $ptr, f; + f = this; + return f.args; + }; + FlagSet.prototype.Args = function() { return this.$val.Args(); }; + FlagSet.ptr.prototype.BoolVar = function(p, name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + $r = f.Var(newBoolValue(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.BoolVar }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.BoolVar = function(p, name, value, usage) { return this.$val.BoolVar(p, name, value, usage); }; + FlagSet.ptr.prototype.Bool = function(name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + p = $newDataPointer(false, ptrType$10); + $r = f.BoolVar(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return p; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Bool }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Bool = function(name, value, usage) { return this.$val.Bool(name, value, usage); }; + Bool = function(name, value, usage) { + var $ptr, _r, name, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = $pkg.CommandLine.Bool(name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: Bool }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Bool = Bool; + FlagSet.ptr.prototype.IntVar = function(p, name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + $r = f.Var(newIntValue(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.IntVar }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.IntVar = function(p, name, value, usage) { return this.$val.IntVar(p, name, value, usage); }; + FlagSet.ptr.prototype.Int = function(name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + p = $newDataPointer(0, ptrType$11); + $r = f.IntVar(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return p; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Int }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Int = function(name, value, usage) { return this.$val.Int(name, value, usage); }; + Int = function(name, value, usage) { + var $ptr, _r, name, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = $pkg.CommandLine.Int(name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: Int }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Int = Int; + FlagSet.ptr.prototype.Int64Var = function(p, name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + $r = f.Var(newInt64Value(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Int64Var }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Int64Var = function(p, name, value, usage) { return this.$val.Int64Var(p, name, value, usage); }; + FlagSet.ptr.prototype.Int64 = function(name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + p = $newDataPointer(new $Int64(0, 0), ptrType$12); + $r = f.Int64Var(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return p; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Int64 }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Int64 = function(name, value, usage) { return this.$val.Int64(name, value, usage); }; + FlagSet.ptr.prototype.UintVar = function(p, name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + $r = f.Var(newUintValue(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.UintVar }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.UintVar = function(p, name, value, usage) { return this.$val.UintVar(p, name, value, usage); }; + FlagSet.ptr.prototype.Uint = function(name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + p = $newDataPointer(0, ptrType$13); + $r = f.UintVar(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return p; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Uint }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Uint = function(name, value, usage) { return this.$val.Uint(name, value, usage); }; + Uint = function(name, value, usage) { + var $ptr, _r, name, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = $pkg.CommandLine.Uint(name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: Uint }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Uint = Uint; + FlagSet.ptr.prototype.Uint64Var = function(p, name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + $r = f.Var(newUint64Value(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Uint64Var }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Uint64Var = function(p, name, value, usage) { return this.$val.Uint64Var(p, name, value, usage); }; + FlagSet.ptr.prototype.Uint64 = function(name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + p = $newDataPointer(new $Uint64(0, 0), ptrType$14); + $r = f.Uint64Var(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return p; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Uint64 }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Uint64 = function(name, value, usage) { return this.$val.Uint64(name, value, usage); }; + FlagSet.ptr.prototype.StringVar = function(p, name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + $r = f.Var(newStringValue(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.StringVar }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.StringVar = function(p, name, value, usage) { return this.$val.StringVar(p, name, value, usage); }; + FlagSet.ptr.prototype.String = function(name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + p = $newDataPointer("", ptrType$15); + $r = f.StringVar(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return p; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.String }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.String = function(name, value, usage) { return this.$val.String(name, value, usage); }; + String = function(name, value, usage) { + var $ptr, _r, name, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = $pkg.CommandLine.String(name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: String }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.String = String; + FlagSet.ptr.prototype.Float64Var = function(p, name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + $r = f.Var(newFloat64Value(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Float64Var }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Float64Var = function(p, name, value, usage) { return this.$val.Float64Var(p, name, value, usage); }; + FlagSet.ptr.prototype.Float64 = function(name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + p = $newDataPointer(0, ptrType$16); + $r = f.Float64Var(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return p; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Float64 }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Float64 = function(name, value, usage) { return this.$val.Float64(name, value, usage); }; + FlagSet.ptr.prototype.DurationVar = function(p, name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + $r = f.Var(newDurationValue(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.DurationVar }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.DurationVar = function(p, name, value, usage) { return this.$val.DurationVar(p, name, value, usage); }; + FlagSet.ptr.prototype.Duration = function(name, value, usage) { + var $ptr, f, name, p, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + p = $newDataPointer(new time.Duration(0, 0), ptrType$8); + $r = f.DurationVar(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return p; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Duration }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Duration = function(name, value, usage) { return this.$val.Duration(name, value, usage); }; + Duration = function(name, value, usage) { + var $ptr, _r, name, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = $pkg.CommandLine.Duration(name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: Duration }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Duration = Duration; + FlagSet.ptr.prototype.Var = function(value, name, usage) { + var $ptr, _entry, _key, _r, _r$1, _r$2, _r$3, _tuple, alreadythere, f, flag, msg, name, usage, value, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; alreadythere = $f.alreadythere; f = $f.f; flag = $f.flag; msg = $f.msg; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + _r = value.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + flag = new Flag.ptr(name, usage, value, _r); + _tuple = (_entry = f.formal[$String.keyFor(name)], _entry !== undefined ? [_entry.v, true] : [ptrType$9.nil, false]); + alreadythere = _tuple[1]; + /* */ if (alreadythere) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (alreadythere) { */ case 2: + msg = ""; + /* */ if (f.name === "") { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (f.name === "") { */ case 4: + _r$1 = fmt.Sprintf("flag redefined: %s", new sliceType([new $String(name)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + msg = _r$1; + $s = 6; continue; + /* } else { */ case 5: + _r$2 = fmt.Sprintf("%s flag redefined: %s", new sliceType([new $String(f.name), new $String(name)])); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + msg = _r$2; + /* } */ case 6: + _r$3 = fmt.Fprintln(f.out(), new sliceType([new $String(msg)])); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + $panic(new $String(msg)); + /* } */ case 3: + if (f.formal === false) { + f.formal = {}; + } + _key = name; (f.formal || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: flag }; + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Var }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.alreadythere = alreadythere; $f.f = f; $f.flag = flag; $f.msg = msg; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Var = function(value, name, usage) { return this.$val.Var(value, name, usage); }; + FlagSet.ptr.prototype.failf = function(format, a) { + var $ptr, _r, _r$1, a, err, f, format, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; a = $f.a; err = $f.err; f = $f.f; format = $f.format; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + _r = fmt.Errorf(format, a); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + err = _r; + _r$1 = fmt.Fprintln(f.out(), new sliceType([err])); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _r$1; + $r = f.usage(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return err; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.failf }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.a = a; $f.err = err; $f.f = f; $f.format = format; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.failf = function(format, a) { return this.$val.failf(format, a); }; + FlagSet.ptr.prototype.usage = function() { + var $ptr, f, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + /* */ if (f.Usage === $throwNilPointerError) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (f.Usage === $throwNilPointerError) { */ case 1: + /* */ if (f === $pkg.CommandLine) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (f === $pkg.CommandLine) { */ case 4: + $r = $pkg.Usage(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 6; continue; + /* } else { */ case 5: + $r = defaultUsage(f); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 6: + $s = 3; continue; + /* } else { */ case 2: + $r = f.Usage(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 3: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.usage }; } $f.$ptr = $ptr; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.usage = function() { return this.$val.usage(); }; + FlagSet.ptr.prototype.parseOne = function() { + var $ptr, _entry, _key, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _tuple, _tuple$1, _v, alreadythere, err, err$1, err$2, f, flag, fv, hasValue, i, m, name, numMinuses, ok, s, value, x$1, x$2, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; alreadythere = $f.alreadythere; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; flag = $f.flag; fv = $f.fv; hasValue = $f.hasValue; i = $f.i; m = $f.m; name = $f.name; numMinuses = $f.numMinuses; ok = $f.ok; s = $f.s; value = $f.value; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + if (f.args.$length === 0) { + return [false, $ifaceNil]; + } + s = (x$1 = f.args, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])); + if ((s.length === 0) || !((s.charCodeAt(0) === 45)) || (s.length === 1)) { + return [false, $ifaceNil]; + } + numMinuses = 1; + if (s.charCodeAt(1) === 45) { + numMinuses = numMinuses + (1) >> 0; + if (s.length === 2) { + f.args = $subslice(f.args, 1); + return [false, $ifaceNil]; + } + } + name = s.substring(numMinuses); + /* */ if ((name.length === 0) || (name.charCodeAt(0) === 45) || (name.charCodeAt(0) === 61)) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ((name.length === 0) || (name.charCodeAt(0) === 45) || (name.charCodeAt(0) === 61)) { */ case 1: + _r = f.failf("bad flag syntax: %s", new sliceType([new $String(s)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 4; case 4: + return [false, _r]; + /* } */ case 2: + f.args = $subslice(f.args, 1); + hasValue = false; + value = ""; + i = 1; + while (true) { + if (!(i < name.length)) { break; } + if (name.charCodeAt(i) === 61) { + value = name.substring((i + 1 >> 0)); + hasValue = true; + name = name.substring(0, i); + break; + } + i = i + (1) >> 0; + } + m = f.formal; + _tuple = (_entry = m[$String.keyFor(name)], _entry !== undefined ? [_entry.v, true] : [ptrType$9.nil, false]); + flag = _tuple[0]; + alreadythere = _tuple[1]; + /* */ if (!alreadythere) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if (!alreadythere) { */ case 5: + /* */ if (name === "help" || name === "h") { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (name === "help" || name === "h") { */ case 7: + $r = f.usage(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return [false, $pkg.ErrHelp]; + /* } */ case 8: + _r$1 = f.failf("flag provided but not defined: -%s", new sliceType([new $String(name)])); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + /* */ $s = 11; case 11: + return [false, _r$1]; + /* } */ case 6: + _tuple$1 = $assertType(flag.Value, boolFlag, true); + fv = _tuple$1[0]; + ok = _tuple$1[1]; + if (!(ok)) { _v = false; $s = 15; continue s; } + _r$2 = fv.IsBoolFlag(); /* */ $s = 16; case 16: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _v = _r$2; case 15: + /* */ if (_v) { $s = 12; continue; } + /* */ $s = 13; continue; + /* if (_v) { */ case 12: + /* */ if (hasValue) { $s = 17; continue; } + /* */ $s = 18; continue; + /* if (hasValue) { */ case 17: + _r$3 = fv.Set(value); /* */ $s = 20; case 20: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + err = _r$3; + /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 21; continue; } + /* */ $s = 22; continue; + /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 21: + _r$4 = f.failf("invalid boolean value %q for -%s: %v", new sliceType([new $String(value), new $String(name), err])); /* */ $s = 23; case 23: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + /* */ $s = 24; case 24: + return [false, _r$4]; + /* } */ case 22: + $s = 19; continue; + /* } else { */ case 18: + _r$5 = fv.Set("true"); /* */ $s = 25; case 25: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + err$1 = _r$5; + /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 26; continue; } + /* */ $s = 27; continue; + /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 26: + _r$6 = f.failf("invalid boolean flag %s: %v", new sliceType([new $String(name), err$1])); /* */ $s = 28; case 28: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + /* */ $s = 29; case 29: + return [false, _r$6]; + /* } */ case 27: + /* } */ case 19: + $s = 14; continue; + /* } else { */ case 13: + if (!hasValue && f.args.$length > 0) { + hasValue = true; + _tmp = (x$2 = f.args, (0 >= x$2.$length ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + 0])); + _tmp$1 = $subslice(f.args, 1); + value = _tmp; + f.args = _tmp$1; + } + /* */ if (!hasValue) { $s = 30; continue; } + /* */ $s = 31; continue; + /* if (!hasValue) { */ case 30: + _r$7 = f.failf("flag needs an argument: -%s", new sliceType([new $String(name)])); /* */ $s = 32; case 32: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + /* */ $s = 33; case 33: + return [false, _r$7]; + /* } */ case 31: + _r$8 = flag.Value.Set(value); /* */ $s = 34; case 34: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + err$2 = _r$8; + /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 35; continue; } + /* */ $s = 36; continue; + /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 35: + _r$9 = f.failf("invalid value %q for flag -%s: %v", new sliceType([new $String(value), new $String(name), err$2])); /* */ $s = 37; case 37: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + /* */ $s = 38; case 38: + return [false, _r$9]; + /* } */ case 36: + /* } */ case 14: + if (f.actual === false) { + f.actual = {}; + } + _key = name; (f.actual || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: flag }; + return [true, $ifaceNil]; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.parseOne }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.alreadythere = alreadythere; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.flag = flag; $f.fv = fv; $f.hasValue = hasValue; $f.i = i; $f.m = m; $f.name = name; $f.numMinuses = numMinuses; $f.ok = ok; $f.s = s; $f.value = value; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.parseOne = function() { return this.$val.parseOne(); }; + FlagSet.ptr.prototype.Parse = function(arguments$1) { + var $ptr, _2, _r, _tuple, arguments$1, err, f, seen, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _2 = $f._2; _r = $f._r; _tuple = $f._tuple; arguments$1 = $f.arguments$1; err = $f.err; f = $f.f; seen = $f.seen; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = this; + f.parsed = true; + f.args = arguments$1; + /* while (true) { */ case 1: + _r = f.parseOne(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + seen = _tuple[0]; + err = _tuple[1]; + if (seen) { + /* continue; */ $s = 1; continue; + } + if ($interfaceIsEqual(err, $ifaceNil)) { + /* break; */ $s = 2; continue; + } + _2 = f.errorHandling; + if (_2 === (0)) { + return err; + } else if (_2 === (1)) { + os.Exit(2); + } else if (_2 === (2)) { + $panic(err); + } + /* } */ $s = 1; continue; case 2: + return $ifaceNil; + /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Parse }; } $f.$ptr = $ptr; $f._2 = _2; $f._r = _r; $f._tuple = _tuple; $f.arguments$1 = arguments$1; $f.err = err; $f.f = f; $f.seen = seen; $f.$s = $s; $f.$r = $r; return $f; + }; + FlagSet.prototype.Parse = function(arguments$1) { return this.$val.Parse(arguments$1); }; + FlagSet.ptr.prototype.Parsed = function() { + var $ptr, f; + f = this; + return f.parsed; + }; + FlagSet.prototype.Parsed = function() { return this.$val.Parsed(); }; + NewFlagSet = function(name, errorHandling) { + var $ptr, errorHandling, f, name; + f = new FlagSet.ptr($throwNilPointerError, name, false, false, false, sliceType$2.nil, errorHandling, $ifaceNil); + return f; + }; + $pkg.NewFlagSet = NewFlagSet; + FlagSet.ptr.prototype.Init = function(name, errorHandling) { + var $ptr, errorHandling, f, name; + f = this; + f.name = name; + f.errorHandling = errorHandling; + }; + FlagSet.prototype.Init = function(name, errorHandling) { return this.$val.Init(name, errorHandling); }; + ptrType.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsBoolFlag", name: "IsBoolFlag", pkg: "", typ: $funcType([], [$Bool], false)}]; + ptrType$1.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$2.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$3.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$4.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$5.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$6.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$7.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$17.methods = [{prop: "out", name: "out", pkg: "flag", typ: $funcType([], [io.Writer], false)}, {prop: "SetOutput", name: "SetOutput", pkg: "", typ: $funcType([io.Writer], [], false)}, {prop: "VisitAll", name: "VisitAll", pkg: "", typ: $funcType([funcType], [], false)}, {prop: "Visit", name: "Visit", pkg: "", typ: $funcType([funcType], [], false)}, {prop: "Lookup", name: "Lookup", pkg: "", typ: $funcType([$String], [ptrType$9], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String, $String], [$error], false)}, {prop: "PrintDefaults", name: "PrintDefaults", pkg: "", typ: $funcType([], [], false)}, {prop: "NFlag", name: "NFlag", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Arg", name: "Arg", pkg: "", typ: $funcType([$Int], [$String], false)}, {prop: "NArg", name: "NArg", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Args", name: "Args", pkg: "", typ: $funcType([], [sliceType$2], false)}, {prop: "BoolVar", name: "BoolVar", pkg: "", typ: $funcType([ptrType$10, $String, $Bool, $String], [], false)}, {prop: "Bool", name: "Bool", pkg: "", typ: $funcType([$String, $Bool, $String], [ptrType$10], false)}, {prop: "IntVar", name: "IntVar", pkg: "", typ: $funcType([ptrType$11, $String, $Int, $String], [], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([$String, $Int, $String], [ptrType$11], false)}, {prop: "Int64Var", name: "Int64Var", pkg: "", typ: $funcType([ptrType$12, $String, $Int64, $String], [], false)}, {prop: "Int64", name: "Int64", pkg: "", typ: $funcType([$String, $Int64, $String], [ptrType$12], false)}, {prop: "UintVar", name: "UintVar", pkg: "", typ: $funcType([ptrType$13, $String, $Uint, $String], [], false)}, {prop: "Uint", name: "Uint", pkg: "", typ: $funcType([$String, $Uint, $String], [ptrType$13], false)}, {prop: "Uint64Var", name: "Uint64Var", pkg: "", typ: $funcType([ptrType$14, $String, $Uint64, $String], [], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([$String, $Uint64, $String], [ptrType$14], false)}, {prop: "StringVar", name: "StringVar", pkg: "", typ: $funcType([ptrType$15, $String, $String, $String], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([$String, $String, $String], [ptrType$15], false)}, {prop: "Float64Var", name: "Float64Var", pkg: "", typ: $funcType([ptrType$16, $String, $Float64, $String], [], false)}, {prop: "Float64", name: "Float64", pkg: "", typ: $funcType([$String, $Float64, $String], [ptrType$16], false)}, {prop: "DurationVar", name: "DurationVar", pkg: "", typ: $funcType([ptrType$8, $String, time.Duration, $String], [], false)}, {prop: "Duration", name: "Duration", pkg: "", typ: $funcType([$String, time.Duration, $String], [ptrType$8], false)}, {prop: "Var", name: "Var", pkg: "", typ: $funcType([Value, $String, $String], [], false)}, {prop: "failf", name: "failf", pkg: "flag", typ: $funcType([$String, sliceType], [$error], true)}, {prop: "usage", name: "usage", pkg: "flag", typ: $funcType([], [], false)}, {prop: "parseOne", name: "parseOne", pkg: "flag", typ: $funcType([], [$Bool, $error], false)}, {prop: "Parse", name: "Parse", pkg: "", typ: $funcType([sliceType$2], [$error], false)}, {prop: "Parsed", name: "Parsed", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Init", name: "Init", pkg: "", typ: $funcType([$String, ErrorHandling], [], false)}]; + boolFlag.init([{prop: "IsBoolFlag", name: "IsBoolFlag", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); + Value.init([{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); + FlagSet.init([{prop: "Usage", name: "Usage", pkg: "", typ: funcType$1, tag: ""}, {prop: "name", name: "name", pkg: "flag", typ: $String, tag: ""}, {prop: "parsed", name: "parsed", pkg: "flag", typ: $Bool, tag: ""}, {prop: "actual", name: "actual", pkg: "flag", typ: mapType, tag: ""}, {prop: "formal", name: "formal", pkg: "flag", typ: mapType, tag: ""}, {prop: "args", name: "args", pkg: "flag", typ: sliceType$2, tag: ""}, {prop: "errorHandling", name: "errorHandling", pkg: "flag", typ: ErrorHandling, tag: ""}, {prop: "output", name: "output", pkg: "flag", typ: io.Writer, tag: ""}]); + Flag.init([{prop: "Name", name: "Name", pkg: "", typ: $String, tag: ""}, {prop: "Usage", name: "Usage", pkg: "", typ: $String, tag: ""}, {prop: "Value", name: "Value", pkg: "", typ: Value, tag: ""}, {prop: "DefValue", name: "DefValue", pkg: "", typ: $String, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = fmt.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = os.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sort.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strconv.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = time.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $pkg.ErrHelp = errors.New("flag: help requested"); + $pkg.CommandLine = NewFlagSet((x = os.Args, (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0])), 1); + $pkg.Usage = (function $b() { + var $ptr, _r, x$1, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r = fmt.Fprintf(os.Stderr, "Usage of %s:\n", new sliceType([new $String((x$1 = os.Args, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])))])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _r; + $r = PrintDefaults(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$ptr = $ptr; $f._r = _r; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; + }); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["runtime/debug"] = (function() { + var $pkg = {}, $init, os, runtime, sort, time; + os = $packages["os"]; + runtime = $packages["runtime"]; + sort = $packages["sort"]; + time = $packages["time"]; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = os.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sort.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = time.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["runtime/pprof"] = (function() { + var $pkg = {}, $init, io, sync; + io = $packages["io"]; + sync = $packages["sync"]; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = io.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sync.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["runtime/trace"] = (function() { + var $pkg = {}, $init, io, runtime; + io = $packages["io"]; + runtime = $packages["runtime"]; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = io.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["testing"] = (function() { + var $pkg = {}, $init, bytes, flag, fmt, nosync, io, os, runtime, debug, pprof, trace, strconv, strings, atomic, time, matchBenchmarks, benchTime, benchmarkMemory, short$1, outputDir, chatty, count, coverProfile, match, memProfile, memProfileRate, cpuProfile, blockProfile, blockProfileRate, traceFile, timeout, cpuListStr, parallel, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17; + bytes = $packages["bytes"]; + flag = $packages["flag"]; + fmt = $packages["fmt"]; + nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; + io = $packages["io"]; + os = $packages["os"]; + runtime = $packages["runtime"]; + debug = $packages["runtime/debug"]; + pprof = $packages["runtime/pprof"]; + trace = $packages["runtime/trace"]; + strconv = $packages["strconv"]; + strings = $packages["strings"]; + atomic = $packages["sync/atomic"]; + time = $packages["time"]; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = flag.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = fmt.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = nosync.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = os.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = debug.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = pprof.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = trace.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strconv.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strings.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = atomic.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = time.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _r = flag.String("test.bench", "", "regular expression to select benchmarks to run"); /* */ $s = 15; case 15: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + matchBenchmarks = _r; + _r$1 = flag.Duration("test.benchtime", new time.Duration(0, 1000000000), "approximate run time for each benchmark"); /* */ $s = 16; case 16: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + benchTime = _r$1; + _r$2 = flag.Bool("test.benchmem", false, "print memory allocations for benchmarks"); /* */ $s = 17; case 17: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + benchmarkMemory = _r$2; + _r$3 = flag.Bool("test.short", false, "run smaller test suite to save time"); /* */ $s = 18; case 18: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + short$1 = _r$3; + _r$4 = flag.String("test.outputdir", "", "directory in which to write profiles"); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + outputDir = _r$4; + _r$5 = flag.Bool("test.v", false, "verbose: print additional output"); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + chatty = _r$5; + _r$6 = flag.Uint("test.count", 1, "run tests and benchmarks `n` times"); /* */ $s = 21; case 21: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + count = _r$6; + _r$7 = flag.String("test.coverprofile", "", "write a coverage profile to the named file after execution"); /* */ $s = 22; case 22: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + coverProfile = _r$7; + _r$8 = flag.String("test.run", "", "regular expression to select tests and examples to run"); /* */ $s = 23; case 23: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + match = _r$8; + _r$9 = flag.String("test.memprofile", "", "write a memory profile to the named file after execution"); /* */ $s = 24; case 24: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + memProfile = _r$9; + _r$10 = flag.Int("test.memprofilerate", 0, "if >=0, sets runtime.MemProfileRate"); /* */ $s = 25; case 25: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } + memProfileRate = _r$10; + _r$11 = flag.String("test.cpuprofile", "", "write a cpu profile to the named file during execution"); /* */ $s = 26; case 26: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } + cpuProfile = _r$11; + _r$12 = flag.String("test.blockprofile", "", "write a goroutine blocking profile to the named file after execution"); /* */ $s = 27; case 27: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } + blockProfile = _r$12; + _r$13 = flag.Int("test.blockprofilerate", 1, "if >= 0, calls runtime.SetBlockProfileRate()"); /* */ $s = 28; case 28: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } + blockProfileRate = _r$13; + _r$14 = flag.String("test.trace", "", "write an execution trace to the named file after execution"); /* */ $s = 29; case 29: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } + traceFile = _r$14; + _r$15 = flag.Duration("test.timeout", new time.Duration(0, 0), "if positive, sets an aggregate time limit for all tests"); /* */ $s = 30; case 30: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } + timeout = _r$15; + _r$16 = flag.String("test.cpu", "", "comma-separated list of number of CPUs to use for each test"); /* */ $s = 31; case 31: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } + cpuListStr = _r$16; + _r$17 = flag.Int("test.parallel", runtime.GOMAXPROCS(0), "maximum test parallelism"); /* */ $s = 32; case 32: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } + parallel = _r$17; + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["unicode/utf16"] = (function() { + var $pkg = {}, $init; + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["encoding/json"] = (function() { + var $pkg = {}, $init, bytes, encoding, base64, errors, fmt, nosync, io, math, reflect, runtime, sort, strconv, strings, testing, unicode, utf16, utf8, Number, Marshaler, UnsupportedTypeError, UnsupportedValueError, MarshalerError, encodeState, encoderFunc, floatEncoder, structEncoder, mapEncoder, sliceEncoder, arrayEncoder, ptrEncoder, condAddrEncoder, stringValues, field, byName, byIndex, SyntaxError, scanner, tagOptions, sliceType, mapType, structType, sliceType$1, mapType$1, structType$1, sliceType$2, ptrType, ptrType$1, sliceType$3, ptrType$2, arrayType, arrayType$1, ptrType$4, sliceType$4, ptrType$8, ptrType$13, ptrType$14, ptrType$16, ptrType$17, ptrType$18, ptrType$19, ptrType$20, ptrType$21, ptrType$22, funcType, ptrType$23, funcType$1, errPhase, numberType, hex, encoderCache, marshalerType, textMarshalerType, float32Encoder, float64Encoder, fieldCache, _r, _r$1, isValidNumber, Marshal, isEmptyValue, valueEncoder, typeEncoder, newTypeEncoder, invalidValueEncoder, marshalerEncoder, addrMarshalerEncoder, textMarshalerEncoder, addrTextMarshalerEncoder, boolEncoder, intEncoder, uintEncoder, stringEncoder, interfaceEncoder, unsupportedTypeEncoder, newStructEncoder, newMapEncoder, encodeByteSlice, newSliceEncoder, newArrayEncoder, newPtrEncoder, newCondAddrEncoder, isValidTag, fieldByIndex, typeByIndex, fillField, typeFields, dominantField, cachedTypeFields, foldFunc, equalFoldRight, asciiEqualFold, simpleLetterEqualFold, compact, isSpace, stateBeginValueOrEmpty, stateBeginValue, stateBeginStringOrEmpty, stateBeginString, stateEndValue, stateEndTop, stateInString, stateInStringEsc, stateInStringEscU, stateInStringEscU1, stateInStringEscU12, stateInStringEscU123, stateNeg, state1, state0, stateDot, stateDot0, stateE, stateESign, stateE0, stateT, stateTr, stateTru, stateF, stateFa, stateFal, stateFals, stateN, stateNu, stateNul, stateError, quoteChar, parseTag; + bytes = $packages["bytes"]; + encoding = $packages["encoding"]; + base64 = $packages["encoding/base64"]; + errors = $packages["errors"]; + fmt = $packages["fmt"]; + nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; + io = $packages["io"]; + math = $packages["math"]; + reflect = $packages["reflect"]; + runtime = $packages["runtime"]; + sort = $packages["sort"]; + strconv = $packages["strconv"]; + strings = $packages["strings"]; + testing = $packages["testing"]; + unicode = $packages["unicode"]; + utf16 = $packages["unicode/utf16"]; + utf8 = $packages["unicode/utf8"]; + Number = $pkg.Number = $newType(8, $kindString, "json.Number", "Number", "encoding/json", null); + Marshaler = $pkg.Marshaler = $newType(8, $kindInterface, "json.Marshaler", "Marshaler", "encoding/json", null); + UnsupportedTypeError = $pkg.UnsupportedTypeError = $newType(0, $kindStruct, "json.UnsupportedTypeError", "UnsupportedTypeError", "encoding/json", function(Type_) { + this.$val = this; + if (arguments.length === 0) { + this.Type = $ifaceNil; + return; + } + this.Type = Type_; + }); + UnsupportedValueError = $pkg.UnsupportedValueError = $newType(0, $kindStruct, "json.UnsupportedValueError", "UnsupportedValueError", "encoding/json", function(Value_, Str_) { + this.$val = this; + if (arguments.length === 0) { + this.Value = new reflect.Value.ptr(ptrType$2.nil, 0, 0); + this.Str = ""; + return; + } + this.Value = Value_; + this.Str = Str_; + }); + MarshalerError = $pkg.MarshalerError = $newType(0, $kindStruct, "json.MarshalerError", "MarshalerError", "encoding/json", function(Type_, Err_) { + this.$val = this; + if (arguments.length === 0) { + this.Type = $ifaceNil; + this.Err = $ifaceNil; + return; + } + this.Type = Type_; + this.Err = Err_; + }); + encodeState = $pkg.encodeState = $newType(0, $kindStruct, "json.encodeState", "encodeState", "encoding/json", function(Buffer_, scratch_) { + this.$val = this; + if (arguments.length === 0) { + this.Buffer = new bytes.Buffer.ptr(sliceType$2.nil, 0, arrayType.zero(), arrayType$1.zero(), 0); + this.scratch = arrayType$1.zero(); + return; + } + this.Buffer = Buffer_; + this.scratch = scratch_; + }); + encoderFunc = $pkg.encoderFunc = $newType(4, $kindFunc, "json.encoderFunc", "encoderFunc", "encoding/json", null); + floatEncoder = $pkg.floatEncoder = $newType(4, $kindInt, "json.floatEncoder", "floatEncoder", "encoding/json", null); + structEncoder = $pkg.structEncoder = $newType(0, $kindStruct, "json.structEncoder", "structEncoder", "encoding/json", function(fields_, fieldEncs_) { + this.$val = this; + if (arguments.length === 0) { + this.fields = sliceType$1.nil; + this.fieldEncs = sliceType$4.nil; + return; + } + this.fields = fields_; + this.fieldEncs = fieldEncs_; + }); + mapEncoder = $pkg.mapEncoder = $newType(0, $kindStruct, "json.mapEncoder", "mapEncoder", "encoding/json", function(elemEnc_) { + this.$val = this; + if (arguments.length === 0) { + this.elemEnc = $throwNilPointerError; + return; + } + this.elemEnc = elemEnc_; + }); + sliceEncoder = $pkg.sliceEncoder = $newType(0, $kindStruct, "json.sliceEncoder", "sliceEncoder", "encoding/json", function(arrayEnc_) { + this.$val = this; + if (arguments.length === 0) { + this.arrayEnc = $throwNilPointerError; + return; + } + this.arrayEnc = arrayEnc_; + }); + arrayEncoder = $pkg.arrayEncoder = $newType(0, $kindStruct, "json.arrayEncoder", "arrayEncoder", "encoding/json", function(elemEnc_) { + this.$val = this; + if (arguments.length === 0) { + this.elemEnc = $throwNilPointerError; + return; + } + this.elemEnc = elemEnc_; + }); + ptrEncoder = $pkg.ptrEncoder = $newType(0, $kindStruct, "json.ptrEncoder", "ptrEncoder", "encoding/json", function(elemEnc_) { + this.$val = this; + if (arguments.length === 0) { + this.elemEnc = $throwNilPointerError; + return; + } + this.elemEnc = elemEnc_; + }); + condAddrEncoder = $pkg.condAddrEncoder = $newType(0, $kindStruct, "json.condAddrEncoder", "condAddrEncoder", "encoding/json", function(canAddrEnc_, elseEnc_) { + this.$val = this; + if (arguments.length === 0) { + this.canAddrEnc = $throwNilPointerError; + this.elseEnc = $throwNilPointerError; + return; + } + this.canAddrEnc = canAddrEnc_; + this.elseEnc = elseEnc_; + }); + stringValues = $pkg.stringValues = $newType(12, $kindSlice, "json.stringValues", "stringValues", "encoding/json", null); + field = $pkg.field = $newType(0, $kindStruct, "json.field", "field", "encoding/json", function(name_, nameBytes_, equalFold_, tag_, index_, typ_, omitEmpty_, quoted_) { + this.$val = this; + if (arguments.length === 0) { + this.name = ""; + this.nameBytes = sliceType$2.nil; + this.equalFold = $throwNilPointerError; + this.tag = false; + this.index = sliceType$3.nil; + this.typ = $ifaceNil; + this.omitEmpty = false; + this.quoted = false; + return; + } + this.name = name_; + this.nameBytes = nameBytes_; + this.equalFold = equalFold_; + this.tag = tag_; + this.index = index_; + this.typ = typ_; + this.omitEmpty = omitEmpty_; + this.quoted = quoted_; + }); + byName = $pkg.byName = $newType(12, $kindSlice, "json.byName", "byName", "encoding/json", null); + byIndex = $pkg.byIndex = $newType(12, $kindSlice, "json.byIndex", "byIndex", "encoding/json", null); + SyntaxError = $pkg.SyntaxError = $newType(0, $kindStruct, "json.SyntaxError", "SyntaxError", "encoding/json", function(msg_, Offset_) { + this.$val = this; + if (arguments.length === 0) { + this.msg = ""; + this.Offset = new $Int64(0, 0); + return; + } + this.msg = msg_; + this.Offset = Offset_; + }); + scanner = $pkg.scanner = $newType(0, $kindStruct, "json.scanner", "scanner", "encoding/json", function(step_, endTop_, parseState_, err_, redo_, redoCode_, redoState_, bytes_) { + this.$val = this; + if (arguments.length === 0) { + this.step = $throwNilPointerError; + this.endTop = false; + this.parseState = sliceType$3.nil; + this.err = $ifaceNil; + this.redo = false; + this.redoCode = 0; + this.redoState = $throwNilPointerError; + this.bytes = new $Int64(0, 0); + return; + } + this.step = step_; + this.endTop = endTop_; + this.parseState = parseState_; + this.err = err_; + this.redo = redo_; + this.redoCode = redoCode_; + this.redoState = redoState_; + this.bytes = bytes_; + }); + tagOptions = $pkg.tagOptions = $newType(8, $kindString, "json.tagOptions", "tagOptions", "encoding/json", null); + sliceType = $sliceType($emptyInterface); + mapType = $mapType(reflect.Type, encoderFunc); + structType = $structType([{prop: "RWMutex", name: "", pkg: "", typ: nosync.RWMutex, tag: ""}, {prop: "m", name: "m", pkg: "encoding/json", typ: mapType, tag: ""}]); + sliceType$1 = $sliceType(field); + mapType$1 = $mapType(reflect.Type, sliceType$1); + structType$1 = $structType([{prop: "RWMutex", name: "", pkg: "", typ: nosync.RWMutex, tag: ""}, {prop: "m", name: "m", pkg: "encoding/json", typ: mapType$1, tag: ""}]); + sliceType$2 = $sliceType($Uint8); + ptrType = $ptrType(Marshaler); + ptrType$1 = $ptrType(encoding.TextMarshaler); + sliceType$3 = $sliceType($Int); + ptrType$2 = $ptrType(reflect.rtype); + arrayType = $arrayType($Uint8, 4); + arrayType$1 = $arrayType($Uint8, 64); + ptrType$4 = $ptrType(encodeState); + sliceType$4 = $sliceType(encoderFunc); + ptrType$8 = $ptrType(SyntaxError); + ptrType$13 = $ptrType(UnsupportedTypeError); + ptrType$14 = $ptrType(UnsupportedValueError); + ptrType$16 = $ptrType(MarshalerError); + ptrType$17 = $ptrType(structEncoder); + ptrType$18 = $ptrType(mapEncoder); + ptrType$19 = $ptrType(sliceEncoder); + ptrType$20 = $ptrType(arrayEncoder); + ptrType$21 = $ptrType(ptrEncoder); + ptrType$22 = $ptrType(condAddrEncoder); + funcType = $funcType([sliceType$2, sliceType$2], [$Bool], false); + ptrType$23 = $ptrType(scanner); + funcType$1 = $funcType([ptrType$23, $Uint8], [$Int], false); + Number.prototype.String = function() { + var $ptr, n; + n = this.$val; + return n; + }; + $ptrType(Number).prototype.String = function() { return new Number(this.$get()).String(); }; + Number.prototype.Float64 = function() { + var $ptr, n; + n = this.$val; + return strconv.ParseFloat(n, 64); + }; + $ptrType(Number).prototype.Float64 = function() { return new Number(this.$get()).Float64(); }; + Number.prototype.Int64 = function() { + var $ptr, n; + n = this.$val; + return strconv.ParseInt(n, 10, 64); + }; + $ptrType(Number).prototype.Int64 = function() { return new Number(this.$get()).Int64(); }; + isValidNumber = function(s) { + var $ptr, s; + if (s === "") { + return false; + } + if (s.charCodeAt(0) === 45) { + s = s.substring(1); + if (s === "") { + return false; + } + } + if ((s.charCodeAt(0) === 48)) { + s = s.substring(1); + } else if (49 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57) { + s = s.substring(1); + while (true) { + if (!(s.length > 0 && 48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57)) { break; } + s = s.substring(1); + } + } else { + return false; + } + if (s.length >= 2 && (s.charCodeAt(0) === 46) && 48 <= s.charCodeAt(1) && s.charCodeAt(1) <= 57) { + s = s.substring(2); + while (true) { + if (!(s.length > 0 && 48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57)) { break; } + s = s.substring(1); + } + } + if (s.length >= 2 && ((s.charCodeAt(0) === 101) || (s.charCodeAt(0) === 69))) { + s = s.substring(1); + if ((s.charCodeAt(0) === 43) || (s.charCodeAt(0) === 45)) { + s = s.substring(1); + if (s === "") { + return false; + } + } + while (true) { + if (!(s.length > 0 && 48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57)) { break; } + s = s.substring(1); + } + } + return s === ""; + }; + Marshal = function(v) { + var $ptr, _r$2, e, err, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; e = $f.e; err = $f.err; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + e = new encodeState.ptr(new bytes.Buffer.ptr(sliceType$2.nil, 0, arrayType.zero(), arrayType$1.zero(), 0), arrayType$1.zero()); + _r$2 = e.marshal(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + err = _r$2; + if (!($interfaceIsEqual(err, $ifaceNil))) { + return [sliceType$2.nil, err]; + } + return [e.Buffer.Bytes(), $ifaceNil]; + /* */ } return; } if ($f === undefined) { $f = { $blk: Marshal }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.e = e; $f.err = err; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.Marshal = Marshal; + UnsupportedTypeError.ptr.prototype.Error = function() { + var $ptr, _r$2, e, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + e = this; + _r$2 = e.Type.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return "json: unsupported type: " + _r$2; + /* */ } return; } if ($f === undefined) { $f = { $blk: UnsupportedTypeError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; + }; + UnsupportedTypeError.prototype.Error = function() { return this.$val.Error(); }; + UnsupportedValueError.ptr.prototype.Error = function() { + var $ptr, e; + e = this; + return "json: unsupported value: " + e.Str; + }; + UnsupportedValueError.prototype.Error = function() { return this.$val.Error(); }; + MarshalerError.ptr.prototype.Error = function() { + var $ptr, _r$2, _r$3, e, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + e = this; + _r$2 = e.Type.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = e.Err.Error(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ $s = 3; case 3: + return "json: error calling MarshalJSON for type " + _r$2 + ": " + _r$3; + /* */ } return; } if ($f === undefined) { $f = { $blk: MarshalerError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; + }; + MarshalerError.prototype.Error = function() { return this.$val.Error(); }; + encodeState.ptr.prototype.marshal = function(v) { + var $ptr, _r$2, e, err, v, $s, $deferred, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; e = $f.e; err = $f.err; v = $f.v; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); + err = [err]; + err[0] = $ifaceNil; + e = this; + $deferred.push([(function(err) { return function() { + var $ptr, _tuple, _tuple$1, ok, ok$1, r, s; + r = $recover(); + if (!($interfaceIsEqual(r, $ifaceNil))) { + _tuple = $assertType(r, runtime.Error, true); + ok = _tuple[1]; + if (ok) { + $panic(r); + } + _tuple$1 = $assertType(r, $String, true); + s = _tuple$1[0]; + ok$1 = _tuple$1[1]; + if (ok$1) { + $panic(new $String(s)); + } + err[0] = $assertType(r, $error); + } + }; })(err), []]); + _r$2 = reflect.ValueOf(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $r = e.reflectValue(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + err[0] = $ifaceNil; + return err[0]; + /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return err[0]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: encodeState.ptr.prototype.marshal }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.e = e; $f.err = err; $f.v = v; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } + }; + encodeState.prototype.marshal = function(v) { return this.$val.marshal(v); }; + encodeState.ptr.prototype.error = function(err) { + var $ptr, e, err; + e = this; + $panic(err); + }; + encodeState.prototype.error = function(err) { return this.$val.error(err); }; + isEmptyValue = function(v) { + var $ptr, _1, v, x, x$1; + v = v; + _1 = v.Kind(); + if ((_1 === (17)) || (_1 === (21)) || (_1 === (23)) || (_1 === (24))) { + return v.Len() === 0; + } else if (_1 === (1)) { + return !v.Bool(); + } else if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { + return (x = v.Int(), (x.$high === 0 && x.$low === 0)); + } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { + return (x$1 = v.Uint(), (x$1.$high === 0 && x$1.$low === 0)); + } else if ((_1 === (13)) || (_1 === (14))) { + return v.Float() === 0; + } else if ((_1 === (20)) || (_1 === (22))) { + return v.IsNil(); + } + return false; + }; + encodeState.ptr.prototype.reflectValue = function(v) { + var $ptr, _r$2, e, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; e = $f.e; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + e = this; + _r$2 = valueEncoder(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $r = _r$2(e, v, false); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: encodeState.ptr.prototype.reflectValue }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.e = e; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + encodeState.prototype.reflectValue = function(v) { return this.$val.reflectValue(v); }; + valueEncoder = function(v) { + var $ptr, _r$2, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + if (!v.IsValid()) { + return invalidValueEncoder; + } + _r$2 = typeEncoder(v.Type()); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r$2; + /* */ } return; } if ($f === undefined) { $f = { $blk: valueEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + typeEncoder = function(t) { + var $ptr, _entry, _key, _key$1, _r$2, f, t, wg, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _key$1 = $f._key$1; _r$2 = $f._r$2; f = $f.f; t = $f.t; wg = $f.wg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + f = [f]; + wg = [wg]; + encoderCache.RWMutex.RLock(); + f[0] = (_entry = encoderCache.m[reflect.Type.keyFor(t)], _entry !== undefined ? _entry.v : $throwNilPointerError); + encoderCache.RWMutex.RUnlock(); + if (!(f[0] === $throwNilPointerError)) { + return f[0]; + } + encoderCache.RWMutex.Lock(); + if (encoderCache.m === false) { + encoderCache.m = {}; + } + wg[0] = new nosync.WaitGroup.ptr(0); + wg[0].Add(1); + _key = t; (encoderCache.m || $throwRuntimeError("assignment to entry in nil map"))[reflect.Type.keyFor(_key)] = { k: _key, v: (function(f, wg) { return function $b(e, v, quoted) { + var $ptr, e, quoted, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; e = $f.e; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + wg[0].Wait(); + $r = f[0](e, v, quoted); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$ptr = $ptr; $f.e = e; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; })(f, wg) }; + encoderCache.RWMutex.Unlock(); + _r$2 = newTypeEncoder(t, true); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + f[0] = _r$2; + wg[0].Done(); + encoderCache.RWMutex.Lock(); + _key$1 = t; (encoderCache.m || $throwRuntimeError("assignment to entry in nil map"))[reflect.Type.keyFor(_key$1)] = { k: _key$1, v: f[0] }; + encoderCache.RWMutex.Unlock(); + return f[0]; + /* */ } return; } if ($f === undefined) { $f = { $blk: typeEncoder }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._key$1 = _key$1; $f._r$2 = _r$2; $f.f = f; $f.t = t; $f.wg = wg; $f.$s = $s; $f.$r = $r; return $f; + }; + newTypeEncoder = function(t, allowAddr) { + var $ptr, _2, _arg, _arg$1, _arg$2, _arg$3, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, allowAddr, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _2 = $f._2; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; allowAddr = $f.allowAddr; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r$2 = t.Implements(marshalerType); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ if (_r$2) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_r$2) { */ case 1: + return marshalerEncoder; + /* } */ case 2: + _r$3 = t.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (!((_r$3 === 22)) && allowAddr) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (!((_r$3 === 22)) && allowAddr) { */ case 4: + _r$4 = reflect.PtrTo(t).Implements(marshalerType); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + /* */ if (_r$4) { $s = 7; continue; } + /* */ $s = 8; continue; + /* if (_r$4) { */ case 7: + _arg = addrMarshalerEncoder; + _r$5 = newTypeEncoder(t, false); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _arg$1 = _r$5; + _r$6 = newCondAddrEncoder(_arg, _arg$1); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + /* */ $s = 12; case 12: + return _r$6; + /* } */ case 8: + /* } */ case 5: + _r$7 = t.Implements(textMarshalerType); /* */ $s = 15; case 15: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + /* */ if (_r$7) { $s = 13; continue; } + /* */ $s = 14; continue; + /* if (_r$7) { */ case 13: + return textMarshalerEncoder; + /* } */ case 14: + _r$8 = t.Kind(); /* */ $s = 18; case 18: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + /* */ if (!((_r$8 === 22)) && allowAddr) { $s = 16; continue; } + /* */ $s = 17; continue; + /* if (!((_r$8 === 22)) && allowAddr) { */ case 16: + _r$9 = reflect.PtrTo(t).Implements(textMarshalerType); /* */ $s = 21; case 21: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + /* */ if (_r$9) { $s = 19; continue; } + /* */ $s = 20; continue; + /* if (_r$9) { */ case 19: + _arg$2 = addrTextMarshalerEncoder; + _r$10 = newTypeEncoder(t, false); /* */ $s = 22; case 22: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } + _arg$3 = _r$10; + _r$11 = newCondAddrEncoder(_arg$2, _arg$3); /* */ $s = 23; case 23: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } + /* */ $s = 24; case 24: + return _r$11; + /* } */ case 20: + /* } */ case 17: + _r$12 = t.Kind(); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } + _2 = _r$12; + /* */ if (_2 === (1)) { $s = 27; continue; } + /* */ if ((_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6))) { $s = 28; continue; } + /* */ if ((_2 === (7)) || (_2 === (8)) || (_2 === (9)) || (_2 === (10)) || (_2 === (11)) || (_2 === (12))) { $s = 29; continue; } + /* */ if (_2 === (13)) { $s = 30; continue; } + /* */ if (_2 === (14)) { $s = 31; continue; } + /* */ if (_2 === (24)) { $s = 32; continue; } + /* */ if (_2 === (20)) { $s = 33; continue; } + /* */ if (_2 === (25)) { $s = 34; continue; } + /* */ if (_2 === (21)) { $s = 35; continue; } + /* */ if (_2 === (23)) { $s = 36; continue; } + /* */ if (_2 === (17)) { $s = 37; continue; } + /* */ if (_2 === (22)) { $s = 38; continue; } + /* */ $s = 39; continue; + /* if (_2 === (1)) { */ case 27: + return boolEncoder; + /* } else if ((_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6))) { */ case 28: + return intEncoder; + /* } else if ((_2 === (7)) || (_2 === (8)) || (_2 === (9)) || (_2 === (10)) || (_2 === (11)) || (_2 === (12))) { */ case 29: + return uintEncoder; + /* } else if (_2 === (13)) { */ case 30: + return float32Encoder; + /* } else if (_2 === (14)) { */ case 31: + return float64Encoder; + /* } else if (_2 === (24)) { */ case 32: + return stringEncoder; + /* } else if (_2 === (20)) { */ case 33: + return interfaceEncoder; + /* } else if (_2 === (25)) { */ case 34: + _r$13 = newStructEncoder(t); /* */ $s = 41; case 41: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } + /* */ $s = 42; case 42: + return _r$13; + /* } else if (_2 === (21)) { */ case 35: + _r$14 = newMapEncoder(t); /* */ $s = 43; case 43: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } + /* */ $s = 44; case 44: + return _r$14; + /* } else if (_2 === (23)) { */ case 36: + _r$15 = newSliceEncoder(t); /* */ $s = 45; case 45: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } + /* */ $s = 46; case 46: + return _r$15; + /* } else if (_2 === (17)) { */ case 37: + _r$16 = newArrayEncoder(t); /* */ $s = 47; case 47: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } + /* */ $s = 48; case 48: + return _r$16; + /* } else if (_2 === (22)) { */ case 38: + _r$17 = newPtrEncoder(t); /* */ $s = 49; case 49: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } + /* */ $s = 50; case 50: + return _r$17; + /* } else { */ case 39: + return unsupportedTypeEncoder; + /* } */ case 40: + case 25: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: newTypeEncoder }; } $f.$ptr = $ptr; $f._2 = _2; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f.allowAddr = allowAddr; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + invalidValueEncoder = function(e, v, quoted) { + var $ptr, e, quoted, v; + v = v; + e.Buffer.WriteString("null"); + }; + marshalerEncoder = function(e, v, quoted) { + var $ptr, _r$2, _r$3, _r$4, _tuple, b, e, err, m, quoted, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + if ((v.Kind() === 22) && v.IsNil()) { + e.Buffer.WriteString("null"); + return; + } + _r$2 = v.Interface(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + m = $assertType(_r$2, Marshaler); + _r$3 = m.MarshalJSON(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + b = _tuple[0]; + err = _tuple[1]; + /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 3: + _r$4 = compact(e.Buffer, b, true); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + err = _r$4; + /* } */ case 4: + if (!($interfaceIsEqual(err, $ifaceNil))) { + e.error(new MarshalerError.ptr(v.Type(), err)); + } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: marshalerEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + addrMarshalerEncoder = function(e, v, quoted) { + var $ptr, _r$2, _r$3, _r$4, _tuple, b, e, err, m, quoted, v, va, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; quoted = $f.quoted; v = $f.v; va = $f.va; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + va = v.Addr(); + if (va.IsNil()) { + e.Buffer.WriteString("null"); + return; + } + _r$2 = va.Interface(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + m = $assertType(_r$2, Marshaler); + _r$3 = m.MarshalJSON(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + b = _tuple[0]; + err = _tuple[1]; + /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 3: + _r$4 = compact(e.Buffer, b, true); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + err = _r$4; + /* } */ case 4: + if (!($interfaceIsEqual(err, $ifaceNil))) { + e.error(new MarshalerError.ptr(v.Type(), err)); + } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: addrMarshalerEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.quoted = quoted; $f.v = v; $f.va = va; $f.$s = $s; $f.$r = $r; return $f; + }; + textMarshalerEncoder = function(e, v, quoted) { + var $ptr, _r$2, _r$3, _tuple, b, e, err, m, quoted, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + if ((v.Kind() === 22) && v.IsNil()) { + e.Buffer.WriteString("null"); + return; + } + _r$2 = v.Interface(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + m = $assertType(_r$2, encoding.TextMarshaler); + _r$3 = m.MarshalText(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + b = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + e.error(new MarshalerError.ptr(v.Type(), err)); + } + e.stringBytes(b); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: textMarshalerEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + addrTextMarshalerEncoder = function(e, v, quoted) { + var $ptr, _r$2, _r$3, _tuple, b, e, err, m, quoted, v, va, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; quoted = $f.quoted; v = $f.v; va = $f.va; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + va = v.Addr(); + if (va.IsNil()) { + e.Buffer.WriteString("null"); + return; + } + _r$2 = va.Interface(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + m = $assertType(_r$2, encoding.TextMarshaler); + _r$3 = m.MarshalText(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _tuple = _r$3; + b = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + e.error(new MarshalerError.ptr(v.Type(), err)); + } + e.stringBytes(b); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: addrTextMarshalerEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.quoted = quoted; $f.v = v; $f.va = va; $f.$s = $s; $f.$r = $r; return $f; + }; + boolEncoder = function(e, v, quoted) { + var $ptr, e, quoted, v; + v = v; + if (quoted) { + e.Buffer.WriteByte(34); + } + if (v.Bool()) { + e.Buffer.WriteString("true"); + } else { + e.Buffer.WriteString("false"); + } + if (quoted) { + e.Buffer.WriteByte(34); + } + }; + intEncoder = function(e, v, quoted) { + var $ptr, b, e, quoted, v; + v = v; + b = strconv.AppendInt($subslice(new sliceType$2(e.scratch), 0, 0), v.Int(), 10); + if (quoted) { + e.Buffer.WriteByte(34); + } + e.Buffer.Write(b); + if (quoted) { + e.Buffer.WriteByte(34); + } + }; + uintEncoder = function(e, v, quoted) { + var $ptr, b, e, quoted, v; + v = v; + b = strconv.AppendUint($subslice(new sliceType$2(e.scratch), 0, 0), v.Uint(), 10); + if (quoted) { + e.Buffer.WriteByte(34); + } + e.Buffer.Write(b); + if (quoted) { + e.Buffer.WriteByte(34); + } + }; + floatEncoder.prototype.encode = function(e, v, quoted) { + var $ptr, b, bits, e, f, quoted, v; + v = v; + bits = this.$val; + f = v.Float(); + if (math.IsInf(f, 0) || math.IsNaN(f)) { + e.error(new UnsupportedValueError.ptr($clone(v, reflect.Value), strconv.FormatFloat(f, 103, -1, (bits >> 0)))); + } + b = strconv.AppendFloat($subslice(new sliceType$2(e.scratch), 0, 0), f, 103, -1, (bits >> 0)); + if (quoted) { + e.Buffer.WriteByte(34); + } + e.Buffer.Write(b); + if (quoted) { + e.Buffer.WriteByte(34); + } + }; + $ptrType(floatEncoder).prototype.encode = function(e, v, quoted) { return new floatEncoder(this.$get()).encode(e, v, quoted); }; + stringEncoder = function(e, v, quoted) { + var $ptr, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, e, err, numStr, quoted, sb, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _tuple = $f._tuple; e = $f.e; err = $f.err; numStr = $f.numStr; quoted = $f.quoted; sb = $f.sb; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + /* */ if ($interfaceIsEqual(v.Type(), numberType)) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if ($interfaceIsEqual(v.Type(), numberType)) { */ case 1: + _r$2 = v.String(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + numStr = _r$2; + if (numStr === "") { + numStr = "0"; + } + /* */ if (!isValidNumber(numStr)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (!isValidNumber(numStr)) { */ case 4: + _r$3 = fmt.Errorf("json: invalid number literal %q", new sliceType([new $String(numStr)])); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + $r = e.error(_r$3); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 5: + e.Buffer.WriteString(numStr); + return; + /* } */ case 2: + /* */ if (quoted) { $s = 8; continue; } + /* */ $s = 9; continue; + /* if (quoted) { */ case 8: + _r$4 = v.String(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$5 = Marshal(new $String(_r$4)); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _tuple = _r$5; + sb = _tuple[0]; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + e.error(err); + } + e.string($bytesToString(sb)); + $s = 10; continue; + /* } else { */ case 9: + _r$6 = v.String(); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + _r$7 = e.string(_r$6); /* */ $s = 14; case 14: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + _r$7; + /* } */ case 10: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: stringEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._tuple = _tuple; $f.e = e; $f.err = err; $f.numStr = numStr; $f.quoted = quoted; $f.sb = sb; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + interfaceEncoder = function(e, v, quoted) { + var $ptr, _r$2, e, quoted, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; e = $f.e; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + if (v.IsNil()) { + e.Buffer.WriteString("null"); + return; + } + _r$2 = v.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + $r = e.reflectValue(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: interfaceEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.e = e; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + unsupportedTypeEncoder = function(e, v, quoted) { + var $ptr, e, quoted, v; + v = v; + e.error(new UnsupportedTypeError.ptr(v.Type())); + }; + structEncoder.ptr.prototype.encode = function(e, v, quoted) { + var $ptr, _i, _r$2, _ref, e, f, first, fv, i, quoted, se, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r$2 = $f._r$2; _ref = $f._ref; e = $f.e; f = $f.f; first = $f.first; fv = $f.fv; i = $f.i; quoted = $f.quoted; se = $f.se; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + se = this; + e.Buffer.WriteByte(123); + first = true; + _ref = se.fields; + _i = 0; + /* while (true) { */ case 1: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } + i = _i; + f = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), field); + _r$2 = fieldByIndex(v, f.index); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + fv = _r$2; + /* */ if (!fv.IsValid() || f.omitEmpty && isEmptyValue(fv)) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (!fv.IsValid() || f.omitEmpty && isEmptyValue(fv)) { */ case 4: + _i++; + /* continue; */ $s = 1; continue; + /* } */ case 5: + if (first) { + first = false; + } else { + e.Buffer.WriteByte(44); + } + e.string(f.name); + e.Buffer.WriteByte(58); + $r = (x = se.fieldEncs, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]))(e, fv, f.quoted); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _i++; + /* } */ $s = 1; continue; case 2: + e.Buffer.WriteByte(125); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: structEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f._i = _i; $f._r$2 = _r$2; $f._ref = _ref; $f.e = e; $f.f = f; $f.first = first; $f.fv = fv; $f.i = i; $f.quoted = quoted; $f.se = se; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + structEncoder.prototype.encode = function(e, v, quoted) { return this.$val.encode(e, v, quoted); }; + newStructEncoder = function(t) { + var $ptr, _i, _r$2, _r$3, _r$4, _ref, f, fields, i, se, t, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; f = $f.f; fields = $f.fields; i = $f.i; se = $f.se; t = $f.t; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r$2 = cachedTypeFields(t); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + fields = _r$2; + se = new structEncoder.ptr(fields, $makeSlice(sliceType$4, fields.$length)); + _ref = fields; + _i = 0; + /* while (true) { */ case 2: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } + i = _i; + f = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), field); + _r$3 = typeByIndex(t, f.index); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$4 = typeEncoder(_r$3); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + (x = se.fieldEncs, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i] = _r$4)); + _i++; + /* } */ $s = 2; continue; case 3: + return $methodVal(se, "encode"); + /* */ } return; } if ($f === undefined) { $f = { $blk: newStructEncoder }; } $f.$ptr = $ptr; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f.f = f; $f.fields = fields; $f.i = i; $f.se = se; $f.t = t; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + mapEncoder.ptr.prototype.encode = function(e, v, param) { + var $ptr, _arg, _arg$1, _i, _r$2, _r$3, _r$4, _r$5, _ref, e, i, k, me, param, sv, v, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _ref = $f._ref; e = $f.e; i = $f.i; k = $f.k; me = $f.me; param = $f.param; sv = $f.sv; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + me = this; + if (v.IsNil()) { + e.Buffer.WriteString("null"); + return; + } + e.Buffer.WriteByte(123); + _r$2 = v.MapKeys(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + sv = (x = _r$2, $subslice(new stringValues(x.$array), x.$offset, x.$offset + x.$length)); + $r = sort.Sort(sv); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _ref = sv; + _i = 0; + /* while (true) { */ case 3: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } + i = _i; + k = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (i > 0) { + e.Buffer.WriteByte(44); + } + _r$3 = k.String(); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$4 = e.string(_r$3); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$4; + e.Buffer.WriteByte(58); + _arg = e; + _r$5 = v.MapIndex(k); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _arg$1 = _r$5; + $r = me.elemEnc(_arg, _arg$1, false); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + _i++; + /* } */ $s = 3; continue; case 4: + e.Buffer.WriteByte(125); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: mapEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._ref = _ref; $f.e = e; $f.i = i; $f.k = k; $f.me = me; $f.param = param; $f.sv = sv; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + mapEncoder.prototype.encode = function(e, v, param) { return this.$val.encode(e, v, param); }; + newMapEncoder = function(t) { + var $ptr, _r$2, _r$3, _r$4, _r$5, me, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; me = $f.me; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r$2 = t.Key(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = _r$2.Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (!((_r$3 === 24))) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (!((_r$3 === 24))) { */ case 1: + return unsupportedTypeEncoder; + /* } */ case 2: + _r$4 = t.Elem(); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$5 = typeEncoder(_r$4); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + me = new mapEncoder.ptr(_r$5); + return $methodVal(me, "encode"); + /* */ } return; } if ($f === undefined) { $f = { $blk: newMapEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.me = me; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + encodeByteSlice = function(e, v, param) { + var $ptr, _r$2, _r$3, _r$4, dst, e, enc, param, s, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; dst = $f.dst; e = $f.e; enc = $f.enc; param = $f.param; s = $f.s; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + if (v.IsNil()) { + e.Buffer.WriteString("null"); + return; + } + _r$2 = v.Bytes(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + s = _r$2; + e.Buffer.WriteByte(34); + /* */ if (s.$length < 1024) { $s = 2; continue; } + /* */ $s = 3; continue; + /* if (s.$length < 1024) { */ case 2: + dst = $makeSlice(sliceType$2, base64.StdEncoding.EncodedLen(s.$length)); + base64.StdEncoding.Encode(dst, s); + e.Buffer.Write(dst); + $s = 4; continue; + /* } else { */ case 3: + enc = base64.NewEncoder(base64.StdEncoding, e); + _r$3 = enc.Write(s); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + _r$3; + _r$4 = enc.Close(); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + _r$4; + /* } */ case 4: + e.Buffer.WriteByte(34); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: encodeByteSlice }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.dst = dst; $f.e = e; $f.enc = enc; $f.param = param; $f.s = s; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + sliceEncoder.ptr.prototype.encode = function(e, v, param) { + var $ptr, e, param, se, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; e = $f.e; param = $f.param; se = $f.se; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + se = this; + if (v.IsNil()) { + e.Buffer.WriteString("null"); + return; + } + $r = se.arrayEnc(e, v, false); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: sliceEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f.e = e; $f.param = param; $f.se = se; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + sliceEncoder.prototype.encode = function(e, v, param) { return this.$val.encode(e, v, param); }; + newSliceEncoder = function(t) { + var $ptr, _r$2, _r$3, _r$4, enc, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; enc = $f.enc; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r$2 = t.Elem(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = _r$2.Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (_r$3 === 8) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (_r$3 === 8) { */ case 1: + return encodeByteSlice; + /* } */ case 2: + _r$4 = newArrayEncoder(t); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + enc = new sliceEncoder.ptr(_r$4); + return $methodVal(enc, "encode"); + /* */ } return; } if ($f === undefined) { $f = { $blk: newSliceEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.enc = enc; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + arrayEncoder.ptr.prototype.encode = function(e, v, param) { + var $ptr, _arg, _arg$1, _r$2, ae, e, i, n, param, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _r$2 = $f._r$2; ae = $f.ae; e = $f.e; i = $f.i; n = $f.n; param = $f.param; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + ae = this; + e.Buffer.WriteByte(91); + n = v.Len(); + i = 0; + /* while (true) { */ case 1: + /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } + if (i > 0) { + e.Buffer.WriteByte(44); + } + _arg = e; + _r$2 = v.Index(i); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _arg$1 = _r$2; + $r = ae.elemEnc(_arg, _arg$1, false); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + i = i + (1) >> 0; + /* } */ $s = 1; continue; case 2: + e.Buffer.WriteByte(93); + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: arrayEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$2 = _r$2; $f.ae = ae; $f.e = e; $f.i = i; $f.n = n; $f.param = param; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + arrayEncoder.prototype.encode = function(e, v, param) { return this.$val.encode(e, v, param); }; + newArrayEncoder = function(t) { + var $ptr, _r$2, _r$3, enc, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; enc = $f.enc; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r$2 = t.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = typeEncoder(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + enc = new arrayEncoder.ptr(_r$3); + return $methodVal(enc, "encode"); + /* */ } return; } if ($f === undefined) { $f = { $blk: newArrayEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.enc = enc; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + ptrEncoder.ptr.prototype.encode = function(e, v, quoted) { + var $ptr, _arg, _arg$1, _arg$2, _r$2, e, pe, quoted, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r$2 = $f._r$2; e = $f.e; pe = $f.pe; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + pe = this; + if (v.IsNil()) { + e.Buffer.WriteString("null"); + return; + } + _arg = e; + _r$2 = v.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _arg$1 = _r$2; + _arg$2 = quoted; + $r = pe.elemEnc(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: ptrEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r$2 = _r$2; $f.e = e; $f.pe = pe; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + ptrEncoder.prototype.encode = function(e, v, quoted) { return this.$val.encode(e, v, quoted); }; + newPtrEncoder = function(t) { + var $ptr, _r$2, _r$3, enc, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; enc = $f.enc; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _r$2 = t.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = typeEncoder(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + enc = new ptrEncoder.ptr(_r$3); + return $methodVal(enc, "encode"); + /* */ } return; } if ($f === undefined) { $f = { $blk: newPtrEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.enc = enc; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + condAddrEncoder.ptr.prototype.encode = function(e, v, quoted) { + var $ptr, ce, e, quoted, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; ce = $f.ce; e = $f.e; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + ce = this; + /* */ if (v.CanAddr()) { $s = 1; continue; } + /* */ $s = 2; continue; + /* if (v.CanAddr()) { */ case 1: + $r = ce.canAddrEnc(e, v, quoted); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $s = 3; continue; + /* } else { */ case 2: + $r = ce.elseEnc(e, v, quoted); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* } */ case 3: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: condAddrEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f.ce = ce; $f.e = e; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + condAddrEncoder.prototype.encode = function(e, v, quoted) { return this.$val.encode(e, v, quoted); }; + newCondAddrEncoder = function(canAddrEnc, elseEnc) { + var $ptr, canAddrEnc, elseEnc, enc; + enc = new condAddrEncoder.ptr(canAddrEnc, elseEnc); + return $methodVal(enc, "encode"); + }; + isValidTag = function(s) { + var $ptr, _i, _ref, _rune, c, s; + if (s === "") { + return false; + } + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.length)) { break; } + _rune = $decodeRune(_ref, _i); + c = _rune[0]; + if (strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~ ", c)) { + } else if (!unicode.IsLetter(c) && !unicode.IsDigit(c)) { + return false; + } + _i += _rune[1]; + } + return true; + }; + fieldByIndex = function(v, index) { + var $ptr, _i, _r$2, _r$3, _ref, i, index, v, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; i = $f.i; index = $f.index; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + v = v; + _ref = index; + _i = 0; + /* while (true) { */ case 1: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } + i = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + /* */ if (v.Kind() === 22) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (v.Kind() === 22) { */ case 3: + if (v.IsNil()) { + return new reflect.Value.ptr(ptrType$2.nil, 0, 0); + } + _r$2 = v.Elem(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + v = _r$2; + /* } */ case 4: + _r$3 = v.Field(i); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + v = _r$3; + _i++; + /* } */ $s = 1; continue; case 2: + return v; + /* */ } return; } if ($f === undefined) { $f = { $blk: fieldByIndex }; } $f.$ptr = $ptr; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f.i = i; $f.index = index; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; + }; + typeByIndex = function(t, index) { + var $ptr, _i, _r$2, _r$3, _r$4, _ref, i, index, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; i = $f.i; index = $f.index; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + _ref = index; + _i = 0; + /* while (true) { */ case 1: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } + i = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + _r$2 = t.Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ if (_r$2 === 22) { $s = 3; continue; } + /* */ $s = 4; continue; + /* if (_r$2 === 22) { */ case 3: + _r$3 = t.Elem(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + t = _r$3; + /* } */ case 4: + _r$4 = t.Field(i); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + t = _r$4.Type; + _i++; + /* } */ $s = 1; continue; case 2: + return t; + /* */ } return; } if ($f === undefined) { $f = { $blk: typeByIndex }; } $f.$ptr = $ptr; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f.i = i; $f.index = index; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + stringValues.prototype.Len = function() { + var $ptr, sv; + sv = this; + return sv.$length; + }; + $ptrType(stringValues).prototype.Len = function() { return this.$get().Len(); }; + stringValues.prototype.Swap = function(i, j) { + var $ptr, _tmp, _tmp$1, i, j, sv; + sv = this; + _tmp = ((j < 0 || j >= sv.$length) ? $throwRuntimeError("index out of range") : sv.$array[sv.$offset + j]); + _tmp$1 = ((i < 0 || i >= sv.$length) ? $throwRuntimeError("index out of range") : sv.$array[sv.$offset + i]); + ((i < 0 || i >= sv.$length) ? $throwRuntimeError("index out of range") : sv.$array[sv.$offset + i] = _tmp); + ((j < 0 || j >= sv.$length) ? $throwRuntimeError("index out of range") : sv.$array[sv.$offset + j] = _tmp$1); + }; + $ptrType(stringValues).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; + stringValues.prototype.Less = function(i, j) { + var $ptr, _r$2, _r$3, i, j, sv, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; i = $f.i; j = $f.j; sv = $f.sv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + sv = this; + _r$2 = sv.get(i); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$3 = sv.get(j); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ $s = 3; case 3: + return _r$2 < _r$3; + /* */ } return; } if ($f === undefined) { $f = { $blk: stringValues.prototype.Less }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.i = i; $f.j = j; $f.sv = sv; $f.$s = $s; $f.$r = $r; return $f; + }; + $ptrType(stringValues).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; + stringValues.prototype.get = function(i) { + var $ptr, _r$2, i, sv, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; i = $f.i; sv = $f.sv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + sv = this; + _r$2 = ((i < 0 || i >= sv.$length) ? $throwRuntimeError("index out of range") : sv.$array[sv.$offset + i]).String(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r$2; + /* */ } return; } if ($f === undefined) { $f = { $blk: stringValues.prototype.get }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.i = i; $f.sv = sv; $f.$s = $s; $f.$r = $r; return $f; + }; + $ptrType(stringValues).prototype.get = function(i) { return this.$get().get(i); }; + encodeState.ptr.prototype.string = function(s) { + var $ptr, _3, _tuple, b, c, e, i, len0, s, size, start; + e = this; + len0 = e.Buffer.Len(); + e.Buffer.WriteByte(34); + start = 0; + i = 0; + while (true) { + if (!(i < s.length)) { break; } + b = s.charCodeAt(i); + if (b < 128) { + if (32 <= b && !((b === 92)) && !((b === 34)) && !((b === 60)) && !((b === 62)) && !((b === 38))) { + i = i + (1) >> 0; + continue; + } + if (start < i) { + e.Buffer.WriteString(s.substring(start, i)); + } + _3 = b; + if ((_3 === (92)) || (_3 === (34))) { + e.Buffer.WriteByte(92); + e.Buffer.WriteByte(b); + } else if (_3 === (10)) { + e.Buffer.WriteByte(92); + e.Buffer.WriteByte(110); + } else if (_3 === (13)) { + e.Buffer.WriteByte(92); + e.Buffer.WriteByte(114); + } else if (_3 === (9)) { + e.Buffer.WriteByte(92); + e.Buffer.WriteByte(116); + } else { + e.Buffer.WriteString("\\u00"); + e.Buffer.WriteByte(hex.charCodeAt((b >>> 4 << 24 >>> 24))); + e.Buffer.WriteByte(hex.charCodeAt(((b & 15) >>> 0))); + } + i = i + (1) >> 0; + start = i; + continue; + } + _tuple = utf8.DecodeRuneInString(s.substring(i)); + c = _tuple[0]; + size = _tuple[1]; + if ((c === 65533) && (size === 1)) { + if (start < i) { + e.Buffer.WriteString(s.substring(start, i)); + } + e.Buffer.WriteString("\\ufffd"); + i = i + (size) >> 0; + start = i; + continue; + } + if ((c === 8232) || (c === 8233)) { + if (start < i) { + e.Buffer.WriteString(s.substring(start, i)); + } + e.Buffer.WriteString("\\u202"); + e.Buffer.WriteByte(hex.charCodeAt((c & 15))); + i = i + (size) >> 0; + start = i; + continue; + } + i = i + (size) >> 0; + } + if (start < s.length) { + e.Buffer.WriteString(s.substring(start)); + } + e.Buffer.WriteByte(34); + return e.Buffer.Len() - len0 >> 0; + }; + encodeState.prototype.string = function(s) { return this.$val.string(s); }; + encodeState.ptr.prototype.stringBytes = function(s) { + var $ptr, _4, _tuple, b, c, e, i, len0, s, size, start; + e = this; + len0 = e.Buffer.Len(); + e.Buffer.WriteByte(34); + start = 0; + i = 0; + while (true) { + if (!(i < s.$length)) { break; } + b = ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i]); + if (b < 128) { + if (32 <= b && !((b === 92)) && !((b === 34)) && !((b === 60)) && !((b === 62)) && !((b === 38))) { + i = i + (1) >> 0; + continue; + } + if (start < i) { + e.Buffer.Write($subslice(s, start, i)); + } + _4 = b; + if ((_4 === (92)) || (_4 === (34))) { + e.Buffer.WriteByte(92); + e.Buffer.WriteByte(b); + } else if (_4 === (10)) { + e.Buffer.WriteByte(92); + e.Buffer.WriteByte(110); + } else if (_4 === (13)) { + e.Buffer.WriteByte(92); + e.Buffer.WriteByte(114); + } else if (_4 === (9)) { + e.Buffer.WriteByte(92); + e.Buffer.WriteByte(116); + } else { + e.Buffer.WriteString("\\u00"); + e.Buffer.WriteByte(hex.charCodeAt((b >>> 4 << 24 >>> 24))); + e.Buffer.WriteByte(hex.charCodeAt(((b & 15) >>> 0))); + } + i = i + (1) >> 0; + start = i; + continue; + } + _tuple = utf8.DecodeRune($subslice(s, i)); + c = _tuple[0]; + size = _tuple[1]; + if ((c === 65533) && (size === 1)) { + if (start < i) { + e.Buffer.Write($subslice(s, start, i)); + } + e.Buffer.WriteString("\\ufffd"); + i = i + (size) >> 0; + start = i; + continue; + } + if ((c === 8232) || (c === 8233)) { + if (start < i) { + e.Buffer.Write($subslice(s, start, i)); + } + e.Buffer.WriteString("\\u202"); + e.Buffer.WriteByte(hex.charCodeAt((c & 15))); + i = i + (size) >> 0; + start = i; + continue; + } + i = i + (size) >> 0; + } + if (start < s.$length) { + e.Buffer.Write($subslice(s, start)); + } + e.Buffer.WriteByte(34); + return e.Buffer.Len() - len0 >> 0; + }; + encodeState.prototype.stringBytes = function(s) { return this.$val.stringBytes(s); }; + fillField = function(f) { + var $ptr, f; + f = $clone(f, field); + f.nameBytes = new sliceType$2($stringToBytes(f.name)); + f.equalFold = foldFunc(f.nameBytes); + return f; + }; + byName.prototype.Len = function() { + var $ptr, x; + x = this; + return x.$length; + }; + $ptrType(byName).prototype.Len = function() { return this.$get().Len(); }; + byName.prototype.Swap = function(i, j) { + var $ptr, _tmp, _tmp$1, i, j, x; + x = this; + _tmp = $clone(((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]), field); + _tmp$1 = $clone(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), field); + field.copy(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), _tmp); + field.copy(((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]), _tmp$1); + }; + $ptrType(byName).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; + byName.prototype.Less = function(i, j) { + var $ptr, i, j, x; + x = this; + if (!(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).name === ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).name)) { + return ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).name < ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).name; + } + if (!((((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).index.$length === ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index.$length))) { + return ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).index.$length < ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index.$length; + } + if (!(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).tag === ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).tag)) { + return ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).tag; + } + return $subslice(new byIndex(x.$array), x.$offset, x.$offset + x.$length).Less(i, j); + }; + $ptrType(byName).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; + byIndex.prototype.Len = function() { + var $ptr, x; + x = this; + return x.$length; + }; + $ptrType(byIndex).prototype.Len = function() { return this.$get().Len(); }; + byIndex.prototype.Swap = function(i, j) { + var $ptr, _tmp, _tmp$1, i, j, x; + x = this; + _tmp = $clone(((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]), field); + _tmp$1 = $clone(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), field); + field.copy(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), _tmp); + field.copy(((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]), _tmp$1); + }; + $ptrType(byIndex).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; + byIndex.prototype.Less = function(i, j) { + var $ptr, _i, _ref, i, j, k, x, x$1, x$2, xik; + x = this; + _ref = ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).index; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + k = _i; + xik = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (k >= ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index.$length) { + return false; + } + if (!((xik === (x$1 = ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index, ((k < 0 || k >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + k]))))) { + return xik < (x$2 = ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index, ((k < 0 || k >= x$2.$length) ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + k])); + } + _i++; + } + return ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).index.$length < ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index.$length; + }; + $ptrType(byIndex).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; + typeFields = function(t) { + var $ptr, _5, _entry, _entry$1, _entry$2, _entry$3, _i, _key, _key$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _v, _v$1, advance, count, current, dominant, f, fi, fields, fj, ft, i, i$1, index, name, name$1, next, nextCount, ok, opts, out, quoted, sf, t, tag, tagged, visited, x, x$1, x$2, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _5 = $f._5; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _i = $f._i; _key = $f._key; _key$1 = $f._key$1; _r$10 = $f._r$10; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; _v$1 = $f._v$1; advance = $f.advance; count = $f.count; current = $f.current; dominant = $f.dominant; f = $f.f; fi = $f.fi; fields = $f.fields; fj = $f.fj; ft = $f.ft; i = $f.i; i$1 = $f.i$1; index = $f.index; name = $f.name; name$1 = $f.name$1; next = $f.next; nextCount = $f.nextCount; ok = $f.ok; opts = $f.opts; out = $f.out; quoted = $f.quoted; sf = $f.sf; t = $f.t; tag = $f.tag; tagged = $f.tagged; visited = $f.visited; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + current = new sliceType$1([]); + next = new sliceType$1([new field.ptr("", sliceType$2.nil, $throwNilPointerError, false, sliceType$3.nil, t, false, false)]); + count = $makeMap(reflect.Type.keyFor, []); + nextCount = $makeMap(reflect.Type.keyFor, []); + visited = $makeMap(reflect.Type.keyFor, []); + fields = sliceType$1.nil; + /* while (true) { */ case 1: + /* if (!(next.$length > 0)) { break; } */ if(!(next.$length > 0)) { $s = 2; continue; } + _tmp = next; + _tmp$1 = $subslice(current, 0, 0); + current = _tmp; + next = _tmp$1; + _tmp$2 = nextCount; + _tmp$3 = $makeMap(reflect.Type.keyFor, []); + count = _tmp$2; + nextCount = _tmp$3; + _ref = current; + _i = 0; + /* while (true) { */ case 3: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } + f = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), field); + /* */ if ((_entry = visited[reflect.Type.keyFor(f.typ)], _entry !== undefined ? _entry.v : false)) { $s = 5; continue; } + /* */ $s = 6; continue; + /* if ((_entry = visited[reflect.Type.keyFor(f.typ)], _entry !== undefined ? _entry.v : false)) { */ case 5: + _i++; + /* continue; */ $s = 3; continue; + /* } */ case 6: + _key = f.typ; (visited || $throwRuntimeError("assignment to entry in nil map"))[reflect.Type.keyFor(_key)] = { k: _key, v: true }; + i = 0; + /* while (true) { */ case 7: + _r$2 = f.typ.NumField(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + /* if (!(i < _r$2)) { break; } */ if(!(i < _r$2)) { $s = 8; continue; } + _r$3 = f.typ.Field(i); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + sf = $clone(_r$3, reflect.StructField); + /* */ if (!(sf.PkgPath === "") && !sf.Anonymous) { $s = 11; continue; } + /* */ $s = 12; continue; + /* if (!(sf.PkgPath === "") && !sf.Anonymous) { */ case 11: + i = i + (1) >> 0; + /* continue; */ $s = 7; continue; + /* } */ case 12: + tag = new reflect.StructTag(sf.Tag).Get("json"); + /* */ if (tag === "-") { $s = 13; continue; } + /* */ $s = 14; continue; + /* if (tag === "-") { */ case 13: + i = i + (1) >> 0; + /* continue; */ $s = 7; continue; + /* } */ case 14: + _tuple = parseTag(tag); + name = _tuple[0]; + opts = _tuple[1]; + if (!isValidTag(name)) { + name = ""; + } + index = $makeSlice(sliceType$3, (f.index.$length + 1 >> 0)); + $copySlice(index, f.index); + (x = f.index.$length, ((x < 0 || x >= index.$length) ? $throwRuntimeError("index out of range") : index.$array[index.$offset + x] = i)); + ft = sf.Type; + _r$4 = ft.Name(); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } + if (!(_r$4 === "")) { _v = false; $s = 17; continue s; } + _r$5 = ft.Kind(); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } + _v = _r$5 === 22; case 17: + /* */ if (_v) { $s = 15; continue; } + /* */ $s = 16; continue; + /* if (_v) { */ case 15: + _r$6 = ft.Elem(); /* */ $s = 20; case 20: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } + ft = _r$6; + /* } */ case 16: + quoted = false; + /* */ if (new tagOptions(opts).Contains("string")) { $s = 21; continue; } + /* */ $s = 22; continue; + /* if (new tagOptions(opts).Contains("string")) { */ case 21: + _r$7 = ft.Kind(); /* */ $s = 24; case 24: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } + _5 = _r$7; + if ((_5 === (1)) || (_5 === (2)) || (_5 === (3)) || (_5 === (4)) || (_5 === (5)) || (_5 === (6)) || (_5 === (7)) || (_5 === (8)) || (_5 === (9)) || (_5 === (10)) || (_5 === (11)) || (_5 === (13)) || (_5 === (14)) || (_5 === (24))) { + quoted = true; + } + case 23: + /* } */ case 22: + if (!(name === "") || !sf.Anonymous) { _v$1 = true; $s = 27; continue s; } + _r$8 = ft.Kind(); /* */ $s = 28; case 28: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } + _v$1 = !((_r$8 === 25)); case 27: + /* */ if (_v$1) { $s = 25; continue; } + /* */ $s = 26; continue; + /* if (_v$1) { */ case 25: + tagged = !(name === ""); + if (name === "") { + name = sf.Name; + } + fields = $append(fields, fillField(new field.ptr(name, sliceType$2.nil, $throwNilPointerError, tagged, index, ft, new tagOptions(opts).Contains("omitempty"), quoted))); + if ((_entry$1 = count[reflect.Type.keyFor(f.typ)], _entry$1 !== undefined ? _entry$1.v : 0) > 1) { + fields = $append(fields, (x$1 = fields.$length - 1 >> 0, ((x$1 < 0 || x$1 >= fields.$length) ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + x$1]))); + } + i = i + (1) >> 0; + /* continue; */ $s = 7; continue; + /* } */ case 26: + _key$1 = ft; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[reflect.Type.keyFor(_key$1)] = { k: _key$1, v: (_entry$2 = nextCount[reflect.Type.keyFor(ft)], _entry$2 !== undefined ? _entry$2.v : 0) + (1) >> 0 }; + /* */ if ((_entry$3 = nextCount[reflect.Type.keyFor(ft)], _entry$3 !== undefined ? _entry$3.v : 0) === 1) { $s = 29; continue; } + /* */ $s = 30; continue; + /* if ((_entry$3 = nextCount[reflect.Type.keyFor(ft)], _entry$3 !== undefined ? _entry$3.v : 0) === 1) { */ case 29: + _r$9 = ft.Name(); /* */ $s = 31; case 31: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } + _r$10 = fillField(new field.ptr(_r$9, sliceType$2.nil, $throwNilPointerError, false, index, ft, false, false)); /* */ $s = 32; case 32: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } + next = $append(next, _r$10); + /* } */ case 30: + i = i + (1) >> 0; + /* } */ $s = 7; continue; case 8: + _i++; + /* } */ $s = 3; continue; case 4: + /* } */ $s = 1; continue; case 2: + $r = sort.Sort($subslice(new byName(fields.$array), fields.$offset, fields.$offset + fields.$length)); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + out = $subslice(fields, 0, 0); + _tmp$4 = 0; + _tmp$5 = 0; + advance = _tmp$4; + i$1 = _tmp$5; + /* while (true) { */ case 34: + /* if (!(i$1 < fields.$length)) { break; } */ if(!(i$1 < fields.$length)) { $s = 35; continue; } + fi = $clone(((i$1 < 0 || i$1 >= fields.$length) ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + i$1]), field); + name$1 = fi.name; + advance = 1; + while (true) { + if (!((i$1 + advance >> 0) < fields.$length)) { break; } + fj = $clone((x$2 = i$1 + advance >> 0, ((x$2 < 0 || x$2 >= fields.$length) ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + x$2])), field); + if (!(fj.name === name$1)) { + break; + } + advance = advance + (1) >> 0; + } + if (advance === 1) { + out = $append(out, fi); + i$1 = i$1 + (advance) >> 0; + /* continue; */ $s = 34; continue; + } + _tuple$1 = dominantField($subslice(fields, i$1, (i$1 + advance >> 0))); + dominant = $clone(_tuple$1[0], field); + ok = _tuple$1[1]; + if (ok) { + out = $append(out, dominant); + } + i$1 = i$1 + (advance) >> 0; + /* } */ $s = 34; continue; case 35: + fields = out; + $r = sort.Sort($subslice(new byIndex(fields.$array), fields.$offset, fields.$offset + fields.$length)); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + return fields; + /* */ } return; } if ($f === undefined) { $f = { $blk: typeFields }; } $f.$ptr = $ptr; $f._5 = _5; $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._i = _i; $f._key = _key; $f._key$1 = _key$1; $f._r$10 = _r$10; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f._v$1 = _v$1; $f.advance = advance; $f.count = count; $f.current = current; $f.dominant = dominant; $f.f = f; $f.fi = fi; $f.fields = fields; $f.fj = fj; $f.ft = ft; $f.i = i; $f.i$1 = i$1; $f.index = index; $f.name = name; $f.name$1 = name$1; $f.next = next; $f.nextCount = nextCount; $f.ok = ok; $f.opts = opts; $f.out = out; $f.quoted = quoted; $f.sf = sf; $f.t = t; $f.tag = tag; $f.tagged = tagged; $f.visited = visited; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; + }; + dominantField = function(fields) { + var $ptr, _i, _ref, f, fields, i, length, tagged; + length = (0 >= fields.$length ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + 0]).index.$length; + tagged = -1; + _ref = fields; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + f = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), field); + if (f.index.$length > length) { + fields = $subslice(fields, 0, i); + break; + } + if (f.tag) { + if (tagged >= 0) { + return [new field.ptr("", sliceType$2.nil, $throwNilPointerError, false, sliceType$3.nil, $ifaceNil, false, false), false]; + } + tagged = i; + } + _i++; + } + if (tagged >= 0) { + return [((tagged < 0 || tagged >= fields.$length) ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + tagged]), true]; + } + if (fields.$length > 1) { + return [new field.ptr("", sliceType$2.nil, $throwNilPointerError, false, sliceType$3.nil, $ifaceNil, false, false), false]; + } + return [(0 >= fields.$length ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + 0]), true]; + }; + cachedTypeFields = function(t) { + var $ptr, _entry, _key, _r$2, f, t, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _r$2 = $f._r$2; f = $f.f; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + fieldCache.RWMutex.RLock(); + f = (_entry = fieldCache.m[reflect.Type.keyFor(t)], _entry !== undefined ? _entry.v : sliceType$1.nil); + fieldCache.RWMutex.RUnlock(); + if (!(f === sliceType$1.nil)) { + return f; + } + _r$2 = typeFields(t); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + f = _r$2; + if (f === sliceType$1.nil) { + f = new sliceType$1([]); + } + fieldCache.RWMutex.Lock(); + if (fieldCache.m === false) { + fieldCache.m = $makeMap(reflect.Type.keyFor, []); + } + _key = t; (fieldCache.m || $throwRuntimeError("assignment to entry in nil map"))[reflect.Type.keyFor(_key)] = { k: _key, v: f }; + fieldCache.RWMutex.Unlock(); + return f; + /* */ } return; } if ($f === undefined) { $f = { $blk: cachedTypeFields }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._r$2 = _r$2; $f.f = f; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; + }; + foldFunc = function(s) { + var $ptr, _i, _ref, b, nonLetter, s, special, upper; + nonLetter = false; + special = false; + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + b = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (b >= 128) { + return bytes.EqualFold; + } + upper = (b & 223) >>> 0; + if (upper < 65 || upper > 90) { + nonLetter = true; + } else if ((upper === 75) || (upper === 83)) { + special = true; + } + _i++; + } + if (special) { + return equalFoldRight; + } + if (nonLetter) { + return asciiEqualFold; + } + return simpleLetterEqualFold; + }; + equalFoldRight = function(s, t) { + var $ptr, _1, _i, _ref, _tuple, s, sb, sbUpper, size, t, tb, tr; + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + sb = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (t.$length === 0) { + return false; + } + tb = (0 >= t.$length ? $throwRuntimeError("index out of range") : t.$array[t.$offset + 0]); + if (tb < 128) { + if (!((sb === tb))) { + sbUpper = (sb & 223) >>> 0; + if (65 <= sbUpper && sbUpper <= 90) { + if (!((sbUpper === ((tb & 223) >>> 0)))) { + return false; + } + } else { + return false; + } + } + t = $subslice(t, 1); + _i++; + continue; + } + _tuple = utf8.DecodeRune(t); + tr = _tuple[0]; + size = _tuple[1]; + _1 = sb; + if ((_1 === (115)) || (_1 === (83))) { + if (!((tr === 383))) { + return false; + } + } else if ((_1 === (107)) || (_1 === (75))) { + if (!((tr === 8490))) { + return false; + } + } else { + return false; + } + t = $subslice(t, size); + _i++; + } + if (t.$length > 0) { + return false; + } + return true; + }; + asciiEqualFold = function(s, t) { + var $ptr, _i, _ref, i, s, sb, t, tb; + if (!((s.$length === t.$length))) { + return false; + } + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + sb = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + tb = ((i < 0 || i >= t.$length) ? $throwRuntimeError("index out of range") : t.$array[t.$offset + i]); + if (sb === tb) { + _i++; + continue; + } + if ((97 <= sb && sb <= 122) || (65 <= sb && sb <= 90)) { + if (!((((sb & 223) >>> 0) === ((tb & 223) >>> 0)))) { + return false; + } + } else { + return false; + } + _i++; + } + return true; + }; + simpleLetterEqualFold = function(s, t) { + var $ptr, _i, _ref, b, i, s, t; + if (!((s.$length === t.$length))) { + return false; + } + _ref = s; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + b = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (!((((b & 223) >>> 0) === ((((i < 0 || i >= t.$length) ? $throwRuntimeError("index out of range") : t.$array[t.$offset + i]) & 223) >>> 0)))) { + return false; + } + _i++; + } + return true; + }; + compact = function(dst, src, escape) { + var $ptr, _i, _r$2, _r$3, _ref, c, dst, escape, i, origLen, scan, src, start, v, x, x$1, x$2, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; c = $f.c; dst = $f.dst; escape = $f.escape; i = $f.i; origLen = $f.origLen; scan = $f.scan; src = $f.src; start = $f.start; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + scan = [scan]; + origLen = dst.Len(); + scan[0] = new scanner.ptr($throwNilPointerError, false, sliceType$3.nil, $ifaceNil, false, 0, $throwNilPointerError, new $Int64(0, 0)); + scan[0].reset(); + start = 0; + _ref = src; + _i = 0; + /* while (true) { */ case 1: + /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } + i = _i; + c = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + if (escape && ((c === 60) || (c === 62) || (c === 38))) { + if (start < i) { + dst.Write($subslice(src, start, i)); + } + dst.WriteString("\\u00"); + dst.WriteByte(hex.charCodeAt((c >>> 4 << 24 >>> 24))); + dst.WriteByte(hex.charCodeAt(((c & 15) >>> 0))); + start = i + 1 >> 0; + } + if ((c === 226) && (i + 2 >> 0) < src.$length && ((x = i + 1 >> 0, ((x < 0 || x >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x])) === 128) && ((((x$1 = i + 2 >> 0, ((x$1 < 0 || x$1 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$1])) & ~1) << 24 >>> 24) === 168)) { + if (start < i) { + dst.Write($subslice(src, start, i)); + } + dst.WriteString("\\u202"); + dst.WriteByte(hex.charCodeAt((((x$2 = i + 2 >> 0, ((x$2 < 0 || x$2 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$2])) & 15) >>> 0))); + start = i + 3 >> 0; + } + _r$2 = scan[0].step(scan[0], c); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + v = _r$2; + if (v >= 9) { + if (v === 11) { + /* break; */ $s = 2; continue; + } + if (start < i) { + dst.Write($subslice(src, start, i)); + } + start = i + 1 >> 0; + } + _i++; + /* } */ $s = 1; continue; case 2: + _r$3 = scan[0].eof(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } + /* */ if (_r$3 === 11) { $s = 4; continue; } + /* */ $s = 5; continue; + /* if (_r$3 === 11) { */ case 4: + dst.Truncate(origLen); + return scan[0].err; + /* } */ case 5: + if (start < src.$length) { + dst.Write($subslice(src, start)); + } + return $ifaceNil; + /* */ } return; } if ($f === undefined) { $f = { $blk: compact }; } $f.$ptr = $ptr; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f.c = c; $f.dst = dst; $f.escape = escape; $f.i = i; $f.origLen = origLen; $f.scan = scan; $f.src = src; $f.start = start; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; + }; + SyntaxError.ptr.prototype.Error = function() { + var $ptr, e; + e = this; + return e.msg; + }; + SyntaxError.prototype.Error = function() { return this.$val.Error(); }; + scanner.ptr.prototype.reset = function() { + var $ptr, s; + s = this; + s.step = stateBeginValue; + s.parseState = $subslice(s.parseState, 0, 0); + s.err = $ifaceNil; + s.redo = false; + s.endTop = false; + }; + scanner.prototype.reset = function() { return this.$val.reset(); }; + scanner.ptr.prototype.eof = function() { + var $ptr, _r$2, s, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + s = this; + if (!($interfaceIsEqual(s.err, $ifaceNil))) { + return 11; + } + if (s.endTop) { + return 10; + } + _r$2 = s.step(s, 32); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } + _r$2; + if (s.endTop) { + return 10; + } + if ($interfaceIsEqual(s.err, $ifaceNil)) { + s.err = new SyntaxError.ptr("unexpected end of JSON input", s.bytes); + } + return 11; + /* */ } return; } if ($f === undefined) { $f = { $blk: scanner.ptr.prototype.eof }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; + }; + scanner.prototype.eof = function() { return this.$val.eof(); }; + scanner.ptr.prototype.pushParseState = function(p) { + var $ptr, p, s; + s = this; + s.parseState = $append(s.parseState, p); + }; + scanner.prototype.pushParseState = function(p) { return this.$val.pushParseState(p); }; + scanner.ptr.prototype.popParseState = function() { + var $ptr, n, s; + s = this; + n = s.parseState.$length - 1 >> 0; + s.parseState = $subslice(s.parseState, 0, n); + s.redo = false; + if (n === 0) { + s.step = stateEndTop; + s.endTop = true; + } else { + s.step = stateEndValue; + } + }; + scanner.prototype.popParseState = function() { return this.$val.popParseState(); }; + isSpace = function(c) { + var $ptr, c; + return (c === 32) || (c === 9) || (c === 13) || (c === 10); + }; + stateBeginValueOrEmpty = function(s, c) { + var $ptr, c, s; + if (c <= 32 && isSpace(c)) { + return 9; + } + if (c === 93) { + return stateEndValue(s, c); + } + return stateBeginValue(s, c); + }; + stateBeginValue = function(s, c) { + var $ptr, _2, c, s; + if (c <= 32 && isSpace(c)) { + return 9; + } + _2 = c; + if (_2 === (123)) { + s.step = stateBeginStringOrEmpty; + s.pushParseState(0); + return 2; + } else if (_2 === (91)) { + s.step = stateBeginValueOrEmpty; + s.pushParseState(2); + return 6; + } else if (_2 === (34)) { + s.step = stateInString; + return 1; + } else if (_2 === (45)) { + s.step = stateNeg; + return 1; + } else if (_2 === (48)) { + s.step = state0; + return 1; + } else if (_2 === (116)) { + s.step = stateT; + return 1; + } else if (_2 === (102)) { + s.step = stateF; + return 1; + } else if (_2 === (110)) { + s.step = stateN; + return 1; + } + if (49 <= c && c <= 57) { + s.step = state1; + return 1; + } + return s.error(c, "looking for beginning of value"); + }; + stateBeginStringOrEmpty = function(s, c) { + var $ptr, c, n, s, x, x$1; + if (c <= 32 && isSpace(c)) { + return 9; + } + if (c === 125) { + n = s.parseState.$length; + (x = s.parseState, x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1] = 1)); + return stateEndValue(s, c); + } + return stateBeginString(s, c); + }; + stateBeginString = function(s, c) { + var $ptr, c, s; + if (c <= 32 && isSpace(c)) { + return 9; + } + if (c === 34) { + s.step = stateInString; + return 1; + } + return s.error(c, "looking for beginning of object key string"); + }; + stateEndValue = function(s, c) { + var $ptr, _3, c, n, ps, s, x, x$1, x$2, x$3, x$4, x$5; + n = s.parseState.$length; + if (n === 0) { + s.step = stateEndTop; + s.endTop = true; + return stateEndTop(s, c); + } + if (c <= 32 && isSpace(c)) { + s.step = stateEndValue; + return 9; + } + ps = (x = s.parseState, x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); + _3 = ps; + if (_3 === (0)) { + if (c === 58) { + (x$2 = s.parseState, x$3 = n - 1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + x$3] = 1)); + s.step = stateBeginValue; + return 3; + } + return s.error(c, "after object key"); + } else if (_3 === (1)) { + if (c === 44) { + (x$4 = s.parseState, x$5 = n - 1 >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + x$5] = 0)); + s.step = stateBeginString; + return 4; + } + if (c === 125) { + s.popParseState(); + return 5; + } + return s.error(c, "after object key:value pair"); + } else if (_3 === (2)) { + if (c === 44) { + s.step = stateBeginValue; + return 7; + } + if (c === 93) { + s.popParseState(); + return 8; + } + return s.error(c, "after array element"); + } + return s.error(c, ""); + }; + stateEndTop = function(s, c) { + var $ptr, c, s; + if (!((c === 32)) && !((c === 9)) && !((c === 13)) && !((c === 10))) { + s.error(c, "after top-level value"); + } + return 10; + }; + stateInString = function(s, c) { + var $ptr, c, s; + if (c === 34) { + s.step = stateEndValue; + return 0; + } + if (c === 92) { + s.step = stateInStringEsc; + return 0; + } + if (c < 32) { + return s.error(c, "in string literal"); + } + return 0; + }; + stateInStringEsc = function(s, c) { + var $ptr, _4, c, s; + _4 = c; + if ((_4 === (98)) || (_4 === (102)) || (_4 === (110)) || (_4 === (114)) || (_4 === (116)) || (_4 === (92)) || (_4 === (47)) || (_4 === (34))) { + s.step = stateInString; + return 0; + } else if (_4 === (117)) { + s.step = stateInStringEscU; + return 0; + } + return s.error(c, "in string escape code"); + }; + stateInStringEscU = function(s, c) { + var $ptr, c, s; + if (48 <= c && c <= 57 || 97 <= c && c <= 102 || 65 <= c && c <= 70) { + s.step = stateInStringEscU1; + return 0; + } + return s.error(c, "in \\u hexadecimal character escape"); + }; + stateInStringEscU1 = function(s, c) { + var $ptr, c, s; + if (48 <= c && c <= 57 || 97 <= c && c <= 102 || 65 <= c && c <= 70) { + s.step = stateInStringEscU12; + return 0; + } + return s.error(c, "in \\u hexadecimal character escape"); + }; + stateInStringEscU12 = function(s, c) { + var $ptr, c, s; + if (48 <= c && c <= 57 || 97 <= c && c <= 102 || 65 <= c && c <= 70) { + s.step = stateInStringEscU123; + return 0; + } + return s.error(c, "in \\u hexadecimal character escape"); + }; + stateInStringEscU123 = function(s, c) { + var $ptr, c, s; + if (48 <= c && c <= 57 || 97 <= c && c <= 102 || 65 <= c && c <= 70) { + s.step = stateInString; + return 0; + } + return s.error(c, "in \\u hexadecimal character escape"); + }; + stateNeg = function(s, c) { + var $ptr, c, s; + if (c === 48) { + s.step = state0; + return 0; + } + if (49 <= c && c <= 57) { + s.step = state1; + return 0; + } + return s.error(c, "in numeric literal"); + }; + state1 = function(s, c) { + var $ptr, c, s; + if (48 <= c && c <= 57) { + s.step = state1; + return 0; + } + return state0(s, c); + }; + state0 = function(s, c) { + var $ptr, c, s; + if (c === 46) { + s.step = stateDot; + return 0; + } + if ((c === 101) || (c === 69)) { + s.step = stateE; + return 0; + } + return stateEndValue(s, c); + }; + stateDot = function(s, c) { + var $ptr, c, s; + if (48 <= c && c <= 57) { + s.step = stateDot0; + return 0; + } + return s.error(c, "after decimal point in numeric literal"); + }; + stateDot0 = function(s, c) { + var $ptr, c, s; + if (48 <= c && c <= 57) { + return 0; + } + if ((c === 101) || (c === 69)) { + s.step = stateE; + return 0; + } + return stateEndValue(s, c); + }; + stateE = function(s, c) { + var $ptr, c, s; + if ((c === 43) || (c === 45)) { + s.step = stateESign; + return 0; + } + return stateESign(s, c); + }; + stateESign = function(s, c) { + var $ptr, c, s; + if (48 <= c && c <= 57) { + s.step = stateE0; + return 0; + } + return s.error(c, "in exponent of numeric literal"); + }; + stateE0 = function(s, c) { + var $ptr, c, s; + if (48 <= c && c <= 57) { + return 0; + } + return stateEndValue(s, c); + }; + stateT = function(s, c) { + var $ptr, c, s; + if (c === 114) { + s.step = stateTr; + return 0; + } + return s.error(c, "in literal true (expecting 'r')"); + }; + stateTr = function(s, c) { + var $ptr, c, s; + if (c === 117) { + s.step = stateTru; + return 0; + } + return s.error(c, "in literal true (expecting 'u')"); + }; + stateTru = function(s, c) { + var $ptr, c, s; + if (c === 101) { + s.step = stateEndValue; + return 0; + } + return s.error(c, "in literal true (expecting 'e')"); + }; + stateF = function(s, c) { + var $ptr, c, s; + if (c === 97) { + s.step = stateFa; + return 0; + } + return s.error(c, "in literal false (expecting 'a')"); + }; + stateFa = function(s, c) { + var $ptr, c, s; + if (c === 108) { + s.step = stateFal; + return 0; + } + return s.error(c, "in literal false (expecting 'l')"); + }; + stateFal = function(s, c) { + var $ptr, c, s; + if (c === 115) { + s.step = stateFals; + return 0; + } + return s.error(c, "in literal false (expecting 's')"); + }; + stateFals = function(s, c) { + var $ptr, c, s; + if (c === 101) { + s.step = stateEndValue; + return 0; + } + return s.error(c, "in literal false (expecting 'e')"); + }; + stateN = function(s, c) { + var $ptr, c, s; + if (c === 117) { + s.step = stateNu; + return 0; + } + return s.error(c, "in literal null (expecting 'u')"); + }; + stateNu = function(s, c) { + var $ptr, c, s; + if (c === 108) { + s.step = stateNul; + return 0; + } + return s.error(c, "in literal null (expecting 'l')"); + }; + stateNul = function(s, c) { + var $ptr, c, s; + if (c === 108) { + s.step = stateEndValue; + return 0; + } + return s.error(c, "in literal null (expecting 'l')"); + }; + stateError = function(s, c) { + var $ptr, c, s; + return 11; + }; + scanner.ptr.prototype.error = function(c, context) { + var $ptr, c, context, s; + s = this; + s.step = stateError; + s.err = new SyntaxError.ptr("invalid character " + quoteChar(c) + " " + context, s.bytes); + return 11; + }; + scanner.prototype.error = function(c, context) { return this.$val.error(c, context); }; + quoteChar = function(c) { + var $ptr, c, s; + if (c === 39) { + return "'\\''"; + } + if (c === 34) { + return "'\"'"; + } + s = strconv.Quote($encodeRune(c)); + return "'" + s.substring(1, (s.length - 1 >> 0)) + "'"; + }; + parseTag = function(tag) { + var $ptr, idx, tag; + idx = strings.Index(tag, ","); + if (!((idx === -1))) { + return [tag.substring(0, idx), tag.substring((idx + 1 >> 0))]; + } + return [tag, ""]; + }; + tagOptions.prototype.Contains = function(optionName) { + var $ptr, _tmp, _tmp$1, i, next, o, optionName, s; + o = this.$val; + if (o.length === 0) { + return false; + } + s = o; + while (true) { + if (!(!(s === ""))) { break; } + next = ""; + i = strings.Index(s, ","); + if (i >= 0) { + _tmp = s.substring(0, i); + _tmp$1 = s.substring((i + 1 >> 0)); + s = _tmp; + next = _tmp$1; + } + if (s === optionName) { + return true; + } + s = next; + } + return false; + }; + $ptrType(tagOptions).prototype.Contains = function(optionName) { return new tagOptions(this.$get()).Contains(optionName); }; + Number.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Float64", name: "Float64", pkg: "", typ: $funcType([], [$Float64, $error], false)}, {prop: "Int64", name: "Int64", pkg: "", typ: $funcType([], [$Int64, $error], false)}]; + ptrType$13.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$14.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$16.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$4.methods = [{prop: "marshal", name: "marshal", pkg: "encoding/json", typ: $funcType([$emptyInterface], [$error], false)}, {prop: "error", name: "error", pkg: "encoding/json", typ: $funcType([$error], [], false)}, {prop: "reflectValue", name: "reflectValue", pkg: "encoding/json", typ: $funcType([reflect.Value], [], false)}, {prop: "string", name: "string", pkg: "encoding/json", typ: $funcType([$String], [$Int], false)}, {prop: "stringBytes", name: "stringBytes", pkg: "encoding/json", typ: $funcType([sliceType$2], [$Int], false)}]; + floatEncoder.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; + ptrType$17.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; + ptrType$18.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; + ptrType$19.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; + ptrType$20.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; + ptrType$21.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; + ptrType$22.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; + stringValues.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "Less", name: "Less", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}, {prop: "get", name: "get", pkg: "encoding/json", typ: $funcType([$Int], [$String], false)}]; + byName.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "Less", name: "Less", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}]; + byIndex.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "Less", name: "Less", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}]; + ptrType$8.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; + ptrType$23.methods = [{prop: "reset", name: "reset", pkg: "encoding/json", typ: $funcType([], [], false)}, {prop: "eof", name: "eof", pkg: "encoding/json", typ: $funcType([], [$Int], false)}, {prop: "pushParseState", name: "pushParseState", pkg: "encoding/json", typ: $funcType([$Int], [], false)}, {prop: "popParseState", name: "popParseState", pkg: "encoding/json", typ: $funcType([], [], false)}, {prop: "error", name: "error", pkg: "encoding/json", typ: $funcType([$Uint8, $String], [$Int], false)}, {prop: "undo", name: "undo", pkg: "encoding/json", typ: $funcType([$Int], [], false)}]; + tagOptions.methods = [{prop: "Contains", name: "Contains", pkg: "", typ: $funcType([$String], [$Bool], false)}]; + Marshaler.init([{prop: "MarshalJSON", name: "MarshalJSON", pkg: "", typ: $funcType([], [sliceType$2, $error], false)}]); + UnsupportedTypeError.init([{prop: "Type", name: "Type", pkg: "", typ: reflect.Type, tag: ""}]); + UnsupportedValueError.init([{prop: "Value", name: "Value", pkg: "", typ: reflect.Value, tag: ""}, {prop: "Str", name: "Str", pkg: "", typ: $String, tag: ""}]); + MarshalerError.init([{prop: "Type", name: "Type", pkg: "", typ: reflect.Type, tag: ""}, {prop: "Err", name: "Err", pkg: "", typ: $error, tag: ""}]); + encodeState.init([{prop: "Buffer", name: "", pkg: "", typ: bytes.Buffer, tag: ""}, {prop: "scratch", name: "scratch", pkg: "encoding/json", typ: arrayType$1, tag: ""}]); + encoderFunc.init([ptrType$4, reflect.Value, $Bool], [], false); + structEncoder.init([{prop: "fields", name: "fields", pkg: "encoding/json", typ: sliceType$1, tag: ""}, {prop: "fieldEncs", name: "fieldEncs", pkg: "encoding/json", typ: sliceType$4, tag: ""}]); + mapEncoder.init([{prop: "elemEnc", name: "elemEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}]); + sliceEncoder.init([{prop: "arrayEnc", name: "arrayEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}]); + arrayEncoder.init([{prop: "elemEnc", name: "elemEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}]); + ptrEncoder.init([{prop: "elemEnc", name: "elemEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}]); + condAddrEncoder.init([{prop: "canAddrEnc", name: "canAddrEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}, {prop: "elseEnc", name: "elseEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}]); + stringValues.init(reflect.Value); + field.init([{prop: "name", name: "name", pkg: "encoding/json", typ: $String, tag: ""}, {prop: "nameBytes", name: "nameBytes", pkg: "encoding/json", typ: sliceType$2, tag: ""}, {prop: "equalFold", name: "equalFold", pkg: "encoding/json", typ: funcType, tag: ""}, {prop: "tag", name: "tag", pkg: "encoding/json", typ: $Bool, tag: ""}, {prop: "index", name: "index", pkg: "encoding/json", typ: sliceType$3, tag: ""}, {prop: "typ", name: "typ", pkg: "encoding/json", typ: reflect.Type, tag: ""}, {prop: "omitEmpty", name: "omitEmpty", pkg: "encoding/json", typ: $Bool, tag: ""}, {prop: "quoted", name: "quoted", pkg: "encoding/json", typ: $Bool, tag: ""}]); + byName.init(field); + byIndex.init(field); + SyntaxError.init([{prop: "msg", name: "msg", pkg: "encoding/json", typ: $String, tag: ""}, {prop: "Offset", name: "Offset", pkg: "", typ: $Int64, tag: ""}]); + scanner.init([{prop: "step", name: "step", pkg: "encoding/json", typ: funcType$1, tag: ""}, {prop: "endTop", name: "endTop", pkg: "encoding/json", typ: $Bool, tag: ""}, {prop: "parseState", name: "parseState", pkg: "encoding/json", typ: sliceType$3, tag: ""}, {prop: "err", name: "err", pkg: "encoding/json", typ: $error, tag: ""}, {prop: "redo", name: "redo", pkg: "encoding/json", typ: $Bool, tag: ""}, {prop: "redoCode", name: "redoCode", pkg: "encoding/json", typ: $Int, tag: ""}, {prop: "redoState", name: "redoState", pkg: "encoding/json", typ: funcType$1, tag: ""}, {prop: "bytes", name: "bytes", pkg: "encoding/json", typ: $Int64, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = encoding.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = base64.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = errors.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = fmt.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = nosync.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = io.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = math.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = reflect.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = runtime.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sort.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strconv.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = strings.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = testing.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = unicode.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf16.$init(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = utf8.$init(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + encoderCache = new structType.ptr(new nosync.RWMutex.ptr(false, 0), false); + fieldCache = new structType$1.ptr(new nosync.RWMutex.ptr(false, 0), false); + errPhase = errors.New("JSON decoder out of sync - data changing underfoot?"); + numberType = reflect.TypeOf(new Number("")); + hex = "0123456789abcdef"; + _r = reflect.TypeOf($newDataPointer($ifaceNil, ptrType)).Elem(); /* */ $s = 18; case 18: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + marshalerType = _r; + _r$1 = reflect.TypeOf($newDataPointer($ifaceNil, ptrType$1)).Elem(); /* */ $s = 19; case 19: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + textMarshalerType = _r$1; + float32Encoder = $methodVal(new floatEncoder(32), "encode"); + float64Encoder = $methodVal(new floatEncoder(64), "encode"); + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["github.com/ZiRo-/cuckgo/cuckoo"] = (function() { + var $pkg = {}, $init, sha256, json, Cuckoo, Edge, CuckooJSON, arrayType, arrayType$1, sliceType, sliceType$1, ptrType$1, ptrType$2, mapType, u8, u8to64, NewCuckoo, NewCuckooSHA, EncodeCuckooJSON; + sha256 = $packages["crypto/sha256"]; + json = $packages["encoding/json"]; + Cuckoo = $pkg.Cuckoo = $newType(0, $kindStruct, "cuckoo.Cuckoo", "Cuckoo", "github.com/ZiRo-/cuckgo/cuckoo", function(v_) { + this.$val = this; + if (arguments.length === 0) { + this.v = arrayType$1.zero(); + return; + } + this.v = v_; + }); + Edge = $pkg.Edge = $newType(0, $kindStruct, "cuckoo.Edge", "Edge", "github.com/ZiRo-/cuckgo/cuckoo", function(U_, V_) { + this.$val = this; + if (arguments.length === 0) { + this.U = new $Uint64(0, 0); + this.V = new $Uint64(0, 0); + return; + } + this.U = U_; + this.V = V_; + }); + CuckooJSON = $pkg.CuckooJSON = $newType(0, $kindStruct, "cuckoo.CuckooJSON", "CuckooJSON", "github.com/ZiRo-/cuckgo/cuckoo", function(Parameter_, InputData_, Cycle_) { + this.$val = this; + if (arguments.length === 0) { + this.Parameter = false; + this.InputData = sliceType$1.nil; + this.Cycle = sliceType.nil; + return; + } + this.Parameter = Parameter_; + this.InputData = InputData_; + this.Cycle = Cycle_; + }); + arrayType = $arrayType($Uint8, 32); + arrayType$1 = $arrayType($Uint64, 4); + sliceType = $sliceType($Uint64); + sliceType$1 = $sliceType($Uint8); + ptrType$1 = $ptrType(Edge); + ptrType$2 = $ptrType(Cuckoo); + mapType = $mapType($String, $Uint64); + u8 = function(b) { + var $ptr, b, x; + return (x = new $Uint64(0, b), new $Uint64(x.$high & 0, (x.$low & 255) >>> 0)); + }; + u8to64 = function(p, i) { + var $ptr, i, p, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + p = $clone(p, arrayType); + return (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = u8(((i < 0 || i >= p.length) ? $throwRuntimeError("index out of range") : p[i])), x$7 = $shiftLeft64(u8((x$8 = i + 1 >> 0, ((x$8 < 0 || x$8 >= p.length) ? $throwRuntimeError("index out of range") : p[x$8]))), 8), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$9 = $shiftLeft64(u8((x$10 = i + 2 >> 0, ((x$10 < 0 || x$10 >= p.length) ? $throwRuntimeError("index out of range") : p[x$10]))), 16), new $Uint64(x$5.$high | x$9.$high, (x$5.$low | x$9.$low) >>> 0)), x$11 = $shiftLeft64(u8((x$12 = i + 3 >> 0, ((x$12 < 0 || x$12 >= p.length) ? $throwRuntimeError("index out of range") : p[x$12]))), 24), new $Uint64(x$4.$high | x$11.$high, (x$4.$low | x$11.$low) >>> 0)), x$13 = $shiftLeft64(u8((x$14 = i + 4 >> 0, ((x$14 < 0 || x$14 >= p.length) ? $throwRuntimeError("index out of range") : p[x$14]))), 32), new $Uint64(x$3.$high | x$13.$high, (x$3.$low | x$13.$low) >>> 0)), x$15 = $shiftLeft64(u8((x$16 = i + 5 >> 0, ((x$16 < 0 || x$16 >= p.length) ? $throwRuntimeError("index out of range") : p[x$16]))), 40), new $Uint64(x$2.$high | x$15.$high, (x$2.$low | x$15.$low) >>> 0)), x$17 = $shiftLeft64(u8((x$18 = i + 6 >> 0, ((x$18 < 0 || x$18 >= p.length) ? $throwRuntimeError("index out of range") : p[x$18]))), 48), new $Uint64(x$1.$high | x$17.$high, (x$1.$low | x$17.$low) >>> 0)), x$19 = $shiftLeft64(u8((x$20 = i + 7 >> 0, ((x$20 < 0 || x$20 >= p.length) ? $throwRuntimeError("index out of range") : p[x$20]))), 56), new $Uint64(x.$high | x$19.$high, (x.$low | x$19.$low) >>> 0)); + }; + NewCuckoo = function(header) { + var $ptr, hdrkey, header; + hdrkey = $clone(sha256.Sum256(header), arrayType); + return NewCuckooSHA(hdrkey); + }; + $pkg.NewCuckoo = NewCuckoo; + NewCuckooSHA = function(hdrkey) { + var $ptr, hdrkey, k0, k1, self; + hdrkey = $clone(hdrkey, arrayType); + self = new Cuckoo.ptr(arrayType$1.zero()); + k0 = u8to64(hdrkey, 0); + k1 = u8to64(hdrkey, 8); + self.v[0] = new $Uint64(k0.$high ^ 1936682341, (k0.$low ^ 1886610805) >>> 0); + self.v[1] = new $Uint64(k1.$high ^ 1685025377, (k1.$low ^ 1852075885) >>> 0); + self.v[2] = new $Uint64(k0.$high ^ 1819895653, (k0.$low ^ 1852142177) >>> 0); + self.v[3] = new $Uint64(k1.$high ^ 1952801890, (k1.$low ^ 2037671283) >>> 0); + return self; + }; + $pkg.NewCuckooSHA = NewCuckooSHA; + Edge.ptr.prototype.HashCode = function() { + var $ptr, self; + self = this; + return ((self.U.$low >> 0) ^ (self.V.$low >> 0)) >> 0; + }; + Edge.prototype.HashCode = function() { return this.$val.HashCode(); }; + Cuckoo.ptr.prototype.Sipedge = function(nonce) { + var $ptr, nonce, self; + self = this; + return new Edge.ptr(self.Sipnode(nonce, 0), self.Sipnode(nonce, 1)); + }; + Cuckoo.prototype.Sipedge = function(nonce) { return this.$val.Sipedge(nonce); }; + Cuckoo.ptr.prototype.siphash24 = function(nonce) { + var $ptr, nonce, self, v0, v1, v2, v3, x, x$1, x$10, x$100, x$101, x$102, x$103, x$104, x$105, x$106, x$107, x$108, x$109, x$11, x$110, x$111, x$112, x$113, x$114, x$115, x$116, x$117, x$118, x$119, x$12, x$120, x$121, x$122, x$123, x$124, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$22, x$23, x$24, x$25, x$26, x$27, x$28, x$29, x$3, x$30, x$31, x$32, x$33, x$34, x$35, x$36, x$37, x$38, x$39, x$4, x$40, x$41, x$42, x$43, x$44, x$45, x$46, x$47, x$48, x$49, x$5, x$50, x$51, x$52, x$53, x$54, x$55, x$56, x$57, x$58, x$59, x$6, x$60, x$61, x$62, x$63, x$64, x$65, x$66, x$67, x$68, x$69, x$7, x$70, x$71, x$72, x$73, x$74, x$75, x$76, x$77, x$78, x$79, x$8, x$80, x$81, x$82, x$83, x$84, x$85, x$86, x$87, x$88, x$89, x$9, x$90, x$91, x$92, x$93, x$94, x$95, x$96, x$97, x$98, x$99; + self = this; + v0 = self.v[0]; + v1 = self.v[1]; + v2 = self.v[2]; + v3 = (x = self.v[3], new $Uint64(x.$high ^ nonce.$high, (x.$low ^ nonce.$low) >>> 0)); + v0 = (x$1 = v1, new $Uint64(v0.$high + x$1.$high, v0.$low + x$1.$low)); + v2 = (x$2 = v3, new $Uint64(v2.$high + x$2.$high, v2.$low + x$2.$low)); + v1 = (x$3 = $shiftLeft64(v1, 13), x$4 = $shiftRightUint64(v1, 51), new $Uint64(x$3.$high | x$4.$high, (x$3.$low | x$4.$low) >>> 0)); + v3 = (x$5 = $shiftLeft64(v3, 16), x$6 = $shiftRightUint64(v3, 48), new $Uint64(x$5.$high | x$6.$high, (x$5.$low | x$6.$low) >>> 0)); + v1 = (x$7 = v0, new $Uint64(v1.$high ^ x$7.$high, (v1.$low ^ x$7.$low) >>> 0)); + v3 = (x$8 = v2, new $Uint64(v3.$high ^ x$8.$high, (v3.$low ^ x$8.$low) >>> 0)); + v0 = (x$9 = $shiftLeft64(v0, 32), x$10 = $shiftRightUint64(v0, 32), new $Uint64(x$9.$high | x$10.$high, (x$9.$low | x$10.$low) >>> 0)); + v2 = (x$11 = v1, new $Uint64(v2.$high + x$11.$high, v2.$low + x$11.$low)); + v0 = (x$12 = v3, new $Uint64(v0.$high + x$12.$high, v0.$low + x$12.$low)); + v1 = (x$13 = $shiftLeft64(v1, 17), x$14 = $shiftRightUint64(v1, 47), new $Uint64(x$13.$high | x$14.$high, (x$13.$low | x$14.$low) >>> 0)); + v3 = (x$15 = $shiftLeft64(v3, 21), x$16 = $shiftRightUint64(v3, 43), new $Uint64(x$15.$high | x$16.$high, (x$15.$low | x$16.$low) >>> 0)); + v1 = (x$17 = v2, new $Uint64(v1.$high ^ x$17.$high, (v1.$low ^ x$17.$low) >>> 0)); + v3 = (x$18 = v0, new $Uint64(v3.$high ^ x$18.$high, (v3.$low ^ x$18.$low) >>> 0)); + v2 = (x$19 = $shiftLeft64(v2, 32), x$20 = $shiftRightUint64(v2, 32), new $Uint64(x$19.$high | x$20.$high, (x$19.$low | x$20.$low) >>> 0)); + v0 = (x$21 = v1, new $Uint64(v0.$high + x$21.$high, v0.$low + x$21.$low)); + v2 = (x$22 = v3, new $Uint64(v2.$high + x$22.$high, v2.$low + x$22.$low)); + v1 = (x$23 = $shiftLeft64(v1, 13), x$24 = $shiftRightUint64(v1, 51), new $Uint64(x$23.$high | x$24.$high, (x$23.$low | x$24.$low) >>> 0)); + v3 = (x$25 = $shiftLeft64(v3, 16), x$26 = $shiftRightUint64(v3, 48), new $Uint64(x$25.$high | x$26.$high, (x$25.$low | x$26.$low) >>> 0)); + v1 = (x$27 = v0, new $Uint64(v1.$high ^ x$27.$high, (v1.$low ^ x$27.$low) >>> 0)); + v3 = (x$28 = v2, new $Uint64(v3.$high ^ x$28.$high, (v3.$low ^ x$28.$low) >>> 0)); + v0 = (x$29 = $shiftLeft64(v0, 32), x$30 = $shiftRightUint64(v0, 32), new $Uint64(x$29.$high | x$30.$high, (x$29.$low | x$30.$low) >>> 0)); + v2 = (x$31 = v1, new $Uint64(v2.$high + x$31.$high, v2.$low + x$31.$low)); + v0 = (x$32 = v3, new $Uint64(v0.$high + x$32.$high, v0.$low + x$32.$low)); + v1 = (x$33 = $shiftLeft64(v1, 17), x$34 = $shiftRightUint64(v1, 47), new $Uint64(x$33.$high | x$34.$high, (x$33.$low | x$34.$low) >>> 0)); + v3 = (x$35 = $shiftLeft64(v3, 21), x$36 = $shiftRightUint64(v3, 43), new $Uint64(x$35.$high | x$36.$high, (x$35.$low | x$36.$low) >>> 0)); + v1 = (x$37 = v2, new $Uint64(v1.$high ^ x$37.$high, (v1.$low ^ x$37.$low) >>> 0)); + v3 = (x$38 = v0, new $Uint64(v3.$high ^ x$38.$high, (v3.$low ^ x$38.$low) >>> 0)); + v2 = (x$39 = $shiftLeft64(v2, 32), x$40 = $shiftRightUint64(v2, 32), new $Uint64(x$39.$high | x$40.$high, (x$39.$low | x$40.$low) >>> 0)); + v0 = (x$41 = nonce, new $Uint64(v0.$high ^ x$41.$high, (v0.$low ^ x$41.$low) >>> 0)); + v2 = (x$42 = new $Uint64(0, 255), new $Uint64(v2.$high ^ x$42.$high, (v2.$low ^ x$42.$low) >>> 0)); + v0 = (x$43 = v1, new $Uint64(v0.$high + x$43.$high, v0.$low + x$43.$low)); + v2 = (x$44 = v3, new $Uint64(v2.$high + x$44.$high, v2.$low + x$44.$low)); + v1 = (x$45 = $shiftLeft64(v1, 13), x$46 = $shiftRightUint64(v1, 51), new $Uint64(x$45.$high | x$46.$high, (x$45.$low | x$46.$low) >>> 0)); + v3 = (x$47 = $shiftLeft64(v3, 16), x$48 = $shiftRightUint64(v3, 48), new $Uint64(x$47.$high | x$48.$high, (x$47.$low | x$48.$low) >>> 0)); + v1 = (x$49 = v0, new $Uint64(v1.$high ^ x$49.$high, (v1.$low ^ x$49.$low) >>> 0)); + v3 = (x$50 = v2, new $Uint64(v3.$high ^ x$50.$high, (v3.$low ^ x$50.$low) >>> 0)); + v0 = (x$51 = $shiftLeft64(v0, 32), x$52 = $shiftRightUint64(v0, 32), new $Uint64(x$51.$high | x$52.$high, (x$51.$low | x$52.$low) >>> 0)); + v2 = (x$53 = v1, new $Uint64(v2.$high + x$53.$high, v2.$low + x$53.$low)); + v0 = (x$54 = v3, new $Uint64(v0.$high + x$54.$high, v0.$low + x$54.$low)); + v1 = (x$55 = $shiftLeft64(v1, 17), x$56 = $shiftRightUint64(v1, 47), new $Uint64(x$55.$high | x$56.$high, (x$55.$low | x$56.$low) >>> 0)); + v3 = (x$57 = $shiftLeft64(v3, 21), x$58 = $shiftRightUint64(v3, 43), new $Uint64(x$57.$high | x$58.$high, (x$57.$low | x$58.$low) >>> 0)); + v1 = (x$59 = v2, new $Uint64(v1.$high ^ x$59.$high, (v1.$low ^ x$59.$low) >>> 0)); + v3 = (x$60 = v0, new $Uint64(v3.$high ^ x$60.$high, (v3.$low ^ x$60.$low) >>> 0)); + v2 = (x$61 = $shiftLeft64(v2, 32), x$62 = $shiftRightUint64(v2, 32), new $Uint64(x$61.$high | x$62.$high, (x$61.$low | x$62.$low) >>> 0)); + v0 = (x$63 = v1, new $Uint64(v0.$high + x$63.$high, v0.$low + x$63.$low)); + v2 = (x$64 = v3, new $Uint64(v2.$high + x$64.$high, v2.$low + x$64.$low)); + v1 = (x$65 = $shiftLeft64(v1, 13), x$66 = $shiftRightUint64(v1, 51), new $Uint64(x$65.$high | x$66.$high, (x$65.$low | x$66.$low) >>> 0)); + v3 = (x$67 = $shiftLeft64(v3, 16), x$68 = $shiftRightUint64(v3, 48), new $Uint64(x$67.$high | x$68.$high, (x$67.$low | x$68.$low) >>> 0)); + v1 = (x$69 = v0, new $Uint64(v1.$high ^ x$69.$high, (v1.$low ^ x$69.$low) >>> 0)); + v3 = (x$70 = v2, new $Uint64(v3.$high ^ x$70.$high, (v3.$low ^ x$70.$low) >>> 0)); + v0 = (x$71 = $shiftLeft64(v0, 32), x$72 = $shiftRightUint64(v0, 32), new $Uint64(x$71.$high | x$72.$high, (x$71.$low | x$72.$low) >>> 0)); + v2 = (x$73 = v1, new $Uint64(v2.$high + x$73.$high, v2.$low + x$73.$low)); + v0 = (x$74 = v3, new $Uint64(v0.$high + x$74.$high, v0.$low + x$74.$low)); + v1 = (x$75 = $shiftLeft64(v1, 17), x$76 = $shiftRightUint64(v1, 47), new $Uint64(x$75.$high | x$76.$high, (x$75.$low | x$76.$low) >>> 0)); + v3 = (x$77 = $shiftLeft64(v3, 21), x$78 = $shiftRightUint64(v3, 43), new $Uint64(x$77.$high | x$78.$high, (x$77.$low | x$78.$low) >>> 0)); + v1 = (x$79 = v2, new $Uint64(v1.$high ^ x$79.$high, (v1.$low ^ x$79.$low) >>> 0)); + v3 = (x$80 = v0, new $Uint64(v3.$high ^ x$80.$high, (v3.$low ^ x$80.$low) >>> 0)); + v2 = (x$81 = $shiftLeft64(v2, 32), x$82 = $shiftRightUint64(v2, 32), new $Uint64(x$81.$high | x$82.$high, (x$81.$low | x$82.$low) >>> 0)); + v0 = (x$83 = v1, new $Uint64(v0.$high + x$83.$high, v0.$low + x$83.$low)); + v2 = (x$84 = v3, new $Uint64(v2.$high + x$84.$high, v2.$low + x$84.$low)); + v1 = (x$85 = $shiftLeft64(v1, 13), x$86 = $shiftRightUint64(v1, 51), new $Uint64(x$85.$high | x$86.$high, (x$85.$low | x$86.$low) >>> 0)); + v3 = (x$87 = $shiftLeft64(v3, 16), x$88 = $shiftRightUint64(v3, 48), new $Uint64(x$87.$high | x$88.$high, (x$87.$low | x$88.$low) >>> 0)); + v1 = (x$89 = v0, new $Uint64(v1.$high ^ x$89.$high, (v1.$low ^ x$89.$low) >>> 0)); + v3 = (x$90 = v2, new $Uint64(v3.$high ^ x$90.$high, (v3.$low ^ x$90.$low) >>> 0)); + v0 = (x$91 = $shiftLeft64(v0, 32), x$92 = $shiftRightUint64(v0, 32), new $Uint64(x$91.$high | x$92.$high, (x$91.$low | x$92.$low) >>> 0)); + v2 = (x$93 = v1, new $Uint64(v2.$high + x$93.$high, v2.$low + x$93.$low)); + v0 = (x$94 = v3, new $Uint64(v0.$high + x$94.$high, v0.$low + x$94.$low)); + v1 = (x$95 = $shiftLeft64(v1, 17), x$96 = $shiftRightUint64(v1, 47), new $Uint64(x$95.$high | x$96.$high, (x$95.$low | x$96.$low) >>> 0)); + v3 = (x$97 = $shiftLeft64(v3, 21), x$98 = $shiftRightUint64(v3, 43), new $Uint64(x$97.$high | x$98.$high, (x$97.$low | x$98.$low) >>> 0)); + v1 = (x$99 = v2, new $Uint64(v1.$high ^ x$99.$high, (v1.$low ^ x$99.$low) >>> 0)); + v3 = (x$100 = v0, new $Uint64(v3.$high ^ x$100.$high, (v3.$low ^ x$100.$low) >>> 0)); + v2 = (x$101 = $shiftLeft64(v2, 32), x$102 = $shiftRightUint64(v2, 32), new $Uint64(x$101.$high | x$102.$high, (x$101.$low | x$102.$low) >>> 0)); + v0 = (x$103 = v1, new $Uint64(v0.$high + x$103.$high, v0.$low + x$103.$low)); + v2 = (x$104 = v3, new $Uint64(v2.$high + x$104.$high, v2.$low + x$104.$low)); + v1 = (x$105 = $shiftLeft64(v1, 13), x$106 = $shiftRightUint64(v1, 51), new $Uint64(x$105.$high | x$106.$high, (x$105.$low | x$106.$low) >>> 0)); + v3 = (x$107 = $shiftLeft64(v3, 16), x$108 = $shiftRightUint64(v3, 48), new $Uint64(x$107.$high | x$108.$high, (x$107.$low | x$108.$low) >>> 0)); + v1 = (x$109 = v0, new $Uint64(v1.$high ^ x$109.$high, (v1.$low ^ x$109.$low) >>> 0)); + v3 = (x$110 = v2, new $Uint64(v3.$high ^ x$110.$high, (v3.$low ^ x$110.$low) >>> 0)); + v0 = (x$111 = $shiftLeft64(v0, 32), x$112 = $shiftRightUint64(v0, 32), new $Uint64(x$111.$high | x$112.$high, (x$111.$low | x$112.$low) >>> 0)); + v2 = (x$113 = v1, new $Uint64(v2.$high + x$113.$high, v2.$low + x$113.$low)); + v0 = (x$114 = v3, new $Uint64(v0.$high + x$114.$high, v0.$low + x$114.$low)); + v1 = (x$115 = $shiftLeft64(v1, 17), x$116 = $shiftRightUint64(v1, 47), new $Uint64(x$115.$high | x$116.$high, (x$115.$low | x$116.$low) >>> 0)); + v3 = (x$117 = $shiftLeft64(v3, 21), x$118 = $shiftRightUint64(v3, 43), new $Uint64(x$117.$high | x$118.$high, (x$117.$low | x$118.$low) >>> 0)); + v1 = (x$119 = v2, new $Uint64(v1.$high ^ x$119.$high, (v1.$low ^ x$119.$low) >>> 0)); + v3 = (x$120 = v0, new $Uint64(v3.$high ^ x$120.$high, (v3.$low ^ x$120.$low) >>> 0)); + v2 = (x$121 = $shiftLeft64(v2, 32), x$122 = $shiftRightUint64(v2, 32), new $Uint64(x$121.$high | x$122.$high, (x$121.$low | x$122.$low) >>> 0)); + return (x$123 = (x$124 = new $Uint64(v0.$high ^ v1.$high, (v0.$low ^ v1.$low) >>> 0), new $Uint64(x$124.$high ^ v2.$high, (x$124.$low ^ v2.$low) >>> 0)), new $Uint64(x$123.$high ^ v3.$high, (x$123.$low ^ v3.$low) >>> 0)); + }; + Cuckoo.prototype.siphash24 = function(nonce) { return this.$val.siphash24(nonce); }; + Cuckoo.ptr.prototype.Sipnode = function(nonce, uorv) { + var $ptr, nonce, self, uorv, x, x$1, x$2; + self = this; + return (x = self.siphash24((x$1 = $mul64(new $Uint64(0, 2), nonce), x$2 = new $Uint64(0, uorv), new $Uint64(x$1.$high + x$2.$high, x$1.$low + x$2.$low))), new $Uint64(x.$high & 0, (x.$low & 524287) >>> 0)); + }; + Cuckoo.prototype.Sipnode = function(nonce, uorv) { return this.$val.Sipnode(nonce, uorv); }; + Cuckoo.ptr.prototype.Verify = function(nonces, easiness) { + var $ptr, easiness, i, j, k, k$1, loop, n, nonces, self, us, vs, x, x$1, x$10, x$11, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + self = this; + us = $makeSlice(sliceType, 42); + vs = $makeSlice(sliceType, 42); + i = 0; + n = new $Uint64(0, 0); + n = new $Uint64(0, 0); + while (true) { + if (!((n.$high < 0 || (n.$high === 0 && n.$low < 42)))) { break; } + if ((x = (($flatten64(n) < 0 || $flatten64(n) >= nonces.$length) ? $throwRuntimeError("index out of range") : nonces.$array[nonces.$offset + $flatten64(n)]), (x.$high > easiness.$high || (x.$high === easiness.$high && x.$low >= easiness.$low))) || (!((n.$high === 0 && n.$low === 0)) && (x$1 = (($flatten64(n) < 0 || $flatten64(n) >= nonces.$length) ? $throwRuntimeError("index out of range") : nonces.$array[nonces.$offset + $flatten64(n)]), x$2 = (x$3 = new $Uint64(n.$high - 0, n.$low - 1), (($flatten64(x$3) < 0 || $flatten64(x$3) >= nonces.$length) ? $throwRuntimeError("index out of range") : nonces.$array[nonces.$offset + $flatten64(x$3)])), (x$1.$high < x$2.$high || (x$1.$high === x$2.$high && x$1.$low <= x$2.$low))))) { + return false; + } + (($flatten64(n) < 0 || $flatten64(n) >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + $flatten64(n)] = self.Sipnode((($flatten64(n) < 0 || $flatten64(n) >= nonces.$length) ? $throwRuntimeError("index out of range") : nonces.$array[nonces.$offset + $flatten64(n)]), 0)); + (($flatten64(n) < 0 || $flatten64(n) >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + $flatten64(n)] = self.Sipnode((($flatten64(n) < 0 || $flatten64(n) >= nonces.$length) ? $throwRuntimeError("index out of range") : nonces.$array[nonces.$offset + $flatten64(n)]), 1)); + n = (x$4 = new $Uint64(0, 1), new $Uint64(n.$high + x$4.$high, n.$low + x$4.$low)); + } + loop = true; + while (true) { + if (!(loop)) { break; } + j = i; + k = 0; + while (true) { + if (!((x$5 = new $Uint64(0, k), (x$5.$high < 0 || (x$5.$high === 0 && x$5.$low < 42))))) { break; } + if (!((k === i)) && (x$6 = ((k < 0 || k >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + k]), x$7 = ((i < 0 || i >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + i]), (x$6.$high === x$7.$high && x$6.$low === x$7.$low))) { + if (!((j === i))) { + return false; + } + j = k; + } + k = k + (1) >> 0; + } + if (j === i) { + return false; + } + i = j; + k$1 = 0; + while (true) { + if (!((x$8 = new $Uint64(0, k$1), (x$8.$high < 0 || (x$8.$high === 0 && x$8.$low < 42))))) { break; } + if (!((k$1 === j)) && (x$9 = ((k$1 < 0 || k$1 >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + k$1]), x$10 = ((j < 0 || j >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + j]), (x$9.$high === x$10.$high && x$9.$low === x$10.$low))) { + if (!((i === j))) { + return false; + } + i = k$1; + } + k$1 = k$1 + (1) >> 0; + } + if (i === j) { + return false; + } + n = (x$11 = new $Uint64(0, 2), new $Uint64(n.$high - x$11.$high, n.$low - x$11.$low)); + loop = !((i === 0)); + } + return (n.$high === 0 && n.$low === 0); + }; + Cuckoo.prototype.Verify = function(nonces, easiness) { return this.$val.Verify(nonces, easiness); }; + EncodeCuckooJSON = function(cuck) { + var $ptr, _r, cuck, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; cuck = $f.cuck; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + cuck = $clone(cuck, CuckooJSON); + _r = json.Marshal(new cuck.constructor.elem(cuck)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + /* */ $s = 2; case 2: + return _r; + /* */ } return; } if ($f === undefined) { $f = { $blk: EncodeCuckooJSON }; } $f.$ptr = $ptr; $f._r = _r; $f.cuck = cuck; $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.EncodeCuckooJSON = EncodeCuckooJSON; + ptrType$2.methods = [{prop: "Sipedge", name: "Sipedge", pkg: "", typ: $funcType([$Uint64], [ptrType$1], false)}, {prop: "siphash24", name: "siphash24", pkg: "github.com/ZiRo-/cuckgo/cuckoo", typ: $funcType([$Uint64], [$Uint64], false)}, {prop: "Sipnode", name: "Sipnode", pkg: "", typ: $funcType([$Uint64, $Uint32], [$Uint64], false)}, {prop: "Verify", name: "Verify", pkg: "", typ: $funcType([sliceType, $Uint64], [$Bool], false)}]; + ptrType$1.methods = [{prop: "HashCode", name: "HashCode", pkg: "", typ: $funcType([], [$Int], false)}]; + Cuckoo.init([{prop: "v", name: "v", pkg: "github.com/ZiRo-/cuckgo/cuckoo", typ: arrayType$1, tag: ""}]); + Edge.init([{prop: "U", name: "U", pkg: "", typ: $Uint64, tag: ""}, {prop: "V", name: "V", pkg: "", typ: $Uint64, tag: ""}]); + CuckooJSON.init([{prop: "Parameter", name: "Parameter", pkg: "", typ: mapType, tag: "json:\"parameters\""}, {prop: "InputData", name: "InputData", pkg: "", typ: sliceType$1, tag: "json:\"header\""}, {prop: "Cycle", name: "Cycle", pkg: "", typ: sliceType, tag: "json:\"cycle\""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = sha256.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = json.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$packages["main"] = (function() { + var $pkg = {}, $init, rand, sha256, base64, cuckoo, js, CuckooSolve, ptrType, sliceType, sliceType$1, ptrType$1, sliceType$2, arrayType, sliceType$3, funcType, mapType, ptrType$2, NewCuckooSolve, contains, worker, mine_cuckoo, formatProof, main; + rand = $packages["crypto/rand"]; + sha256 = $packages["crypto/sha256"]; + base64 = $packages["encoding/base64"]; + cuckoo = $packages["github.com/ZiRo-/cuckgo/cuckoo"]; + js = $packages["github.com/gopherjs/gopherjs/js"]; + CuckooSolve = $pkg.CuckooSolve = $newType(0, $kindStruct, "main.CuckooSolve", "CuckooSolve", "main", function(graph_, easiness_, cuckoo_, sols_, nsols_, nthreads_) { + this.$val = this; + if (arguments.length === 0) { + this.graph = ptrType.nil; + this.easiness = 0; + this.cuckoo = sliceType.nil; + this.sols = sliceType$1.nil; + this.nsols = 0; + this.nthreads = 0; + return; + } + this.graph = graph_; + this.easiness = easiness_; + this.cuckoo = cuckoo_; + this.sols = sols_; + this.nsols = nsols_; + this.nthreads = nthreads_; + }); + ptrType = $ptrType(cuckoo.Cuckoo); + sliceType = $sliceType($Int); + sliceType$1 = $sliceType(sliceType); + ptrType$1 = $ptrType(cuckoo.Edge); + sliceType$2 = $sliceType($Uint8); + arrayType = $arrayType($Uint8, 32); + sliceType$3 = $sliceType($Uint64); + funcType = $funcType([$Float64], [$String], false); + mapType = $mapType($String, $emptyInterface); + ptrType$2 = $ptrType(CuckooSolve); + NewCuckooSolve = function(hdr, en, ms, nt) { + var $ptr, _i, _ref, en, hdr, i, ms, nt, self, x; + self = new CuckooSolve.ptr(cuckoo.NewCuckoo(hdr), en, $makeSlice(sliceType, 1048577), $makeSlice(sliceType$1, ($imul(2, ms))), 0, 1); + _ref = self.sols; + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + (x = self.sols, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i] = $makeSlice(sliceType, 42))); + _i++; + } + return self; + }; + $pkg.NewCuckooSolve = NewCuckooSolve; + CuckooSolve.ptr.prototype.path = function(u, us) { + var $ptr, nu, self, u, us, x, x$1; + self = this; + nu = 0; + nu = 0; + while (true) { + if (!(!((u === 0)))) { break; } + nu = nu + (1) >> 0; + if (nu >= 4096) { + while (true) { + if (!(!((nu === 0)) && !(((x = nu - 1 >> 0, ((x < 0 || x >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + x])) === u)))) { break; } + nu = nu - (1) >> 0; + } + if (nu < 0) { + } else { + } + return -1; + } + ((nu < 0 || nu >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + nu] = u); + u = (x$1 = self.cuckoo, ((u < 0 || u >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + u])); + } + return nu; + }; + CuckooSolve.prototype.path = function(u, us) { return this.$val.path(u, us); }; + CuckooSolve.ptr.prototype.solution = function(us, nu, vs, nv) { + var $ptr, _entry, _entry$1, _key, _key$1, _key$2, _tuple, _tuple$1, _tuple$2, cycle, e, edg, edg$1, edg$2, has, has$1, has$2, key, n, nonce, nu, nv, self, us, vs, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + self = this; + cycle = {}; + n = 0; + edg = new cuckoo.Edge.ptr(new $Uint64(0, (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0])), (x = new $Uint64(0, (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0])), new $Uint64(x.$high - 0, x.$low - 524288))); + _key = edg.HashCode(); (cycle || $throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(_key)] = { k: _key, v: edg }; + while (true) { + if (!(!((nu === 0)))) { break; } + nu = nu - (1) >> 0; + edg$1 = new cuckoo.Edge.ptr(new $Uint64(0, (x$1 = (((nu + 1 >> 0)) & ~1) >> 0, ((x$1 < 0 || x$1 >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + x$1]))), (x$2 = new $Uint64(0, (x$3 = nu | 1, ((x$3 < 0 || x$3 >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + x$3]))), new $Uint64(x$2.$high - 0, x$2.$low - 524288))); + _tuple = (_entry = cycle[$Int.keyFor(edg$1.HashCode())], _entry !== undefined ? [_entry.v, true] : [ptrType$1.nil, false]); + has = _tuple[1]; + if (!has) { + _key$1 = edg$1.HashCode(); (cycle || $throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(_key$1)] = { k: _key$1, v: edg$1 }; + } + } + while (true) { + if (!(!((nv === 0)))) { break; } + nv = nv - (1) >> 0; + edg$2 = new cuckoo.Edge.ptr(new $Uint64(0, (x$4 = nv | 1, ((x$4 < 0 || x$4 >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + x$4]))), (x$5 = new $Uint64(0, (x$6 = (((nv + 1 >> 0)) & ~1) >> 0, ((x$6 < 0 || x$6 >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + x$6]))), new $Uint64(x$5.$high - 0, x$5.$low - 524288))); + _tuple$1 = (_entry$1 = cycle[$Int.keyFor(edg$2.HashCode())], _entry$1 !== undefined ? [_entry$1.v, true] : [ptrType$1.nil, false]); + has$1 = _tuple$1[1]; + if (!has$1) { + _key$2 = edg$2.HashCode(); (cycle || $throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(_key$2)] = { k: _key$2, v: edg$2 }; + } + } + n = 0; + nonce = 0; + while (true) { + if (!(nonce < self.easiness)) { break; } + e = self.graph.Sipedge(new $Uint64(0, nonce)); + _tuple$2 = contains(cycle, e); + has$2 = _tuple$2[0]; + key = _tuple$2[1]; + if (has$2) { + (x$7 = (x$8 = self.sols, x$9 = self.nsols, ((x$9 < 0 || x$9 >= x$8.$length) ? $throwRuntimeError("index out of range") : x$8.$array[x$8.$offset + x$9])), ((n < 0 || n >= x$7.$length) ? $throwRuntimeError("index out of range") : x$7.$array[x$7.$offset + n] = nonce)); + n = n + (1) >> 0; + delete cycle[$Int.keyFor(key)]; + } + nonce = nonce + (1) >> 0; + } + if ((x$10 = new $Uint64(0, n), (x$10.$high === 0 && x$10.$low === 42))) { + self.nsols = self.nsols + (1) >> 0; + } else { + } + }; + CuckooSolve.prototype.solution = function(us, nu, vs, nv) { return this.$val.solution(us, nu, vs, nv); }; + contains = function(m, e) { + var $ptr, _entry, _i, _keys, _ref, e, h, k, m, v, x, x$1, x$2, x$3; + h = e.HashCode(); + _ref = m; + _i = 0; + _keys = $keys(_ref); + while (true) { + if (!(_i < _keys.length)) { break; } + _entry = _ref[_keys[_i]]; + if (_entry === undefined) { + _i++; + continue; + } + k = _entry.k; + v = _entry.v; + if ((k === h) && (x = v.U, x$1 = e.U, (x.$high === x$1.$high && x.$low === x$1.$low)) && (x$2 = v.V, x$3 = e.V, (x$2.$high === x$3.$high && x$2.$low === x$3.$low))) { + return [true, k]; + } + _i++; + } + return [false, 0]; + }; + worker = function(id, solve) { + var $ptr, cuck, id, length, min, nonce, nu, nv, solve, u, us, v, vs, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; + cuck = solve.cuckoo; + us = $makeSlice(sliceType, 4096); + vs = $makeSlice(sliceType, 4096); + nonce = id; + while (true) { + if (!(nonce < solve.easiness)) { break; } + (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0] = (solve.graph.Sipnode(new $Uint64(0, nonce), 0).$low >> 0)); + u = (x = (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0]), ((x < 0 || x >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x])); + (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0] = ((x$1 = solve.graph.Sipnode(new $Uint64(0, nonce), 1), new $Uint64(0 + x$1.$high, 524288 + x$1.$low)).$low >> 0)); + v = (x$2 = (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0]), ((x$2 < 0 || x$2 >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x$2])); + if ((u === (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0])) || (v === (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0]))) { + nonce = nonce + (solve.nthreads) >> 0; + continue; + } + nu = solve.path(u, us); + nv = solve.path(v, vs); + if ((nu === -1) || (nv === -1)) { + return; + } + if (((nu < 0 || nu >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + nu]) === ((nv < 0 || nv >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + nv])) { + min = 0; + if (nu < nv) { + min = nu; + } else { + min = nv; + } + nu = nu - (min) >> 0; + nv = nv - (min) >> 0; + while (true) { + if (!(!((((nu < 0 || nu >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + nu]) === ((nv < 0 || nv >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + nv]))))) { break; } + nu = nu + (1) >> 0; + nv = nv + (1) >> 0; + } + length = (nu + nv >> 0) + 1 >> 0; + if ((x$3 = new $Uint64(0, length), (x$3.$high === 0 && x$3.$low === 42)) && solve.nsols < solve.sols.$length) { + solve.solution(us, nu, vs, nv); + } + nonce = nonce + (solve.nthreads) >> 0; + continue; + } + if (nu < nv) { + while (true) { + if (!(!((nu === 0)))) { break; } + nu = nu - (1) >> 0; + (x$4 = (x$5 = nu + 1 >> 0, ((x$5 < 0 || x$5 >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + x$5])), ((x$4 < 0 || x$4 >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x$4] = ((nu < 0 || nu >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + nu]))); + } + (x$6 = (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0]), ((x$6 < 0 || x$6 >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x$6] = (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0]))); + } else { + while (true) { + if (!(!((nv === 0)))) { break; } + nv = nv - (1) >> 0; + (x$7 = (x$8 = nv + 1 >> 0, ((x$8 < 0 || x$8 >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + x$8])), ((x$7 < 0 || x$7 >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x$7] = ((nv < 0 || nv >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + nv]))); + } + (x$9 = (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0]), ((x$9 < 0 || x$9 >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x$9] = (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0]))); + } + nonce = nonce + (solve.nthreads) >> 0; + } + }; + mine_cuckoo = function(easipct) { + var $ptr, _r, _r$1, _tuple, _tuple$1, b, c, easipct, easy, err, i, json, k, maxsols, solve, str, x, $s, $r; + /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; c = $f.c; easipct = $f.easipct; easy = $f.easy; err = $f.err; i = $f.i; json = $f.json; k = $f.k; maxsols = $f.maxsols; solve = $f.solve; str = $f.str; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + maxsols = 8; + b = $makeSlice(sliceType$2, 64); + _r = rand.Read(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } + _tuple = _r; + err = _tuple[1]; + if (!($interfaceIsEqual(err, $ifaceNil))) { + $panic(err); + } + easy = (easipct * 1.048576e+06 / 100 >> 0); + solve = NewCuckooSolve(b, easy, maxsols, 1); + k = 0; + /* while (true) { */ case 2: + /* if (!(k < 960)) { break; } */ if(!(k < 960)) { $s = 3; continue; } + b = $append(b, 0); + i = 0; + /* while (true) { */ case 4: + /* if (!(i < 256)) { break; } */ if(!(i < 256)) { $s = 5; continue; } + (x = 64 + k >> 0, ((x < 0 || x >= b.$length) ? $throwRuntimeError("index out of range") : b.$array[b.$offset + x] = (i << 24 >>> 24))); + solve = NewCuckooSolve(b, easy, maxsols, 1); + worker(i, solve); + /* */ if (solve.nsols > 0) { $s = 6; continue; } + /* */ $s = 7; continue; + /* if (solve.nsols > 0) { */ case 6: + /* goto done */ $s = 8; continue; + /* } */ case 7: + i = i + (1) >> 0; + /* } */ $s = 4; continue; case 5: + k = k + (1) >> 0; + /* } */ $s = 2; continue; case 3: + /* done: */ case 8: + /* */ if (solve.sols.$length > 0) { $s = 9; continue; } + /* */ $s = 10; continue; + /* if (solve.sols.$length > 0) { */ case 9: + c = $clone(formatProof(solve, b), cuckoo.CuckooJSON); + _r$1 = cuckoo.EncodeCuckooJSON(c); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } + _tuple$1 = _r$1; + json = _tuple$1[0]; + str = base64.StdEncoding.EncodeToString(json); + return str; + /* } else { */ case 10: + return "No Solution found."; + /* } */ case 11: + /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: mine_cuckoo }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.c = c; $f.easipct = easipct; $f.easy = easy; $f.err = err; $f.i = i; $f.json = json; $f.k = k; $f.maxsols = maxsols; $f.solve = solve; $f.str = str; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; + }; + formatProof = function(solve, b) { + var $ptr, _i, _key, _ref, b, cycle, easy, i, m, n, sha, solve, x, x$1; + sha = $clone(sha256.Sum256(b), arrayType); + easy = new $Uint64(0, solve.easiness); + cycle = $makeSlice(sliceType$3, (x = solve.sols, (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0])).$length); + m = {}; + _key = "easiness"; (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: easy }; + _ref = (x$1 = solve.sols, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])); + _i = 0; + while (true) { + if (!(_i < _ref.$length)) { break; } + i = _i; + n = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); + ((i < 0 || i >= cycle.$length) ? $throwRuntimeError("index out of range") : cycle.$array[cycle.$offset + i] = new $Uint64(0, n)); + _i++; + } + return new cuckoo.CuckooJSON.ptr(m, new sliceType$2(sha), cycle); + }; + main = function() { + var $ptr; + $global.cuckoo = $externalize($makeMap($String.keyFor, [{ k: "mine_cuckoo", v: new funcType(mine_cuckoo) }]), mapType); + }; + ptrType$2.methods = [{prop: "path", name: "path", pkg: "main", typ: $funcType([$Int, sliceType], [$Int], false)}, {prop: "solution", name: "solution", pkg: "main", typ: $funcType([sliceType, $Int, sliceType, $Int], [], false)}]; + CuckooSolve.init([{prop: "graph", name: "graph", pkg: "main", typ: ptrType, tag: ""}, {prop: "easiness", name: "easiness", pkg: "main", typ: $Int, tag: ""}, {prop: "cuckoo", name: "cuckoo", pkg: "main", typ: sliceType, tag: ""}, {prop: "sols", name: "sols", pkg: "main", typ: sliceType$1, tag: ""}, {prop: "nsols", name: "nsols", pkg: "main", typ: $Int, tag: ""}, {prop: "nthreads", name: "nthreads", pkg: "main", typ: $Int, tag: ""}]); + $init = function() { + $pkg.$init = function() {}; + /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: + $r = rand.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = sha256.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = base64.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = cuckoo.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + $r = js.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } + if ($pkg === $mainPkg) { + main(); + $mainFinished = true; + } + /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; + }; + $pkg.$init = $init; + return $pkg; +})(); +$synthesizeMethods(); +var $mainPkg = $packages["main"]; +$packages["runtime"].$init(); +$go($mainPkg.$init, [], true); +$flushConsole(); + +}).call(this); +//# sourceMappingURL=miner-js.js.map diff --git a/contrib/static/mineworker.js b/contrib/static/mineworker.js new file mode 100644 index 0000000..e9b3efb --- /dev/null +++ b/contrib/static/mineworker.js @@ -0,0 +1,6 @@ +importScripts('./miner-js.js'); + +onmessage = function(e) { + var s = cuckoo["mine_cuckoo"](e.data); + postMessage(s); +} diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index dd74106..d1acaf7 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -619,6 +619,9 @@ function nntpchan_buildpost(parent,j){var post=document.createElement("div");if( parent.appendChild(post);} /* local file: ./contrib/js/banner.js */ var banner_count=3;function nntpchan_inject_banners(elem,prefix){var n=Math.floor(Math.random()*banner_count);var banner=prefix+"static/banner_"+n+".jpg";var e=document.createElement("img");e.src=banner;e.id="nntpchan_banner";elem.appendChild(e);} +/* local file: ./contrib/js/cuckoo_miner.js */ +onready(function(){document.getElementById("start_miner").onclick=function(){var worker=new Worker("./static/mineworker.js");worker.onmessage=function(e){miner_cb(e.data);worker.terminate();} +worker.postMessage(55.0);};});function miner_cb(s){document.getElementById("miner_result").value=s;} /* local file: ./contrib/js/expand-image.js */ function filenameIsImage(fname){return/\.(gif|jpeg|jpg|png|webp)/.test(fname.toLowerCase());} function setupInlineImage(thumb,url){if(thumb.inlineIsSetUp)return;thumb.inlineIsSetUp=true;var img=thumb.querySelector("img.thumbnail");var expanded=false;var oldurl=img.src;thumb.onclick=function(){if(expanded){img.setAttribute("class","thumbnail");img.src=oldurl;expanded=false;}else{img.setAttribute("class","expanded-thumbnail");img.src=url;expanded=true;} diff --git a/contrib/templates/default/postform.mustache b/contrib/templates/default/postform.mustache index 59bf2d9..e67c4a5 100644 --- a/contrib/templates/default/postform.mustache +++ b/contrib/templates/default/postform.mustache @@ -77,6 +77,14 @@ + + + {{#i18n.Translations}}{{cuckoo_pow}}{{/i18n.Translations}} + + + + + diff --git a/contrib/translations/en-US.ini b/contrib/translations/en-US.ini index eae395c..95bb12d 100644 --- a/contrib/translations/en-US.ini +++ b/contrib/translations/en-US.ini @@ -171,3 +171,6 @@ secretkey_name=Secret key key_install_title=A new keypair has been generated for you. Please keep it safe and don't share it with anyone, as this is used to login to the mod panel #' +cuckoo_pow=Proof of Work +start_mining=Mine! + From 941c4a3a9f8373b5ab445ee46086f29d1a9e24f1 Mon Sep 17 00:00:00 2001 From: ZiRo Date: Tue, 17 May 2016 08:55:21 +0200 Subject: [PATCH 2/3] indicate mining process --- contrib/js/cuckoo_miner.js | 6 ++++++ contrib/static/nntpchan.js | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/js/cuckoo_miner.js b/contrib/js/cuckoo_miner.js index fee545d..ed7244f 100644 --- a/contrib/js/cuckoo_miner.js +++ b/contrib/js/cuckoo_miner.js @@ -1,8 +1,14 @@ onready(function(){ document.getElementById("start_miner").onclick = function() { + var btn = document.getElementById("start_miner"); + var label = btn.value; + btn.value = "..." + btn.disabled = true; var worker = new Worker("./static/mineworker.js"); worker.onmessage = function(e) { miner_cb(e.data); + btn.value=label; + btn.disabled = false; worker.terminate(); } worker.postMessage(55.0); // Start the worker. diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index d1acaf7..017995f 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -620,7 +620,8 @@ parent.appendChild(post);} /* local file: ./contrib/js/banner.js */ var banner_count=3;function nntpchan_inject_banners(elem,prefix){var n=Math.floor(Math.random()*banner_count);var banner=prefix+"static/banner_"+n+".jpg";var e=document.createElement("img");e.src=banner;e.id="nntpchan_banner";elem.appendChild(e);} /* local file: ./contrib/js/cuckoo_miner.js */ -onready(function(){document.getElementById("start_miner").onclick=function(){var worker=new Worker("./static/mineworker.js");worker.onmessage=function(e){miner_cb(e.data);worker.terminate();} +onready(function(){document.getElementById("start_miner").onclick=function(){var btn=document.getElementById("start_miner");var label=btn.value;btn.value="..." +btn.disabled=true;var worker=new Worker("./static/mineworker.js");worker.onmessage=function(e){miner_cb(e.data);btn.value=label;btn.disabled=false;worker.terminate();} worker.postMessage(55.0);};});function miner_cb(s){document.getElementById("miner_result").value=s;} /* local file: ./contrib/js/expand-image.js */ function filenameIsImage(fname){return/\.(gif|jpeg|jpg|png|webp)/.test(fname.toLowerCase());} From c2bd325be6bc6603dee4e020ebbb7a8f87101183 Mon Sep 17 00:00:00 2001 From: ZiRo Date: Tue, 17 May 2016 13:27:29 +0200 Subject: [PATCH 3/3] add miner.js to build.sh --- build.sh | 14 + contrib/static/miner-js.js | 27670 +---------------------------------- 2 files changed, 56 insertions(+), 27628 deletions(-) diff --git a/build.sh b/build.sh index e29c819..d3cc70c 100755 --- a/build.sh +++ b/build.sh @@ -22,6 +22,7 @@ done rev="QmPAqM7anxdr1ngPmJz9J9AAxDLinDz2Eh9aAzLF9T7LNa" ipfs="no" +cuckoo="no" _next="" # check for build flags for arg in $@ ; do @@ -29,6 +30,9 @@ for arg in $@ ; do "--ipfs") ipfs="yes" ;; + "--cuckoo") + cuckoo="yes" + ;; "--disable-redis") tags="$tags -tags disable_redis" ;; @@ -76,4 +80,14 @@ else go get -u -v github.com/majestrate/srndv2 cp $GOPATH/bin/srndv2 $root fi + +if [ "x$cuckoo" == "xyes" ] ; then + echo "building cucko miner js" + go get -v -u github.com/gopherjs/gopherjs + go get -v -u github.com/ZiRo-/cuckgo/miner_js + gopherjs -m -v build github.com/ZiRo-/cuckgo/miner_js + mv ./miner_js.js ./contrib/static/miner-js.js + rm ./miner_js.js.map +fi + echo "Built" diff --git a/contrib/static/miner-js.js b/contrib/static/miner-js.js index adb7c3b..d3a1890 100644 --- a/contrib/static/miner-js.js +++ b/contrib/static/miner-js.js @@ -1,27637 +1,51 @@ "use strict"; (function() { -Error.stackTraceLimit = Infinity; - -var $global, $module; -if (typeof window !== "undefined") { /* web page */ - $global = window; -} else if (typeof self !== "undefined") { /* web worker */ - $global = self; -} else if (typeof global !== "undefined") { /* Node.js */ - $global = global; - $global.require = require; -} else { /* others (e.g. Nashorn) */ - $global = this; -} - -if ($global === undefined || $global.Array === undefined) { - throw new Error("no global object found"); -} -if (typeof module !== "undefined") { - $module = module; -} - -var $packages = {}, $idCounter = 0; -var $keys = function(m) { return m ? Object.keys(m) : []; }; -var $flushConsole = function() {}; -var $throwRuntimeError; /* set by package "runtime" */ -var $throwNilPointerError = function() { $throwRuntimeError("invalid memory address or nil pointer dereference"); }; -var $call = function(fn, rcvr, args) { return fn.apply(rcvr, args); }; -var $makeFunc = function(fn) { return function() { return fn(new ($sliceType($jsObjectPtr))($global.Array.prototype.slice.call(arguments, []))); } }; - -var $mapArray = function(array, f) { - var newArray = new array.constructor(array.length); - for (var i = 0; i < array.length; i++) { - newArray[i] = f(array[i]); - } - return newArray; -}; - -var $methodVal = function(recv, name) { - var vals = recv.$methodVals || {}; - recv.$methodVals = vals; /* noop for primitives */ - var f = vals[name]; - if (f !== undefined) { - return f; - } - var method = recv[name]; - f = function() { - $stackDepthOffset--; - try { - return method.apply(recv, arguments); - } finally { - $stackDepthOffset++; - } - }; - vals[name] = f; - return f; -}; - -var $methodExpr = function(typ, name) { - var method = typ.prototype[name]; - if (method.$expr === undefined) { - method.$expr = function() { - $stackDepthOffset--; - try { - if (typ.wrapped) { - arguments[0] = new typ(arguments[0]); - } - return Function.call.apply(method, arguments); - } finally { - $stackDepthOffset++; - } - }; - } - return method.$expr; -}; - -var $ifaceMethodExprs = {}; -var $ifaceMethodExpr = function(name) { - var expr = $ifaceMethodExprs["$" + name]; - if (expr === undefined) { - expr = $ifaceMethodExprs["$" + name] = function() { - $stackDepthOffset--; - try { - return Function.call.apply(arguments[0][name], arguments); - } finally { - $stackDepthOffset++; - } - }; - } - return expr; -}; - -var $subslice = function(slice, low, high, max) { - if (low < 0 || high < low || max < high || high > slice.$capacity || max > slice.$capacity) { - $throwRuntimeError("slice bounds out of range"); - } - var s = new slice.constructor(slice.$array); - s.$offset = slice.$offset + low; - s.$length = slice.$length - low; - s.$capacity = slice.$capacity - low; - if (high !== undefined) { - s.$length = high - low; - } - if (max !== undefined) { - s.$capacity = max - low; - } - return s; -}; - -var $sliceToArray = function(slice) { - if (slice.$length === 0) { - return []; - } - if (slice.$array.constructor !== Array) { - return slice.$array.subarray(slice.$offset, slice.$offset + slice.$length); - } - return slice.$array.slice(slice.$offset, slice.$offset + slice.$length); -}; - -var $decodeRune = function(str, pos) { - var c0 = str.charCodeAt(pos); - - if (c0 < 0x80) { - return [c0, 1]; - } - - if (c0 !== c0 || c0 < 0xC0) { - return [0xFFFD, 1]; - } - - var c1 = str.charCodeAt(pos + 1); - if (c1 !== c1 || c1 < 0x80 || 0xC0 <= c1) { - return [0xFFFD, 1]; - } - - if (c0 < 0xE0) { - var r = (c0 & 0x1F) << 6 | (c1 & 0x3F); - if (r <= 0x7F) { - return [0xFFFD, 1]; - } - return [r, 2]; - } - - var c2 = str.charCodeAt(pos + 2); - if (c2 !== c2 || c2 < 0x80 || 0xC0 <= c2) { - return [0xFFFD, 1]; - } - - if (c0 < 0xF0) { - var r = (c0 & 0x0F) << 12 | (c1 & 0x3F) << 6 | (c2 & 0x3F); - if (r <= 0x7FF) { - return [0xFFFD, 1]; - } - if (0xD800 <= r && r <= 0xDFFF) { - return [0xFFFD, 1]; - } - return [r, 3]; - } - - var c3 = str.charCodeAt(pos + 3); - if (c3 !== c3 || c3 < 0x80 || 0xC0 <= c3) { - return [0xFFFD, 1]; - } - - if (c0 < 0xF8) { - var r = (c0 & 0x07) << 18 | (c1 & 0x3F) << 12 | (c2 & 0x3F) << 6 | (c3 & 0x3F); - if (r <= 0xFFFF || 0x10FFFF < r) { - return [0xFFFD, 1]; - } - return [r, 4]; - } - - return [0xFFFD, 1]; -}; - -var $encodeRune = function(r) { - if (r < 0 || r > 0x10FFFF || (0xD800 <= r && r <= 0xDFFF)) { - r = 0xFFFD; - } - if (r <= 0x7F) { - return String.fromCharCode(r); - } - if (r <= 0x7FF) { - return String.fromCharCode(0xC0 | r >> 6, 0x80 | (r & 0x3F)); - } - if (r <= 0xFFFF) { - return String.fromCharCode(0xE0 | r >> 12, 0x80 | (r >> 6 & 0x3F), 0x80 | (r & 0x3F)); - } - return String.fromCharCode(0xF0 | r >> 18, 0x80 | (r >> 12 & 0x3F), 0x80 | (r >> 6 & 0x3F), 0x80 | (r & 0x3F)); -}; - -var $stringToBytes = function(str) { - var array = new Uint8Array(str.length); - for (var i = 0; i < str.length; i++) { - array[i] = str.charCodeAt(i); - } - return array; -}; - -var $bytesToString = function(slice) { - if (slice.$length === 0) { - return ""; - } - var str = ""; - for (var i = 0; i < slice.$length; i += 10000) { - str += String.fromCharCode.apply(undefined, slice.$array.subarray(slice.$offset + i, slice.$offset + Math.min(slice.$length, i + 10000))); - } - return str; -}; - -var $stringToRunes = function(str) { - var array = new Int32Array(str.length); - var rune, j = 0; - for (var i = 0; i < str.length; i += rune[1], j++) { - rune = $decodeRune(str, i); - array[j] = rune[0]; - } - return array.subarray(0, j); -}; - -var $runesToString = function(slice) { - if (slice.$length === 0) { - return ""; - } - var str = ""; - for (var i = 0; i < slice.$length; i++) { - str += $encodeRune(slice.$array[slice.$offset + i]); - } - return str; -}; - -var $copyString = function(dst, src) { - var n = Math.min(src.length, dst.$length); - for (var i = 0; i < n; i++) { - dst.$array[dst.$offset + i] = src.charCodeAt(i); - } - return n; -}; - -var $copySlice = function(dst, src) { - var n = Math.min(src.$length, dst.$length); - $copyArray(dst.$array, src.$array, dst.$offset, src.$offset, n, dst.constructor.elem); - return n; -}; - -var $copyArray = function(dst, src, dstOffset, srcOffset, n, elem) { - if (n === 0 || (dst === src && dstOffset === srcOffset)) { - return; - } - - if (src.subarray) { - dst.set(src.subarray(srcOffset, srcOffset + n), dstOffset); - return; - } - - switch (elem.kind) { - case $kindArray: - case $kindStruct: - if (dst === src && dstOffset > srcOffset) { - for (var i = n - 1; i >= 0; i--) { - elem.copy(dst[dstOffset + i], src[srcOffset + i]); - } - return; - } - for (var i = 0; i < n; i++) { - elem.copy(dst[dstOffset + i], src[srcOffset + i]); - } - return; - } - - if (dst === src && dstOffset > srcOffset) { - for (var i = n - 1; i >= 0; i--) { - dst[dstOffset + i] = src[srcOffset + i]; - } - return; - } - for (var i = 0; i < n; i++) { - dst[dstOffset + i] = src[srcOffset + i]; - } -}; - -var $clone = function(src, type) { - var clone = type.zero(); - type.copy(clone, src); - return clone; -}; - -var $pointerOfStructConversion = function(obj, type) { - if(obj.$proxies === undefined) { - obj.$proxies = {}; - obj.$proxies[obj.constructor.string] = obj; - } - var proxy = obj.$proxies[type.string]; - if (proxy === undefined) { - var properties = {}; - for (var i = 0; i < type.elem.fields.length; i++) { - (function(fieldProp) { - properties[fieldProp] = { - get: function() { return obj[fieldProp]; }, - set: function(value) { obj[fieldProp] = value; } - }; - })(type.elem.fields[i].prop); - } - proxy = Object.create(type.prototype, properties); - proxy.$val = proxy; - obj.$proxies[type.string] = proxy; - proxy.$proxies = obj.$proxies; - } - return proxy; -}; - -var $append = function(slice) { - return $internalAppend(slice, arguments, 1, arguments.length - 1); -}; - -var $appendSlice = function(slice, toAppend) { - if (toAppend.constructor === String) { - var bytes = $stringToBytes(toAppend); - return $internalAppend(slice, bytes, 0, bytes.length); - } - return $internalAppend(slice, toAppend.$array, toAppend.$offset, toAppend.$length); -}; - -var $internalAppend = function(slice, array, offset, length) { - if (length === 0) { - return slice; - } - - var newArray = slice.$array; - var newOffset = slice.$offset; - var newLength = slice.$length + length; - var newCapacity = slice.$capacity; - - if (newLength > newCapacity) { - newOffset = 0; - newCapacity = Math.max(newLength, slice.$capacity < 1024 ? slice.$capacity * 2 : Math.floor(slice.$capacity * 5 / 4)); - - if (slice.$array.constructor === Array) { - newArray = slice.$array.slice(slice.$offset, slice.$offset + slice.$length); - newArray.length = newCapacity; - var zero = slice.constructor.elem.zero; - for (var i = slice.$length; i < newCapacity; i++) { - newArray[i] = zero(); - } - } else { - newArray = new slice.$array.constructor(newCapacity); - newArray.set(slice.$array.subarray(slice.$offset, slice.$offset + slice.$length)); - } - } - - $copyArray(newArray, array, newOffset + slice.$length, offset, length, slice.constructor.elem); - - var newSlice = new slice.constructor(newArray); - newSlice.$offset = newOffset; - newSlice.$length = newLength; - newSlice.$capacity = newCapacity; - return newSlice; -}; - -var $equal = function(a, b, type) { - if (type === $jsObjectPtr) { - return a === b; - } - switch (type.kind) { - case $kindComplex64: - case $kindComplex128: - return a.$real === b.$real && a.$imag === b.$imag; - case $kindInt64: - case $kindUint64: - return a.$high === b.$high && a.$low === b.$low; - case $kindArray: - if (a.length !== b.length) { - return false; - } - for (var i = 0; i < a.length; i++) { - if (!$equal(a[i], b[i], type.elem)) { - return false; - } - } - return true; - case $kindStruct: - for (var i = 0; i < type.fields.length; i++) { - var f = type.fields[i]; - if (!$equal(a[f.prop], b[f.prop], f.typ)) { - return false; - } - } - return true; - case $kindInterface: - return $interfaceIsEqual(a, b); - default: - return a === b; - } -}; - -var $interfaceIsEqual = function(a, b) { - if (a === $ifaceNil || b === $ifaceNil) { - return a === b; - } - if (a.constructor !== b.constructor) { - return false; - } - if (a.constructor === $jsObjectPtr) { - return a.object === b.object; - } - if (!a.constructor.comparable) { - $throwRuntimeError("comparing uncomparable type " + a.constructor.string); - } - return $equal(a.$val, b.$val, a.constructor); -}; - -var $min = Math.min; -var $mod = function(x, y) { return x % y; }; -var $parseInt = parseInt; -var $parseFloat = function(f) { - if (f !== undefined && f !== null && f.constructor === Number) { - return f; - } - return parseFloat(f); -}; - -var $froundBuf = new Float32Array(1); -var $fround = Math.fround || function(f) { - $froundBuf[0] = f; - return $froundBuf[0]; -}; - -var $imul = Math.imul || function(a, b) { - var ah = (a >>> 16) & 0xffff; - var al = a & 0xffff; - var bh = (b >>> 16) & 0xffff; - var bl = b & 0xffff; - return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0) >> 0); -}; - -var $floatKey = function(f) { - if (f !== f) { - $idCounter++; - return "NaN$" + $idCounter; - } - return String(f); -}; - -var $flatten64 = function(x) { - return x.$high * 4294967296 + x.$low; -}; - -var $shiftLeft64 = function(x, y) { - if (y === 0) { - return x; - } - if (y < 32) { - return new x.constructor(x.$high << y | x.$low >>> (32 - y), (x.$low << y) >>> 0); - } - if (y < 64) { - return new x.constructor(x.$low << (y - 32), 0); - } - return new x.constructor(0, 0); -}; - -var $shiftRightInt64 = function(x, y) { - if (y === 0) { - return x; - } - if (y < 32) { - return new x.constructor(x.$high >> y, (x.$low >>> y | x.$high << (32 - y)) >>> 0); - } - if (y < 64) { - return new x.constructor(x.$high >> 31, (x.$high >> (y - 32)) >>> 0); - } - if (x.$high < 0) { - return new x.constructor(-1, 4294967295); - } - return new x.constructor(0, 0); -}; - -var $shiftRightUint64 = function(x, y) { - if (y === 0) { - return x; - } - if (y < 32) { - return new x.constructor(x.$high >>> y, (x.$low >>> y | x.$high << (32 - y)) >>> 0); - } - if (y < 64) { - return new x.constructor(0, x.$high >>> (y - 32)); - } - return new x.constructor(0, 0); -}; - -var $mul64 = function(x, y) { - var high = 0, low = 0; - if ((y.$low & 1) !== 0) { - high = x.$high; - low = x.$low; - } - for (var i = 1; i < 32; i++) { - if ((y.$low & 1<>> (32 - i); - low += (x.$low << i) >>> 0; - } - } - for (var i = 0; i < 32; i++) { - if ((y.$high & 1< yHigh) || (xHigh === yHigh && xLow > yLow))) { - yHigh = (yHigh << 1 | yLow >>> 31) >>> 0; - yLow = (yLow << 1) >>> 0; - n++; - } - for (var i = 0; i <= n; i++) { - high = high << 1 | low >>> 31; - low = (low << 1) >>> 0; - if ((xHigh > yHigh) || (xHigh === yHigh && xLow >= yLow)) { - xHigh = xHigh - yHigh; - xLow = xLow - yLow; - if (xLow < 0) { - xHigh--; - xLow += 4294967296; - } - low++; - if (low === 4294967296) { - high++; - low = 0; - } - } - yLow = (yLow >>> 1 | yHigh << (32 - 1)) >>> 0; - yHigh = yHigh >>> 1; - } - - if (returnRemainder) { - return new x.constructor(xHigh * rs, xLow * rs); - } - return new x.constructor(high * s, low * s); -}; - -var $divComplex = function(n, d) { - var ninf = n.$real === Infinity || n.$real === -Infinity || n.$imag === Infinity || n.$imag === -Infinity; - var dinf = d.$real === Infinity || d.$real === -Infinity || d.$imag === Infinity || d.$imag === -Infinity; - var nnan = !ninf && (n.$real !== n.$real || n.$imag !== n.$imag); - var dnan = !dinf && (d.$real !== d.$real || d.$imag !== d.$imag); - if(nnan || dnan) { - return new n.constructor(NaN, NaN); - } - if (ninf && !dinf) { - return new n.constructor(Infinity, Infinity); - } - if (!ninf && dinf) { - return new n.constructor(0, 0); - } - if (d.$real === 0 && d.$imag === 0) { - if (n.$real === 0 && n.$imag === 0) { - return new n.constructor(NaN, NaN); - } - return new n.constructor(Infinity, Infinity); - } - var a = Math.abs(d.$real); - var b = Math.abs(d.$imag); - if (a <= b) { - var ratio = d.$real / d.$imag; - var denom = d.$real * ratio + d.$imag; - return new n.constructor((n.$real * ratio + n.$imag) / denom, (n.$imag * ratio - n.$real) / denom); - } - var ratio = d.$imag / d.$real; - var denom = d.$imag * ratio + d.$real; - return new n.constructor((n.$imag * ratio + n.$real) / denom, (n.$imag - n.$real * ratio) / denom); -}; - -var $kindBool = 1; -var $kindInt = 2; -var $kindInt8 = 3; -var $kindInt16 = 4; -var $kindInt32 = 5; -var $kindInt64 = 6; -var $kindUint = 7; -var $kindUint8 = 8; -var $kindUint16 = 9; -var $kindUint32 = 10; -var $kindUint64 = 11; -var $kindUintptr = 12; -var $kindFloat32 = 13; -var $kindFloat64 = 14; -var $kindComplex64 = 15; -var $kindComplex128 = 16; -var $kindArray = 17; -var $kindChan = 18; -var $kindFunc = 19; -var $kindInterface = 20; -var $kindMap = 21; -var $kindPtr = 22; -var $kindSlice = 23; -var $kindString = 24; -var $kindStruct = 25; -var $kindUnsafePointer = 26; - -var $methodSynthesizers = []; -var $addMethodSynthesizer = function(f) { - if ($methodSynthesizers === null) { - f(); - return; - } - $methodSynthesizers.push(f); -}; -var $synthesizeMethods = function() { - $methodSynthesizers.forEach(function(f) { f(); }); - $methodSynthesizers = null; -}; - -var $ifaceKeyFor = function(x) { - if (x === $ifaceNil) { - return 'nil'; - } - var c = x.constructor; - return c.string + '$' + c.keyFor(x.$val); -}; - -var $identity = function(x) { return x; }; - -var $typeIDCounter = 0; - -var $idKey = function(x) { - if (x.$id === undefined) { - $idCounter++; - x.$id = $idCounter; - } - return String(x.$id); -}; - -var $newType = function(size, kind, string, name, pkg, constructor) { - var typ; - switch(kind) { - case $kindBool: - case $kindInt: - case $kindInt8: - case $kindInt16: - case $kindInt32: - case $kindUint: - case $kindUint8: - case $kindUint16: - case $kindUint32: - case $kindUintptr: - case $kindUnsafePointer: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.keyFor = $identity; - break; - - case $kindString: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.keyFor = function(x) { return "$" + x; }; - break; - - case $kindFloat32: - case $kindFloat64: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.keyFor = function(x) { return $floatKey(x); }; - break; - - case $kindInt64: - typ = function(high, low) { - this.$high = (high + Math.floor(Math.ceil(low) / 4294967296)) >> 0; - this.$low = low >>> 0; - this.$val = this; - }; - typ.keyFor = function(x) { return x.$high + "$" + x.$low; }; - break; - - case $kindUint64: - typ = function(high, low) { - this.$high = (high + Math.floor(Math.ceil(low) / 4294967296)) >>> 0; - this.$low = low >>> 0; - this.$val = this; - }; - typ.keyFor = function(x) { return x.$high + "$" + x.$low; }; - break; - - case $kindComplex64: - typ = function(real, imag) { - this.$real = $fround(real); - this.$imag = $fround(imag); - this.$val = this; - }; - typ.keyFor = function(x) { return x.$real + "$" + x.$imag; }; - break; - - case $kindComplex128: - typ = function(real, imag) { - this.$real = real; - this.$imag = imag; - this.$val = this; - }; - typ.keyFor = function(x) { return x.$real + "$" + x.$imag; }; - break; - - case $kindArray: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.ptr = $newType(4, $kindPtr, "*" + string, "", "", function(array) { - this.$get = function() { return array; }; - this.$set = function(v) { typ.copy(this, v); }; - this.$val = array; - }); - typ.init = function(elem, len) { - typ.elem = elem; - typ.len = len; - typ.comparable = elem.comparable; - typ.keyFor = function(x) { - return Array.prototype.join.call($mapArray(x, function(e) { - return String(elem.keyFor(e)).replace(/\\/g, "\\\\").replace(/\$/g, "\\$"); - }), "$"); - }; - typ.copy = function(dst, src) { - $copyArray(dst, src, 0, 0, src.length, elem); - }; - typ.ptr.init(typ); - Object.defineProperty(typ.ptr.nil, "nilCheck", { get: $throwNilPointerError }); - }; - break; - - case $kindChan: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.keyFor = $idKey; - typ.init = function(elem, sendOnly, recvOnly) { - typ.elem = elem; - typ.sendOnly = sendOnly; - typ.recvOnly = recvOnly; - }; - break; - - case $kindFunc: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.init = function(params, results, variadic) { - typ.params = params; - typ.results = results; - typ.variadic = variadic; - typ.comparable = false; - }; - break; - - case $kindInterface: - typ = { implementedBy: {}, missingMethodFor: {} }; - typ.keyFor = $ifaceKeyFor; - typ.init = function(methods) { - typ.methods = methods; - methods.forEach(function(m) { - $ifaceNil[m.prop] = $throwNilPointerError; - }); - }; - break; - - case $kindMap: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.init = function(key, elem) { - typ.key = key; - typ.elem = elem; - typ.comparable = false; - }; - break; - - case $kindPtr: - typ = constructor || function(getter, setter, target) { - this.$get = getter; - this.$set = setter; - this.$target = target; - this.$val = this; - }; - typ.keyFor = $idKey; - typ.init = function(elem) { - typ.elem = elem; - typ.wrapped = (elem.kind === $kindArray); - typ.nil = new typ($throwNilPointerError, $throwNilPointerError); - }; - break; - - case $kindSlice: - typ = function(array) { - if (array.constructor !== typ.nativeArray) { - array = new typ.nativeArray(array); - } - this.$array = array; - this.$offset = 0; - this.$length = array.length; - this.$capacity = array.length; - this.$val = this; - }; - typ.init = function(elem) { - typ.elem = elem; - typ.comparable = false; - typ.nativeArray = $nativeArray(elem.kind); - typ.nil = new typ([]); - }; - break; - - case $kindStruct: - typ = function(v) { this.$val = v; }; - typ.wrapped = true; - typ.ptr = $newType(4, $kindPtr, "*" + string, "", "", constructor); - typ.ptr.elem = typ; - typ.ptr.prototype.$get = function() { return this; }; - typ.ptr.prototype.$set = function(v) { typ.copy(this, v); }; - typ.init = function(fields) { - typ.fields = fields; - fields.forEach(function(f) { - if (!f.typ.comparable) { - typ.comparable = false; - } - }); - typ.keyFor = function(x) { - var val = x.$val; - return $mapArray(fields, function(f) { - return String(f.typ.keyFor(val[f.prop])).replace(/\\/g, "\\\\").replace(/\$/g, "\\$"); - }).join("$"); - }; - typ.copy = function(dst, src) { - for (var i = 0; i < fields.length; i++) { - var f = fields[i]; - switch (f.typ.kind) { - case $kindArray: - case $kindStruct: - f.typ.copy(dst[f.prop], src[f.prop]); - continue; - default: - dst[f.prop] = src[f.prop]; - continue; - } - } - }; - /* nil value */ - var properties = {}; - fields.forEach(function(f) { - properties[f.prop] = { get: $throwNilPointerError, set: $throwNilPointerError }; - }); - typ.ptr.nil = Object.create(constructor.prototype, properties); - typ.ptr.nil.$val = typ.ptr.nil; - /* methods for embedded fields */ - $addMethodSynthesizer(function() { - var synthesizeMethod = function(target, m, f) { - if (target.prototype[m.prop] !== undefined) { return; } - target.prototype[m.prop] = function() { - var v = this.$val[f.prop]; - if (f.typ === $jsObjectPtr) { - v = new $jsObjectPtr(v); - } - if (v.$val === undefined) { - v = new f.typ(v); - } - return v[m.prop].apply(v, arguments); - }; - }; - fields.forEach(function(f) { - if (f.name === "") { - $methodSet(f.typ).forEach(function(m) { - synthesizeMethod(typ, m, f); - synthesizeMethod(typ.ptr, m, f); - }); - $methodSet($ptrType(f.typ)).forEach(function(m) { - synthesizeMethod(typ.ptr, m, f); - }); - } - }); - }); - }; - break; - - default: - $panic(new $String("invalid kind: " + kind)); - } - - switch (kind) { - case $kindBool: - case $kindMap: - typ.zero = function() { return false; }; - break; - - case $kindInt: - case $kindInt8: - case $kindInt16: - case $kindInt32: - case $kindUint: - case $kindUint8 : - case $kindUint16: - case $kindUint32: - case $kindUintptr: - case $kindUnsafePointer: - case $kindFloat32: - case $kindFloat64: - typ.zero = function() { return 0; }; - break; - - case $kindString: - typ.zero = function() { return ""; }; - break; - - case $kindInt64: - case $kindUint64: - case $kindComplex64: - case $kindComplex128: - var zero = new typ(0, 0); - typ.zero = function() { return zero; }; - break; - - case $kindPtr: - case $kindSlice: - typ.zero = function() { return typ.nil; }; - break; - - case $kindChan: - typ.zero = function() { return $chanNil; }; - break; - - case $kindFunc: - typ.zero = function() { return $throwNilPointerError; }; - break; - - case $kindInterface: - typ.zero = function() { return $ifaceNil; }; - break; - - case $kindArray: - typ.zero = function() { - var arrayClass = $nativeArray(typ.elem.kind); - if (arrayClass !== Array) { - return new arrayClass(typ.len); - } - var array = new Array(typ.len); - for (var i = 0; i < typ.len; i++) { - array[i] = typ.elem.zero(); - } - return array; - }; - break; - - case $kindStruct: - typ.zero = function() { return new typ.ptr(); }; - break; - - default: - $panic(new $String("invalid kind: " + kind)); - } - - typ.id = $typeIDCounter; - $typeIDCounter++; - typ.size = size; - typ.kind = kind; - typ.string = string; - typ.typeName = name; - typ.pkg = pkg; - typ.methods = []; - typ.methodSetCache = null; - typ.comparable = true; - return typ; -}; - -var $methodSet = function(typ) { - if (typ.methodSetCache !== null) { - return typ.methodSetCache; - } - var base = {}; - - var isPtr = (typ.kind === $kindPtr); - if (isPtr && typ.elem.kind === $kindInterface) { - typ.methodSetCache = []; - return []; - } - - var current = [{typ: isPtr ? typ.elem : typ, indirect: isPtr}]; - - var seen = {}; - - while (current.length > 0) { - var next = []; - var mset = []; - - current.forEach(function(e) { - if (seen[e.typ.string]) { - return; - } - seen[e.typ.string] = true; - - if(e.typ.typeName !== "") { - mset = mset.concat(e.typ.methods); - if (e.indirect) { - mset = mset.concat($ptrType(e.typ).methods); - } - } - - switch (e.typ.kind) { - case $kindStruct: - e.typ.fields.forEach(function(f) { - if (f.name === "") { - var fTyp = f.typ; - var fIsPtr = (fTyp.kind === $kindPtr); - next.push({typ: fIsPtr ? fTyp.elem : fTyp, indirect: e.indirect || fIsPtr}); - } - }); - break; - - case $kindInterface: - mset = mset.concat(e.typ.methods); - break; - } - }); - - mset.forEach(function(m) { - if (base[m.name] === undefined) { - base[m.name] = m; - } - }); - - current = next; - } - - typ.methodSetCache = []; - Object.keys(base).sort().forEach(function(name) { - typ.methodSetCache.push(base[name]); - }); - return typ.methodSetCache; -}; - -var $Bool = $newType( 1, $kindBool, "bool", "bool", "", null); -var $Int = $newType( 4, $kindInt, "int", "int", "", null); -var $Int8 = $newType( 1, $kindInt8, "int8", "int8", "", null); -var $Int16 = $newType( 2, $kindInt16, "int16", "int16", "", null); -var $Int32 = $newType( 4, $kindInt32, "int32", "int32", "", null); -var $Int64 = $newType( 8, $kindInt64, "int64", "int64", "", null); -var $Uint = $newType( 4, $kindUint, "uint", "uint", "", null); -var $Uint8 = $newType( 1, $kindUint8, "uint8", "uint8", "", null); -var $Uint16 = $newType( 2, $kindUint16, "uint16", "uint16", "", null); -var $Uint32 = $newType( 4, $kindUint32, "uint32", "uint32", "", null); -var $Uint64 = $newType( 8, $kindUint64, "uint64", "uint64", "", null); -var $Uintptr = $newType( 4, $kindUintptr, "uintptr", "uintptr", "", null); -var $Float32 = $newType( 4, $kindFloat32, "float32", "float32", "", null); -var $Float64 = $newType( 8, $kindFloat64, "float64", "float64", "", null); -var $Complex64 = $newType( 8, $kindComplex64, "complex64", "complex64", "", null); -var $Complex128 = $newType(16, $kindComplex128, "complex128", "complex128", "", null); -var $String = $newType( 8, $kindString, "string", "string", "", null); -var $UnsafePointer = $newType( 4, $kindUnsafePointer, "unsafe.Pointer", "Pointer", "", null); - -var $nativeArray = function(elemKind) { - switch (elemKind) { - case $kindInt: - return Int32Array; - case $kindInt8: - return Int8Array; - case $kindInt16: - return Int16Array; - case $kindInt32: - return Int32Array; - case $kindUint: - return Uint32Array; - case $kindUint8: - return Uint8Array; - case $kindUint16: - return Uint16Array; - case $kindUint32: - return Uint32Array; - case $kindUintptr: - return Uint32Array; - case $kindFloat32: - return Float32Array; - case $kindFloat64: - return Float64Array; - default: - return Array; - } -}; -var $toNativeArray = function(elemKind, array) { - var nativeArray = $nativeArray(elemKind); - if (nativeArray === Array) { - return array; - } - return new nativeArray(array); -}; -var $arrayTypes = {}; -var $arrayType = function(elem, len) { - var typeKey = elem.id + "$" + len; - var typ = $arrayTypes[typeKey]; - if (typ === undefined) { - typ = $newType(12, $kindArray, "[" + len + "]" + elem.string, "", "", null); - $arrayTypes[typeKey] = typ; - typ.init(elem, len); - } - return typ; -}; - -var $chanType = function(elem, sendOnly, recvOnly) { - var string = (recvOnly ? "<-" : "") + "chan" + (sendOnly ? "<- " : " ") + elem.string; - var field = sendOnly ? "SendChan" : (recvOnly ? "RecvChan" : "Chan"); - var typ = elem[field]; - if (typ === undefined) { - typ = $newType(4, $kindChan, string, "", "", null); - elem[field] = typ; - typ.init(elem, sendOnly, recvOnly); - } - return typ; -}; -var $Chan = function(elem, capacity) { - if (capacity < 0 || capacity > 2147483647) { - $throwRuntimeError("makechan: size out of range"); - } - this.$elem = elem; - this.$capacity = capacity; - this.$buffer = []; - this.$sendQueue = []; - this.$recvQueue = []; - this.$closed = false; -}; -var $chanNil = new $Chan(null, 0); -$chanNil.$sendQueue = $chanNil.$recvQueue = { length: 0, push: function() {}, shift: function() { return undefined; }, indexOf: function() { return -1; } }; - -var $funcTypes = {}; -var $funcType = function(params, results, variadic) { - var typeKey = $mapArray(params, function(p) { return p.id; }).join(",") + "$" + $mapArray(results, function(r) { return r.id; }).join(",") + "$" + variadic; - var typ = $funcTypes[typeKey]; - if (typ === undefined) { - var paramTypes = $mapArray(params, function(p) { return p.string; }); - if (variadic) { - paramTypes[paramTypes.length - 1] = "..." + paramTypes[paramTypes.length - 1].substr(2); - } - var string = "func(" + paramTypes.join(", ") + ")"; - if (results.length === 1) { - string += " " + results[0].string; - } else if (results.length > 1) { - string += " (" + $mapArray(results, function(r) { return r.string; }).join(", ") + ")"; - } - typ = $newType(4, $kindFunc, string, "", "", null); - $funcTypes[typeKey] = typ; - typ.init(params, results, variadic); - } - return typ; -}; - -var $interfaceTypes = {}; -var $interfaceType = function(methods) { - var typeKey = $mapArray(methods, function(m) { return m.pkg + "," + m.name + "," + m.typ.id; }).join("$"); - var typ = $interfaceTypes[typeKey]; - if (typ === undefined) { - var string = "interface {}"; - if (methods.length !== 0) { - string = "interface { " + $mapArray(methods, function(m) { - return (m.pkg !== "" ? m.pkg + "." : "") + m.name + m.typ.string.substr(4); - }).join("; ") + " }"; - } - typ = $newType(8, $kindInterface, string, "", "", null); - $interfaceTypes[typeKey] = typ; - typ.init(methods); - } - return typ; -}; -var $emptyInterface = $interfaceType([]); -var $ifaceNil = {}; -var $error = $newType(8, $kindInterface, "error", "error", "", null); -$error.init([{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]); - -var $mapTypes = {}; -var $mapType = function(key, elem) { - var typeKey = key.id + "$" + elem.id; - var typ = $mapTypes[typeKey]; - if (typ === undefined) { - typ = $newType(4, $kindMap, "map[" + key.string + "]" + elem.string, "", "", null); - $mapTypes[typeKey] = typ; - typ.init(key, elem); - } - return typ; -}; -var $makeMap = function(keyForFunc, entries) { - var m = {}; - for (var i = 0; i < entries.length; i++) { - var e = entries[i]; - m[keyForFunc(e.k)] = e; - } - return m; -}; - -var $ptrType = function(elem) { - var typ = elem.ptr; - if (typ === undefined) { - typ = $newType(4, $kindPtr, "*" + elem.string, "", "", null); - elem.ptr = typ; - typ.init(elem); - } - return typ; -}; - -var $newDataPointer = function(data, constructor) { - if (constructor.elem.kind === $kindStruct) { - return data; - } - return new constructor(function() { return data; }, function(v) { data = v; }); -}; - -var $indexPtr = function(array, index, constructor) { - array.$ptr = array.$ptr || {}; - return array.$ptr[index] || (array.$ptr[index] = new constructor(function() { return array[index]; }, function(v) { array[index] = v; })); -}; - -var $sliceType = function(elem) { - var typ = elem.slice; - if (typ === undefined) { - typ = $newType(12, $kindSlice, "[]" + elem.string, "", "", null); - elem.slice = typ; - typ.init(elem); - } - return typ; -}; -var $makeSlice = function(typ, length, capacity) { - capacity = capacity || length; - if (length < 0 || length > 2147483647) { - $throwRuntimeError("makeslice: len out of range"); - } - if (capacity < 0 || capacity < length || capacity > 2147483647) { - $throwRuntimeError("makeslice: cap out of range"); - } - var array = new typ.nativeArray(capacity); - if (typ.nativeArray === Array) { - for (var i = 0; i < capacity; i++) { - array[i] = typ.elem.zero(); - } - } - var slice = new typ(array); - slice.$length = length; - return slice; -}; - -var $structTypes = {}; -var $structType = function(fields) { - var typeKey = $mapArray(fields, function(f) { return f.name + "," + f.typ.id + "," + f.tag; }).join("$"); - var typ = $structTypes[typeKey]; - if (typ === undefined) { - var string = "struct { " + $mapArray(fields, function(f) { - return f.name + " " + f.typ.string + (f.tag !== "" ? (" \"" + f.tag.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\"") : ""); - }).join("; ") + " }"; - if (fields.length === 0) { - string = "struct {}"; - } - typ = $newType(0, $kindStruct, string, "", "", function() { - this.$val = this; - for (var i = 0; i < fields.length; i++) { - var f = fields[i]; - var arg = arguments[i]; - this[f.prop] = arg !== undefined ? arg : f.typ.zero(); - } - }); - $structTypes[typeKey] = typ; - typ.init(fields); - } - return typ; -}; - -var $assertType = function(value, type, returnTuple) { - var isInterface = (type.kind === $kindInterface), ok, missingMethod = ""; - if (value === $ifaceNil) { - ok = false; - } else if (!isInterface) { - ok = value.constructor === type; - } else { - var valueTypeString = value.constructor.string; - ok = type.implementedBy[valueTypeString]; - if (ok === undefined) { - ok = true; - var valueMethodSet = $methodSet(value.constructor); - var interfaceMethods = type.methods; - for (var i = 0; i < interfaceMethods.length; i++) { - var tm = interfaceMethods[i]; - var found = false; - for (var j = 0; j < valueMethodSet.length; j++) { - var vm = valueMethodSet[j]; - if (vm.name === tm.name && vm.pkg === tm.pkg && vm.typ === tm.typ) { - found = true; - break; - } - } - if (!found) { - ok = false; - type.missingMethodFor[valueTypeString] = tm.name; - break; - } - } - type.implementedBy[valueTypeString] = ok; - } - if (!ok) { - missingMethod = type.missingMethodFor[valueTypeString]; - } - } - - if (!ok) { - if (returnTuple) { - return [type.zero(), false]; - } - $panic(new $packages["runtime"].TypeAssertionError.ptr("", (value === $ifaceNil ? "" : value.constructor.string), type.string, missingMethod)); - } - - if (!isInterface) { - value = value.$val; - } - if (type === $jsObjectPtr) { - value = value.object; - } - return returnTuple ? [value, true] : value; -}; - -var $stackDepthOffset = 0; -var $getStackDepth = function() { - var err = new Error(); - if (err.stack === undefined) { - return undefined; - } - return $stackDepthOffset + err.stack.split("\n").length; -}; - -var $panicStackDepth = null, $panicValue; -var $callDeferred = function(deferred, jsErr, fromPanic) { - if (!fromPanic && deferred !== null && deferred.index >= $curGoroutine.deferStack.length) { - throw jsErr; - } - if (jsErr !== null) { - var newErr = null; - try { - $curGoroutine.deferStack.push(deferred); - $panic(new $jsErrorPtr(jsErr)); - } catch (err) { - newErr = err; - } - $curGoroutine.deferStack.pop(); - $callDeferred(deferred, newErr); - return; - } - if ($curGoroutine.asleep) { - return; - } - - $stackDepthOffset--; - var outerPanicStackDepth = $panicStackDepth; - var outerPanicValue = $panicValue; - - var localPanicValue = $curGoroutine.panicStack.pop(); - if (localPanicValue !== undefined) { - $panicStackDepth = $getStackDepth(); - $panicValue = localPanicValue; - } - - try { - while (true) { - if (deferred === null) { - deferred = $curGoroutine.deferStack[$curGoroutine.deferStack.length - 1]; - if (deferred === undefined) { - /* The panic reached the top of the stack. Clear it and throw it as a JavaScript error. */ - $panicStackDepth = null; - if (localPanicValue.Object instanceof Error) { - throw localPanicValue.Object; - } - var msg; - if (localPanicValue.constructor === $String) { - msg = localPanicValue.$val; - } else if (localPanicValue.Error !== undefined) { - msg = localPanicValue.Error(); - } else if (localPanicValue.String !== undefined) { - msg = localPanicValue.String(); - } else { - msg = localPanicValue; - } - throw new Error(msg); - } - } - var call = deferred.pop(); - if (call === undefined) { - $curGoroutine.deferStack.pop(); - if (localPanicValue !== undefined) { - deferred = null; - continue; - } - return; - } - var r = call[0].apply(call[2], call[1]); - if (r && r.$blk !== undefined) { - deferred.push([r.$blk, [], r]); - if (fromPanic) { - throw null; - } - return; - } - - if (localPanicValue !== undefined && $panicStackDepth === null) { - throw null; /* error was recovered */ - } - } - } finally { - if (localPanicValue !== undefined) { - if ($panicStackDepth !== null) { - $curGoroutine.panicStack.push(localPanicValue); - } - $panicStackDepth = outerPanicStackDepth; - $panicValue = outerPanicValue; - } - $stackDepthOffset++; - } -}; - -var $panic = function(value) { - $curGoroutine.panicStack.push(value); - $callDeferred(null, null, true); -}; -var $recover = function() { - if ($panicStackDepth === null || ($panicStackDepth !== undefined && $panicStackDepth !== $getStackDepth() - 2)) { - return $ifaceNil; - } - $panicStackDepth = null; - return $panicValue; -}; -var $throw = function(err) { throw err; }; - -var $dummyGoroutine = { asleep: false, exit: false, deferStack: [], panicStack: [], canBlock: false }; -var $curGoroutine = $dummyGoroutine, $totalGoroutines = 0, $awakeGoroutines = 0, $checkForDeadlock = true; -var $mainFinished = false; -var $go = function(fun, args, direct) { - $totalGoroutines++; - $awakeGoroutines++; - var $goroutine = function() { - try { - $curGoroutine = $goroutine; - var r = fun.apply(undefined, args); - if (r && r.$blk !== undefined) { - fun = function() { return r.$blk(); }; - args = []; - return; - } - $goroutine.exit = true; - } catch (err) { - if (!$goroutine.exit) { - throw err; - } - } finally { - $curGoroutine = $dummyGoroutine; - if ($goroutine.exit) { /* also set by runtime.Goexit() */ - $totalGoroutines--; - $goroutine.asleep = true; - } - if ($goroutine.asleep) { - $awakeGoroutines--; - if (!$mainFinished && $awakeGoroutines === 0 && $checkForDeadlock) { - console.error("fatal error: all goroutines are asleep - deadlock!"); - if ($global.process !== undefined) { - $global.process.exit(2); - } - } - } - } - }; - $goroutine.asleep = false; - $goroutine.exit = false; - $goroutine.deferStack = []; - $goroutine.panicStack = []; - $goroutine.canBlock = true; - $schedule($goroutine, direct); -}; - -var $scheduled = [], $schedulerActive = false; -var $runScheduled = function() { - try { - var r; - while ((r = $scheduled.shift()) !== undefined) { - r(); - } - $schedulerActive = false; - } finally { - if ($schedulerActive) { - setTimeout($runScheduled, 0); - } - } -}; -var $schedule = function(goroutine, direct) { - if (goroutine.asleep) { - goroutine.asleep = false; - $awakeGoroutines++; - } - - if (direct) { - goroutine(); - return; - } - - $scheduled.push(goroutine); - if (!$schedulerActive) { - $schedulerActive = true; - setTimeout($runScheduled, 0); - } -}; - -var $setTimeout = function(f, t) { - $awakeGoroutines++; - return setTimeout(function() { - $awakeGoroutines--; - f(); - }, t); -}; - -var $block = function() { - if (!$curGoroutine.canBlock) { - $throwRuntimeError("cannot block in JavaScript callback, fix by wrapping code in goroutine"); - } - $curGoroutine.asleep = true; -}; - -var $send = function(chan, value) { - if (chan.$closed) { - $throwRuntimeError("send on closed channel"); - } - var queuedRecv = chan.$recvQueue.shift(); - if (queuedRecv !== undefined) { - queuedRecv([value, true]); - return; - } - if (chan.$buffer.length < chan.$capacity) { - chan.$buffer.push(value); - return; - } - - var thisGoroutine = $curGoroutine; - chan.$sendQueue.push(function() { - $schedule(thisGoroutine); - return value; - }); - $block(); - return { - $blk: function() { - if (chan.$closed) { - $throwRuntimeError("send on closed channel"); - } - } - }; -}; -var $recv = function(chan) { - var queuedSend = chan.$sendQueue.shift(); - if (queuedSend !== undefined) { - chan.$buffer.push(queuedSend()); - } - var bufferedValue = chan.$buffer.shift(); - if (bufferedValue !== undefined) { - return [bufferedValue, true]; - } - if (chan.$closed) { - return [chan.$elem.zero(), false]; - } - - var thisGoroutine = $curGoroutine; - var f = { $blk: function() { return this.value; } }; - var queueEntry = function(v) { - f.value = v; - $schedule(thisGoroutine); - }; - chan.$recvQueue.push(queueEntry); - $block(); - return f; -}; -var $close = function(chan) { - if (chan.$closed) { - $throwRuntimeError("close of closed channel"); - } - chan.$closed = true; - while (true) { - var queuedSend = chan.$sendQueue.shift(); - if (queuedSend === undefined) { - break; - } - queuedSend(); /* will panic because of closed channel */ - } - while (true) { - var queuedRecv = chan.$recvQueue.shift(); - if (queuedRecv === undefined) { - break; - } - queuedRecv([chan.$elem.zero(), false]); - } -}; -var $select = function(comms) { - var ready = []; - var selection = -1; - for (var i = 0; i < comms.length; i++) { - var comm = comms[i]; - var chan = comm[0]; - switch (comm.length) { - case 0: /* default */ - selection = i; - break; - case 1: /* recv */ - if (chan.$sendQueue.length !== 0 || chan.$buffer.length !== 0 || chan.$closed) { - ready.push(i); - } - break; - case 2: /* send */ - if (chan.$closed) { - $throwRuntimeError("send on closed channel"); - } - if (chan.$recvQueue.length !== 0 || chan.$buffer.length < chan.$capacity) { - ready.push(i); - } - break; - } - } - - if (ready.length !== 0) { - selection = ready[Math.floor(Math.random() * ready.length)]; - } - if (selection !== -1) { - var comm = comms[selection]; - switch (comm.length) { - case 0: /* default */ - return [selection]; - case 1: /* recv */ - return [selection, $recv(comm[0])]; - case 2: /* send */ - $send(comm[0], comm[1]); - return [selection]; - } - } - - var entries = []; - var thisGoroutine = $curGoroutine; - var f = { $blk: function() { return this.selection; } }; - var removeFromQueues = function() { - for (var i = 0; i < entries.length; i++) { - var entry = entries[i]; - var queue = entry[0]; - var index = queue.indexOf(entry[1]); - if (index !== -1) { - queue.splice(index, 1); - } - } - }; - for (var i = 0; i < comms.length; i++) { - (function(i) { - var comm = comms[i]; - switch (comm.length) { - case 1: /* recv */ - var queueEntry = function(value) { - f.selection = [i, value]; - removeFromQueues(); - $schedule(thisGoroutine); - }; - entries.push([comm[0].$recvQueue, queueEntry]); - comm[0].$recvQueue.push(queueEntry); - break; - case 2: /* send */ - var queueEntry = function() { - if (comm[0].$closed) { - $throwRuntimeError("send on closed channel"); - } - f.selection = [i]; - removeFromQueues(); - $schedule(thisGoroutine); - return comm[1]; - }; - entries.push([comm[0].$sendQueue, queueEntry]); - comm[0].$sendQueue.push(queueEntry); - break; - } - })(i); - } - $block(); - return f; -}; - -var $jsObjectPtr, $jsErrorPtr; - -var $needsExternalization = function(t) { - switch (t.kind) { - case $kindBool: - case $kindInt: - case $kindInt8: - case $kindInt16: - case $kindInt32: - case $kindUint: - case $kindUint8: - case $kindUint16: - case $kindUint32: - case $kindUintptr: - case $kindFloat32: - case $kindFloat64: - return false; - default: - return t !== $jsObjectPtr; - } -}; - -var $externalize = function(v, t) { - if (t === $jsObjectPtr) { - return v; - } - switch (t.kind) { - case $kindBool: - case $kindInt: - case $kindInt8: - case $kindInt16: - case $kindInt32: - case $kindUint: - case $kindUint8: - case $kindUint16: - case $kindUint32: - case $kindUintptr: - case $kindFloat32: - case $kindFloat64: - return v; - case $kindInt64: - case $kindUint64: - return $flatten64(v); - case $kindArray: - if ($needsExternalization(t.elem)) { - return $mapArray(v, function(e) { return $externalize(e, t.elem); }); - } - return v; - case $kindFunc: - return $externalizeFunction(v, t, false); - case $kindInterface: - if (v === $ifaceNil) { - return null; - } - if (v.constructor === $jsObjectPtr) { - return v.$val.object; - } - return $externalize(v.$val, v.constructor); - case $kindMap: - var m = {}; - var keys = $keys(v); - for (var i = 0; i < keys.length; i++) { - var entry = v[keys[i]]; - m[$externalize(entry.k, t.key)] = $externalize(entry.v, t.elem); - } - return m; - case $kindPtr: - if (v === t.nil) { - return null; - } - return $externalize(v.$get(), t.elem); - case $kindSlice: - if ($needsExternalization(t.elem)) { - return $mapArray($sliceToArray(v), function(e) { return $externalize(e, t.elem); }); - } - return $sliceToArray(v); - case $kindString: - if (v.search(/^[\x00-\x7F]*$/) !== -1) { - return v; - } - var s = "", r; - for (var i = 0; i < v.length; i += r[1]) { - r = $decodeRune(v, i); - var c = r[0]; - if (c > 0xFFFF) { - var h = Math.floor((c - 0x10000) / 0x400) + 0xD800; - var l = (c - 0x10000) % 0x400 + 0xDC00; - s += String.fromCharCode(h, l); - continue; - } - s += String.fromCharCode(c); - } - return s; - case $kindStruct: - var timePkg = $packages["time"]; - if (timePkg !== undefined && v.constructor === timePkg.Time.ptr) { - var milli = $div64(v.UnixNano(), new $Int64(0, 1000000)); - return new Date($flatten64(milli)); - } - - var noJsObject = {}; - var searchJsObject = function(v, t) { - if (t === $jsObjectPtr) { - return v; - } - switch (t.kind) { - case $kindPtr: - if (v === t.nil) { - return noJsObject; - } - return searchJsObject(v.$get(), t.elem); - case $kindStruct: - var f = t.fields[0]; - return searchJsObject(v[f.prop], f.typ); - case $kindInterface: - return searchJsObject(v.$val, v.constructor); - default: - return noJsObject; - } - }; - var o = searchJsObject(v, t); - if (o !== noJsObject) { - return o; - } - - o = {}; - for (var i = 0; i < t.fields.length; i++) { - var f = t.fields[i]; - if (f.pkg !== "") { /* not exported */ - continue; - } - o[f.name] = $externalize(v[f.prop], f.typ); - } - return o; - } - $throwRuntimeError("cannot externalize " + t.string); -}; - -var $externalizeFunction = function(v, t, passThis) { - if (v === $throwNilPointerError) { - return null; - } - if (v.$externalizeWrapper === undefined) { - $checkForDeadlock = false; - v.$externalizeWrapper = function() { - var args = []; - for (var i = 0; i < t.params.length; i++) { - if (t.variadic && i === t.params.length - 1) { - var vt = t.params[i].elem, varargs = []; - for (var j = i; j < arguments.length; j++) { - varargs.push($internalize(arguments[j], vt)); - } - args.push(new (t.params[i])(varargs)); - break; - } - args.push($internalize(arguments[i], t.params[i])); - } - var canBlock = $curGoroutine.canBlock; - $curGoroutine.canBlock = false; - try { - var result = v.apply(passThis ? this : undefined, args); - } finally { - $curGoroutine.canBlock = canBlock; - } - switch (t.results.length) { - case 0: - return; - case 1: - return $externalize(result, t.results[0]); - default: - for (var i = 0; i < t.results.length; i++) { - result[i] = $externalize(result[i], t.results[i]); - } - return result; - } - }; - } - return v.$externalizeWrapper; -}; - -var $internalize = function(v, t, recv) { - if (t === $jsObjectPtr) { - return v; - } - if (t === $jsObjectPtr.elem) { - $throwRuntimeError("cannot internalize js.Object, use *js.Object instead"); - } - if (v && v.__internal_object__ !== undefined) { - return $assertType(v.__internal_object__, t, false); - } - var timePkg = $packages["time"]; - if (timePkg !== undefined && t === timePkg.Time) { - if (!(v !== null && v !== undefined && v.constructor === Date)) { - $throwRuntimeError("cannot internalize time.Time from " + typeof v + ", must be Date"); - } - return timePkg.Unix(new $Int64(0, 0), new $Int64(0, v.getTime() * 1000000)); - } - switch (t.kind) { - case $kindBool: - return !!v; - case $kindInt: - return parseInt(v); - case $kindInt8: - return parseInt(v) << 24 >> 24; - case $kindInt16: - return parseInt(v) << 16 >> 16; - case $kindInt32: - return parseInt(v) >> 0; - case $kindUint: - return parseInt(v); - case $kindUint8: - return parseInt(v) << 24 >>> 24; - case $kindUint16: - return parseInt(v) << 16 >>> 16; - case $kindUint32: - case $kindUintptr: - return parseInt(v) >>> 0; - case $kindInt64: - case $kindUint64: - return new t(0, v); - case $kindFloat32: - case $kindFloat64: - return parseFloat(v); - case $kindArray: - if (v.length !== t.len) { - $throwRuntimeError("got array with wrong size from JavaScript native"); - } - return $mapArray(v, function(e) { return $internalize(e, t.elem); }); - case $kindFunc: - return function() { - var args = []; - for (var i = 0; i < t.params.length; i++) { - if (t.variadic && i === t.params.length - 1) { - var vt = t.params[i].elem, varargs = arguments[i]; - for (var j = 0; j < varargs.$length; j++) { - args.push($externalize(varargs.$array[varargs.$offset + j], vt)); - } - break; - } - args.push($externalize(arguments[i], t.params[i])); - } - var result = v.apply(recv, args); - switch (t.results.length) { - case 0: - return; - case 1: - return $internalize(result, t.results[0]); - default: - for (var i = 0; i < t.results.length; i++) { - result[i] = $internalize(result[i], t.results[i]); - } - return result; - } - }; - case $kindInterface: - if (t.methods.length !== 0) { - $throwRuntimeError("cannot internalize " + t.string); - } - if (v === null) { - return $ifaceNil; - } - if (v === undefined) { - return new $jsObjectPtr(undefined); - } - switch (v.constructor) { - case Int8Array: - return new ($sliceType($Int8))(v); - case Int16Array: - return new ($sliceType($Int16))(v); - case Int32Array: - return new ($sliceType($Int))(v); - case Uint8Array: - return new ($sliceType($Uint8))(v); - case Uint16Array: - return new ($sliceType($Uint16))(v); - case Uint32Array: - return new ($sliceType($Uint))(v); - case Float32Array: - return new ($sliceType($Float32))(v); - case Float64Array: - return new ($sliceType($Float64))(v); - case Array: - return $internalize(v, $sliceType($emptyInterface)); - case Boolean: - return new $Bool(!!v); - case Date: - if (timePkg === undefined) { - /* time package is not present, internalize as &js.Object{Date} so it can be externalized into original Date. */ - return new $jsObjectPtr(v); - } - return new timePkg.Time($internalize(v, timePkg.Time)); - case Function: - var funcType = $funcType([$sliceType($emptyInterface)], [$jsObjectPtr], true); - return new funcType($internalize(v, funcType)); - case Number: - return new $Float64(parseFloat(v)); - case String: - return new $String($internalize(v, $String)); - default: - if ($global.Node && v instanceof $global.Node) { - return new $jsObjectPtr(v); - } - var mapType = $mapType($String, $emptyInterface); - return new mapType($internalize(v, mapType)); - } - case $kindMap: - var m = {}; - var keys = $keys(v); - for (var i = 0; i < keys.length; i++) { - var k = $internalize(keys[i], t.key); - m[t.key.keyFor(k)] = { k: k, v: $internalize(v[keys[i]], t.elem) }; - } - return m; - case $kindPtr: - if (t.elem.kind === $kindStruct) { - return $internalize(v, t.elem); - } - case $kindSlice: - return new t($mapArray(v, function(e) { return $internalize(e, t.elem); })); - case $kindString: - v = String(v); - if (v.search(/^[\x00-\x7F]*$/) !== -1) { - return v; - } - var s = ""; - var i = 0; - while (i < v.length) { - var h = v.charCodeAt(i); - if (0xD800 <= h && h <= 0xDBFF) { - var l = v.charCodeAt(i + 1); - var c = (h - 0xD800) * 0x400 + l - 0xDC00 + 0x10000; - s += $encodeRune(c); - i += 2; - continue; - } - s += $encodeRune(h); - i++; - } - return s; - case $kindStruct: - var noJsObject = {}; - var searchJsObject = function(t) { - if (t === $jsObjectPtr) { - return v; - } - if (t === $jsObjectPtr.elem) { - $throwRuntimeError("cannot internalize js.Object, use *js.Object instead"); - } - switch (t.kind) { - case $kindPtr: - return searchJsObject(t.elem); - case $kindStruct: - var f = t.fields[0]; - var o = searchJsObject(f.typ); - if (o !== noJsObject) { - var n = new t.ptr(); - n[f.prop] = o; - return n; - } - return noJsObject; - default: - return noJsObject; - } - }; - var o = searchJsObject(t); - if (o !== noJsObject) { - return o; - } - } - $throwRuntimeError("cannot internalize " + t.string); -}; - -$packages["github.com/gopherjs/gopherjs/js"] = (function() { - var $pkg = {}, $init, Object, Error, sliceType, ptrType, ptrType$1, init; - Object = $pkg.Object = $newType(0, $kindStruct, "js.Object", "Object", "github.com/gopherjs/gopherjs/js", function(object_) { - this.$val = this; - if (arguments.length === 0) { - this.object = null; - return; - } - this.object = object_; - }); - Error = $pkg.Error = $newType(0, $kindStruct, "js.Error", "Error", "github.com/gopherjs/gopherjs/js", function(Object_) { - this.$val = this; - if (arguments.length === 0) { - this.Object = null; - return; - } - this.Object = Object_; - }); - sliceType = $sliceType($emptyInterface); - ptrType = $ptrType(Object); - ptrType$1 = $ptrType(Error); - Object.ptr.prototype.Get = function(key) { - var $ptr, key, o; - o = this; - return o.object[$externalize(key, $String)]; - }; - Object.prototype.Get = function(key) { return this.$val.Get(key); }; - Object.ptr.prototype.Set = function(key, value) { - var $ptr, key, o, value; - o = this; - o.object[$externalize(key, $String)] = $externalize(value, $emptyInterface); - }; - Object.prototype.Set = function(key, value) { return this.$val.Set(key, value); }; - Object.ptr.prototype.Delete = function(key) { - var $ptr, key, o; - o = this; - delete o.object[$externalize(key, $String)]; - }; - Object.prototype.Delete = function(key) { return this.$val.Delete(key); }; - Object.ptr.prototype.Length = function() { - var $ptr, o; - o = this; - return $parseInt(o.object.length); - }; - Object.prototype.Length = function() { return this.$val.Length(); }; - Object.ptr.prototype.Index = function(i) { - var $ptr, i, o; - o = this; - return o.object[i]; - }; - Object.prototype.Index = function(i) { return this.$val.Index(i); }; - Object.ptr.prototype.SetIndex = function(i, value) { - var $ptr, i, o, value; - o = this; - o.object[i] = $externalize(value, $emptyInterface); - }; - Object.prototype.SetIndex = function(i, value) { return this.$val.SetIndex(i, value); }; - Object.ptr.prototype.Call = function(name, args) { - var $ptr, args, name, o, obj; - o = this; - return (obj = o.object, obj[$externalize(name, $String)].apply(obj, $externalize(args, sliceType))); - }; - Object.prototype.Call = function(name, args) { return this.$val.Call(name, args); }; - Object.ptr.prototype.Invoke = function(args) { - var $ptr, args, o; - o = this; - return o.object.apply(undefined, $externalize(args, sliceType)); - }; - Object.prototype.Invoke = function(args) { return this.$val.Invoke(args); }; - Object.ptr.prototype.New = function(args) { - var $ptr, args, o; - o = this; - return new ($global.Function.prototype.bind.apply(o.object, [undefined].concat($externalize(args, sliceType)))); - }; - Object.prototype.New = function(args) { return this.$val.New(args); }; - Object.ptr.prototype.Bool = function() { - var $ptr, o; - o = this; - return !!(o.object); - }; - Object.prototype.Bool = function() { return this.$val.Bool(); }; - Object.ptr.prototype.String = function() { - var $ptr, o; - o = this; - return $internalize(o.object, $String); - }; - Object.prototype.String = function() { return this.$val.String(); }; - Object.ptr.prototype.Int = function() { - var $ptr, o; - o = this; - return $parseInt(o.object) >> 0; - }; - Object.prototype.Int = function() { return this.$val.Int(); }; - Object.ptr.prototype.Int64 = function() { - var $ptr, o; - o = this; - return $internalize(o.object, $Int64); - }; - Object.prototype.Int64 = function() { return this.$val.Int64(); }; - Object.ptr.prototype.Uint64 = function() { - var $ptr, o; - o = this; - return $internalize(o.object, $Uint64); - }; - Object.prototype.Uint64 = function() { return this.$val.Uint64(); }; - Object.ptr.prototype.Float = function() { - var $ptr, o; - o = this; - return $parseFloat(o.object); - }; - Object.prototype.Float = function() { return this.$val.Float(); }; - Object.ptr.prototype.Interface = function() { - var $ptr, o; - o = this; - return $internalize(o.object, $emptyInterface); - }; - Object.prototype.Interface = function() { return this.$val.Interface(); }; - Object.ptr.prototype.Unsafe = function() { - var $ptr, o; - o = this; - return o.object; - }; - Object.prototype.Unsafe = function() { return this.$val.Unsafe(); }; - Error.ptr.prototype.Error = function() { - var $ptr, err; - err = this; - return "JavaScript error: " + $internalize(err.Object.message, $String); - }; - Error.prototype.Error = function() { return this.$val.Error(); }; - Error.ptr.prototype.Stack = function() { - var $ptr, err; - err = this; - return $internalize(err.Object.stack, $String); - }; - Error.prototype.Stack = function() { return this.$val.Stack(); }; - init = function() { - var $ptr, e; - e = new Error.ptr(null); - }; - ptrType.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [ptrType], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String, $emptyInterface], [], false)}, {prop: "Delete", name: "Delete", pkg: "", typ: $funcType([$String], [], false)}, {prop: "Length", name: "Length", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [ptrType], false)}, {prop: "SetIndex", name: "SetIndex", pkg: "", typ: $funcType([$Int, $emptyInterface], [], false)}, {prop: "Call", name: "Call", pkg: "", typ: $funcType([$String, sliceType], [ptrType], true)}, {prop: "Invoke", name: "Invoke", pkg: "", typ: $funcType([sliceType], [ptrType], true)}, {prop: "New", name: "New", pkg: "", typ: $funcType([sliceType], [ptrType], true)}, {prop: "Bool", name: "Bool", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Int64", name: "Int64", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "Float", name: "Float", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Interface", name: "Interface", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Unsafe", name: "Unsafe", pkg: "", typ: $funcType([], [$Uintptr], false)}]; - ptrType$1.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Stack", name: "Stack", pkg: "", typ: $funcType([], [$String], false)}]; - Object.init([{prop: "object", name: "object", pkg: "github.com/gopherjs/gopherjs/js", typ: ptrType, tag: ""}]); - Error.init([{prop: "Object", name: "", pkg: "", typ: ptrType, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - init(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["runtime/internal/sys"] = (function() { - var $pkg = {}, $init; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["runtime"] = (function() { - var $pkg = {}, $init, js, sys, Error, TypeAssertionError, errorString, ptrType$4, init, GOROOT, Goexit, GOMAXPROCS, SetFinalizer; - js = $packages["github.com/gopherjs/gopherjs/js"]; - sys = $packages["runtime/internal/sys"]; - Error = $pkg.Error = $newType(8, $kindInterface, "runtime.Error", "Error", "runtime", null); - TypeAssertionError = $pkg.TypeAssertionError = $newType(0, $kindStruct, "runtime.TypeAssertionError", "TypeAssertionError", "runtime", function(interfaceString_, concreteString_, assertedString_, missingMethod_) { - this.$val = this; - if (arguments.length === 0) { - this.interfaceString = ""; - this.concreteString = ""; - this.assertedString = ""; - this.missingMethod = ""; - return; - } - this.interfaceString = interfaceString_; - this.concreteString = concreteString_; - this.assertedString = assertedString_; - this.missingMethod = missingMethod_; - }); - errorString = $pkg.errorString = $newType(8, $kindString, "runtime.errorString", "errorString", "runtime", null); - ptrType$4 = $ptrType(TypeAssertionError); - init = function() { - var $ptr, e, jsPkg; - jsPkg = $packages[$externalize("github.com/gopherjs/gopherjs/js", $String)]; - $jsObjectPtr = jsPkg.Object.ptr; - $jsErrorPtr = jsPkg.Error.ptr; - $throwRuntimeError = (function(msg) { - var $ptr, msg; - $panic(new errorString(msg)); - }); - e = $ifaceNil; - e = new TypeAssertionError.ptr("", "", "", ""); - }; - GOROOT = function() { - var $ptr, goroot, process; - process = $global.process; - if (process === undefined) { - return "/"; - } - goroot = process.env.GOROOT; - if (!(goroot === undefined)) { - return $internalize(goroot, $String); - } - return "/home/mathias/src/go"; - }; - $pkg.GOROOT = GOROOT; - Goexit = function() { - var $ptr; - $curGoroutine.exit = $externalize(true, $Bool); - $throw(null); - }; - $pkg.Goexit = Goexit; - GOMAXPROCS = function(n) { - var $ptr, n; - return 1; - }; - $pkg.GOMAXPROCS = GOMAXPROCS; - SetFinalizer = function(x, f) { - var $ptr, f, x; - }; - $pkg.SetFinalizer = SetFinalizer; - TypeAssertionError.ptr.prototype.RuntimeError = function() { - var $ptr; - }; - TypeAssertionError.prototype.RuntimeError = function() { return this.$val.RuntimeError(); }; - TypeAssertionError.ptr.prototype.Error = function() { - var $ptr, e, inter; - e = this; - inter = e.interfaceString; - if (inter === "") { - inter = "interface"; - } - if (e.concreteString === "") { - return "interface conversion: " + inter + " is nil, not " + e.assertedString; - } - if (e.missingMethod === "") { - return "interface conversion: " + inter + " is " + e.concreteString + ", not " + e.assertedString; - } - return "interface conversion: " + e.concreteString + " is not " + e.assertedString + ": missing method " + e.missingMethod; - }; - TypeAssertionError.prototype.Error = function() { return this.$val.Error(); }; - errorString.prototype.RuntimeError = function() { - var $ptr, e; - e = this.$val; - }; - $ptrType(errorString).prototype.RuntimeError = function() { return new errorString(this.$get()).RuntimeError(); }; - errorString.prototype.Error = function() { - var $ptr, e; - e = this.$val; - return "runtime error: " + e; - }; - $ptrType(errorString).prototype.Error = function() { return new errorString(this.$get()).Error(); }; - ptrType$4.methods = [{prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - errorString.methods = [{prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}, {prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - Error.init([{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "RuntimeError", name: "RuntimeError", pkg: "", typ: $funcType([], [], false)}]); - TypeAssertionError.init([{prop: "interfaceString", name: "interfaceString", pkg: "runtime", typ: $String, tag: ""}, {prop: "concreteString", name: "concreteString", pkg: "runtime", typ: $String, tag: ""}, {prop: "assertedString", name: "assertedString", pkg: "runtime", typ: $String, tag: ""}, {prop: "missingMethod", name: "missingMethod", pkg: "runtime", typ: $String, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sys.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - init(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["errors"] = (function() { - var $pkg = {}, $init, errorString, ptrType, New; - errorString = $pkg.errorString = $newType(0, $kindStruct, "errors.errorString", "errorString", "errors", function(s_) { - this.$val = this; - if (arguments.length === 0) { - this.s = ""; - return; - } - this.s = s_; - }); - ptrType = $ptrType(errorString); - New = function(text) { - var $ptr, text; - return new errorString.ptr(text); - }; - $pkg.New = New; - errorString.ptr.prototype.Error = function() { - var $ptr, e; - e = this; - return e.s; - }; - errorString.prototype.Error = function() { return this.$val.Error(); }; - ptrType.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - errorString.init([{prop: "s", name: "s", pkg: "errors", typ: $String, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["internal/race"] = (function() { - var $pkg = {}, $init, Acquire, Release, ReleaseMerge, Disable, Enable, ReadRange, WriteRange; - Acquire = function(addr) { - var $ptr, addr; - }; - $pkg.Acquire = Acquire; - Release = function(addr) { - var $ptr, addr; - }; - $pkg.Release = Release; - ReleaseMerge = function(addr) { - var $ptr, addr; - }; - $pkg.ReleaseMerge = ReleaseMerge; - Disable = function() { - var $ptr; - }; - $pkg.Disable = Disable; - Enable = function() { - var $ptr; - }; - $pkg.Enable = Enable; - ReadRange = function(addr, len) { - var $ptr, addr, len; - }; - $pkg.ReadRange = ReadRange; - WriteRange = function(addr, len) { - var $ptr, addr, len; - }; - $pkg.WriteRange = WriteRange; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["sync/atomic"] = (function() { - var $pkg = {}, $init, js, CompareAndSwapInt32, AddInt32, LoadUint32, StoreUint32; - js = $packages["github.com/gopherjs/gopherjs/js"]; - CompareAndSwapInt32 = function(addr, old, new$1) { - var $ptr, addr, new$1, old; - if (addr.$get() === old) { - addr.$set(new$1); - return true; - } - return false; - }; - $pkg.CompareAndSwapInt32 = CompareAndSwapInt32; - AddInt32 = function(addr, delta) { - var $ptr, addr, delta, new$1; - new$1 = addr.$get() + delta >> 0; - addr.$set(new$1); - return new$1; - }; - $pkg.AddInt32 = AddInt32; - LoadUint32 = function(addr) { - var $ptr, addr; - return addr.$get(); - }; - $pkg.LoadUint32 = LoadUint32; - StoreUint32 = function(addr, val) { - var $ptr, addr, val; - addr.$set(val); - }; - $pkg.StoreUint32 = StoreUint32; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["sync"] = (function() { - var $pkg = {}, $init, race, runtime, atomic, Pool, Mutex, Locker, Once, poolLocal, syncSema, RWMutex, rlocker, ptrType, sliceType, ptrType$1, chanType, sliceType$1, ptrType$4, ptrType$6, sliceType$3, ptrType$7, ptrType$8, funcType, ptrType$12, funcType$1, ptrType$13, arrayType$1, semWaiters, allPools, runtime_Syncsemcheck, runtime_registerPoolCleanup, runtime_Semacquire, runtime_Semrelease, runtime_canSpin, poolCleanup, init, indexLocal, init$1, runtime_doSpin; - race = $packages["internal/race"]; - runtime = $packages["runtime"]; - atomic = $packages["sync/atomic"]; - Pool = $pkg.Pool = $newType(0, $kindStruct, "sync.Pool", "Pool", "sync", function(local_, localSize_, store_, New_) { - this.$val = this; - if (arguments.length === 0) { - this.local = 0; - this.localSize = 0; - this.store = sliceType$3.nil; - this.New = $throwNilPointerError; - return; - } - this.local = local_; - this.localSize = localSize_; - this.store = store_; - this.New = New_; - }); - Mutex = $pkg.Mutex = $newType(0, $kindStruct, "sync.Mutex", "Mutex", "sync", function(state_, sema_) { - this.$val = this; - if (arguments.length === 0) { - this.state = 0; - this.sema = 0; - return; - } - this.state = state_; - this.sema = sema_; - }); - Locker = $pkg.Locker = $newType(8, $kindInterface, "sync.Locker", "Locker", "sync", null); - Once = $pkg.Once = $newType(0, $kindStruct, "sync.Once", "Once", "sync", function(m_, done_) { - this.$val = this; - if (arguments.length === 0) { - this.m = new Mutex.ptr(0, 0); - this.done = 0; - return; - } - this.m = m_; - this.done = done_; - }); - poolLocal = $pkg.poolLocal = $newType(0, $kindStruct, "sync.poolLocal", "poolLocal", "sync", function(private$0_, shared_, Mutex_, pad_) { - this.$val = this; - if (arguments.length === 0) { - this.private$0 = $ifaceNil; - this.shared = sliceType$3.nil; - this.Mutex = new Mutex.ptr(0, 0); - this.pad = arrayType$1.zero(); - return; - } - this.private$0 = private$0_; - this.shared = shared_; - this.Mutex = Mutex_; - this.pad = pad_; - }); - syncSema = $pkg.syncSema = $newType(0, $kindStruct, "sync.syncSema", "syncSema", "sync", function(lock_, head_, tail_) { - this.$val = this; - if (arguments.length === 0) { - this.lock = 0; - this.head = 0; - this.tail = 0; - return; - } - this.lock = lock_; - this.head = head_; - this.tail = tail_; - }); - RWMutex = $pkg.RWMutex = $newType(0, $kindStruct, "sync.RWMutex", "RWMutex", "sync", function(w_, writerSem_, readerSem_, readerCount_, readerWait_) { - this.$val = this; - if (arguments.length === 0) { - this.w = new Mutex.ptr(0, 0); - this.writerSem = 0; - this.readerSem = 0; - this.readerCount = 0; - this.readerWait = 0; - return; - } - this.w = w_; - this.writerSem = writerSem_; - this.readerSem = readerSem_; - this.readerCount = readerCount_; - this.readerWait = readerWait_; - }); - rlocker = $pkg.rlocker = $newType(0, $kindStruct, "sync.rlocker", "rlocker", "sync", function(w_, writerSem_, readerSem_, readerCount_, readerWait_) { - this.$val = this; - if (arguments.length === 0) { - this.w = new Mutex.ptr(0, 0); - this.writerSem = 0; - this.readerSem = 0; - this.readerCount = 0; - this.readerWait = 0; - return; - } - this.w = w_; - this.writerSem = writerSem_; - this.readerSem = readerSem_; - this.readerCount = readerCount_; - this.readerWait = readerWait_; - }); - ptrType = $ptrType(Pool); - sliceType = $sliceType(ptrType); - ptrType$1 = $ptrType($Uint32); - chanType = $chanType($Bool, false, false); - sliceType$1 = $sliceType(chanType); - ptrType$4 = $ptrType($Int32); - ptrType$6 = $ptrType(poolLocal); - sliceType$3 = $sliceType($emptyInterface); - ptrType$7 = $ptrType(rlocker); - ptrType$8 = $ptrType(RWMutex); - funcType = $funcType([], [$emptyInterface], false); - ptrType$12 = $ptrType(Mutex); - funcType$1 = $funcType([], [], false); - ptrType$13 = $ptrType(Once); - arrayType$1 = $arrayType($Uint8, 128); - runtime_Syncsemcheck = function(size) { - var $ptr, size; - }; - Pool.ptr.prototype.Get = function() { - var $ptr, _r, p, x, x$1, x$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; p = $f.p; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - /* */ if (p.store.$length === 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (p.store.$length === 0) { */ case 1: - /* */ if (!(p.New === $throwNilPointerError)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (!(p.New === $throwNilPointerError)) { */ case 3: - _r = p.New(); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 6; case 6: - return _r; - /* } */ case 4: - return $ifaceNil; - /* } */ case 2: - x$2 = (x = p.store, x$1 = p.store.$length - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); - p.store = $subslice(p.store, 0, (p.store.$length - 1 >> 0)); - return x$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: Pool.ptr.prototype.Get }; } $f.$ptr = $ptr; $f._r = _r; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; - }; - Pool.prototype.Get = function() { return this.$val.Get(); }; - Pool.ptr.prototype.Put = function(x) { - var $ptr, p, x; - p = this; - if ($interfaceIsEqual(x, $ifaceNil)) { - return; - } - p.store = $append(p.store, x); - }; - Pool.prototype.Put = function(x) { return this.$val.Put(x); }; - runtime_registerPoolCleanup = function(cleanup) { - var $ptr, cleanup; - }; - runtime_Semacquire = function(s) { - var $ptr, _entry, _key, _r, ch, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _r = $f._r; ch = $f.ch; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ if (s.$get() === 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (s.$get() === 0) { */ case 1: - ch = new $Chan($Bool, 0); - _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: $append((_entry = semWaiters[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : sliceType$1.nil), ch) }; - _r = $recv(ch); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r[0]; - /* } */ case 2: - s.$set(s.$get() - (1) >>> 0); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: runtime_Semacquire }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._r = _r; $f.ch = ch; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - runtime_Semrelease = function(s) { - var $ptr, _entry, _key, ch, s, w, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; ch = $f.ch; s = $f.s; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s.$set(s.$get() + (1) >>> 0); - w = (_entry = semWaiters[ptrType$1.keyFor(s)], _entry !== undefined ? _entry.v : sliceType$1.nil); - if (w.$length === 0) { - return; - } - ch = (0 >= w.$length ? $throwRuntimeError("index out of range") : w.$array[w.$offset + 0]); - w = $subslice(w, 1); - _key = s; (semWaiters || $throwRuntimeError("assignment to entry in nil map"))[ptrType$1.keyFor(_key)] = { k: _key, v: w }; - if (w.$length === 0) { - delete semWaiters[ptrType$1.keyFor(s)]; - } - $r = $send(ch, true); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: runtime_Semrelease }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f.ch = ch; $f.s = s; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; - }; - runtime_canSpin = function(i) { - var $ptr, i; - return false; - }; - Mutex.ptr.prototype.Lock = function() { - var $ptr, awoke, iter, m, new$1, old, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; awoke = $f.awoke; iter = $f.iter; m = $f.m; new$1 = $f.new$1; old = $f.old; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - m = this; - if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), 0, 1)) { - if (false) { - race.Acquire(m); - } - return; - } - awoke = false; - iter = 0; - /* while (true) { */ case 1: - old = m.state; - new$1 = old | 1; - /* */ if (!(((old & 1) === 0))) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (!(((old & 1) === 0))) { */ case 3: - if (runtime_canSpin(iter)) { - if (!awoke && ((old & 2) === 0) && !(((old >> 2 >> 0) === 0)) && atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, old | 2)) { - awoke = true; - } - runtime_doSpin(); - iter = iter + (1) >> 0; - /* continue; */ $s = 1; continue; - } - new$1 = old + 4 >> 0; - /* } */ case 4: - if (awoke) { - if ((new$1 & 2) === 0) { - $panic(new $String("sync: inconsistent mutex state")); - } - new$1 = (new$1 & ~(2)) >> 0; - } - /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 5: - if ((old & 1) === 0) { - /* break; */ $s = 2; continue; - } - $r = runtime_Semacquire((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m)))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - awoke = true; - iter = 0; - /* } */ case 6: - /* } */ $s = 1; continue; case 2: - if (false) { - race.Acquire(m); - } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.Lock }; } $f.$ptr = $ptr; $f.awoke = awoke; $f.iter = iter; $f.m = m; $f.new$1 = new$1; $f.old = old; $f.$s = $s; $f.$r = $r; return $f; - }; - Mutex.prototype.Lock = function() { return this.$val.Lock(); }; - Mutex.ptr.prototype.Unlock = function() { - var $ptr, m, new$1, old, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; m = $f.m; new$1 = $f.new$1; old = $f.old; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - m = this; - if (false) { - race.Release(m); - } - new$1 = atomic.AddInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), -1); - if ((((new$1 + 1 >> 0)) & 1) === 0) { - $panic(new $String("sync: unlock of unlocked mutex")); - } - old = new$1; - /* while (true) { */ case 1: - if (((old >> 2 >> 0) === 0) || !(((old & 3) === 0))) { - return; - } - new$1 = ((old - 4 >> 0)) | 2; - /* */ if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (atomic.CompareAndSwapInt32((m.$ptr_state || (m.$ptr_state = new ptrType$4(function() { return this.$target.state; }, function($v) { this.$target.state = $v; }, m))), old, new$1)) { */ case 3: - $r = runtime_Semrelease((m.$ptr_sema || (m.$ptr_sema = new ptrType$1(function() { return this.$target.sema; }, function($v) { this.$target.sema = $v; }, m)))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return; - /* } */ case 4: - old = m.state; - /* } */ $s = 1; continue; case 2: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Mutex.ptr.prototype.Unlock }; } $f.$ptr = $ptr; $f.m = m; $f.new$1 = new$1; $f.old = old; $f.$s = $s; $f.$r = $r; return $f; - }; - Mutex.prototype.Unlock = function() { return this.$val.Unlock(); }; - Once.ptr.prototype.Do = function(f) { - var $ptr, f, o, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; o = $f.o; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - o = this; - if (atomic.LoadUint32((o.$ptr_done || (o.$ptr_done = new ptrType$1(function() { return this.$target.done; }, function($v) { this.$target.done = $v; }, o)))) === 1) { - return; - } - $r = o.m.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $deferred.push([$methodVal(o.m, "Unlock"), []]); - /* */ if (o.done === 0) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (o.done === 0) { */ case 2: - $deferred.push([atomic.StoreUint32, [(o.$ptr_done || (o.$ptr_done = new ptrType$1(function() { return this.$target.done; }, function($v) { this.$target.done = $v; }, o))), 1]]); - $r = f(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 3: - /* */ $s = -1; case -1: } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Once.ptr.prototype.Do }; } $f.$ptr = $ptr; $f.f = f; $f.o = o; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - Once.prototype.Do = function(f) { return this.$val.Do(f); }; - poolCleanup = function() { - var $ptr, _i, _i$1, _ref, _ref$1, i, i$1, j, l, p, x; - _ref = allPools; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - p = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - ((i < 0 || i >= allPools.$length) ? $throwRuntimeError("index out of range") : allPools.$array[allPools.$offset + i] = ptrType.nil); - i$1 = 0; - while (true) { - if (!(i$1 < (p.localSize >> 0))) { break; } - l = indexLocal(p.local, i$1); - l.private$0 = $ifaceNil; - _ref$1 = l.shared; - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - j = _i$1; - (x = l.shared, ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j] = $ifaceNil)); - _i$1++; - } - l.shared = sliceType$3.nil; - i$1 = i$1 + (1) >> 0; - } - p.local = 0; - p.localSize = 0; - _i++; - } - allPools = new sliceType([]); - }; - init = function() { - var $ptr; - runtime_registerPoolCleanup(poolCleanup); - }; - indexLocal = function(l, i) { - var $ptr, i, l, x; - return (x = l, (x.nilCheck, ((i < 0 || i >= x.length) ? $throwRuntimeError("index out of range") : x[i]))); - }; - init$1 = function() { - var $ptr, s; - s = new syncSema.ptr(0, 0, 0); - runtime_Syncsemcheck(12); - }; - runtime_doSpin = function() { - $throwRuntimeError("native function not implemented: sync.runtime_doSpin"); - }; - RWMutex.ptr.prototype.RLock = function() { - var $ptr, rw, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - rw = this; - if (false) { - race.Disable(); - } - /* */ if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$4(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$4(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1) < 0) { */ case 1: - $r = runtime_Semacquire((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 2: - if (false) { - race.Enable(); - race.Acquire((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))); - } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RLock }; } $f.$ptr = $ptr; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; - }; - RWMutex.prototype.RLock = function() { return this.$val.RLock(); }; - RWMutex.ptr.prototype.RUnlock = function() { - var $ptr, r, rw, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - rw = this; - if (false) { - race.ReleaseMerge((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))); - race.Disable(); - } - r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$4(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1); - /* */ if (r < 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (r < 0) { */ case 1: - if (((r + 1 >> 0) === 0) || ((r + 1 >> 0) === -1073741824)) { - race.Enable(); - $panic(new $String("sync: RUnlock of unlocked RWMutex")); - } - /* */ if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$4(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$4(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), -1) === 0) { */ case 3: - $r = runtime_Semrelease((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 4: - /* } */ case 2: - if (false) { - race.Enable(); - } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.RUnlock }; } $f.$ptr = $ptr; $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; - }; - RWMutex.prototype.RUnlock = function() { return this.$val.RUnlock(); }; - RWMutex.ptr.prototype.Lock = function() { - var $ptr, r, rw, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - rw = this; - if (false) { - race.Disable(); - } - $r = rw.w.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$4(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), -1073741824) + 1073741824 >> 0; - /* */ if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$4(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (!((r === 0)) && !((atomic.AddInt32((rw.$ptr_readerWait || (rw.$ptr_readerWait = new ptrType$4(function() { return this.$target.readerWait; }, function($v) { this.$target.readerWait = $v; }, rw))), r) === 0))) { */ case 2: - $r = runtime_Semacquire((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 3: - if (false) { - race.Enable(); - race.Acquire((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))); - race.Acquire((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))); - } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Lock }; } $f.$ptr = $ptr; $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; - }; - RWMutex.prototype.Lock = function() { return this.$val.Lock(); }; - RWMutex.ptr.prototype.Unlock = function() { - var $ptr, i, r, rw, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; i = $f.i; r = $f.r; rw = $f.rw; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - rw = this; - if (false) { - race.Release((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))); - race.Release((rw.$ptr_writerSem || (rw.$ptr_writerSem = new ptrType$1(function() { return this.$target.writerSem; }, function($v) { this.$target.writerSem = $v; }, rw)))); - race.Disable(); - } - r = atomic.AddInt32((rw.$ptr_readerCount || (rw.$ptr_readerCount = new ptrType$4(function() { return this.$target.readerCount; }, function($v) { this.$target.readerCount = $v; }, rw))), 1073741824); - if (r >= 1073741824) { - race.Enable(); - $panic(new $String("sync: Unlock of unlocked RWMutex")); - } - i = 0; - /* while (true) { */ case 1: - /* if (!(i < (r >> 0))) { break; } */ if(!(i < (r >> 0))) { $s = 2; continue; } - $r = runtime_Semrelease((rw.$ptr_readerSem || (rw.$ptr_readerSem = new ptrType$1(function() { return this.$target.readerSem; }, function($v) { this.$target.readerSem = $v; }, rw)))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - i = i + (1) >> 0; - /* } */ $s = 1; continue; case 2: - $r = rw.w.Unlock(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - if (false) { - race.Enable(); - } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: RWMutex.ptr.prototype.Unlock }; } $f.$ptr = $ptr; $f.i = i; $f.r = r; $f.rw = rw; $f.$s = $s; $f.$r = $r; return $f; - }; - RWMutex.prototype.Unlock = function() { return this.$val.Unlock(); }; - RWMutex.ptr.prototype.RLocker = function() { - var $ptr, rw; - rw = this; - return $pointerOfStructConversion(rw, ptrType$7); - }; - RWMutex.prototype.RLocker = function() { return this.$val.RLocker(); }; - rlocker.ptr.prototype.Lock = function() { - var $ptr, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - $r = $pointerOfStructConversion(r, ptrType$8).RLock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Lock }; } $f.$ptr = $ptr; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - rlocker.prototype.Lock = function() { return this.$val.Lock(); }; - rlocker.ptr.prototype.Unlock = function() { - var $ptr, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - $r = $pointerOfStructConversion(r, ptrType$8).RUnlock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: rlocker.ptr.prototype.Unlock }; } $f.$ptr = $ptr; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - rlocker.prototype.Unlock = function() { return this.$val.Unlock(); }; - ptrType.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Put", name: "Put", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "getSlow", name: "getSlow", pkg: "sync", typ: $funcType([], [$emptyInterface], false)}, {prop: "pin", name: "pin", pkg: "sync", typ: $funcType([], [ptrType$6], false)}, {prop: "pinSlow", name: "pinSlow", pkg: "sync", typ: $funcType([], [ptrType$6], false)}]; - ptrType$12.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; - ptrType$13.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([funcType$1], [], false)}]; - ptrType$8.methods = [{prop: "RLock", name: "RLock", pkg: "", typ: $funcType([], [], false)}, {prop: "RUnlock", name: "RUnlock", pkg: "", typ: $funcType([], [], false)}, {prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}, {prop: "RLocker", name: "RLocker", pkg: "", typ: $funcType([], [Locker], false)}]; - ptrType$7.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; - Pool.init([{prop: "local", name: "local", pkg: "sync", typ: $UnsafePointer, tag: ""}, {prop: "localSize", name: "localSize", pkg: "sync", typ: $Uintptr, tag: ""}, {prop: "store", name: "store", pkg: "sync", typ: sliceType$3, tag: ""}, {prop: "New", name: "New", pkg: "", typ: funcType, tag: ""}]); - Mutex.init([{prop: "state", name: "state", pkg: "sync", typ: $Int32, tag: ""}, {prop: "sema", name: "sema", pkg: "sync", typ: $Uint32, tag: ""}]); - Locker.init([{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]); - Once.init([{prop: "m", name: "m", pkg: "sync", typ: Mutex, tag: ""}, {prop: "done", name: "done", pkg: "sync", typ: $Uint32, tag: ""}]); - poolLocal.init([{prop: "private$0", name: "private", pkg: "sync", typ: $emptyInterface, tag: ""}, {prop: "shared", name: "shared", pkg: "sync", typ: sliceType$3, tag: ""}, {prop: "Mutex", name: "", pkg: "", typ: Mutex, tag: ""}, {prop: "pad", name: "pad", pkg: "sync", typ: arrayType$1, tag: ""}]); - syncSema.init([{prop: "lock", name: "lock", pkg: "sync", typ: $Uintptr, tag: ""}, {prop: "head", name: "head", pkg: "sync", typ: $UnsafePointer, tag: ""}, {prop: "tail", name: "tail", pkg: "sync", typ: $UnsafePointer, tag: ""}]); - RWMutex.init([{prop: "w", name: "w", pkg: "sync", typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", pkg: "sync", typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", pkg: "sync", typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", pkg: "sync", typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", pkg: "sync", typ: $Int32, tag: ""}]); - rlocker.init([{prop: "w", name: "w", pkg: "sync", typ: Mutex, tag: ""}, {prop: "writerSem", name: "writerSem", pkg: "sync", typ: $Uint32, tag: ""}, {prop: "readerSem", name: "readerSem", pkg: "sync", typ: $Uint32, tag: ""}, {prop: "readerCount", name: "readerCount", pkg: "sync", typ: $Int32, tag: ""}, {prop: "readerWait", name: "readerWait", pkg: "sync", typ: $Int32, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = race.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = atomic.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - allPools = sliceType.nil; - semWaiters = {}; - init(); - init$1(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["io"] = (function() { - var $pkg = {}, $init, errors, sync, Reader, Writer, ByteScanner, RuneReader, stringWriter, sliceType, errWhence, errOffset, WriteString, ReadAtLeast, ReadFull; - errors = $packages["errors"]; - sync = $packages["sync"]; - Reader = $pkg.Reader = $newType(8, $kindInterface, "io.Reader", "Reader", "io", null); - Writer = $pkg.Writer = $newType(8, $kindInterface, "io.Writer", "Writer", "io", null); - ByteScanner = $pkg.ByteScanner = $newType(8, $kindInterface, "io.ByteScanner", "ByteScanner", "io", null); - RuneReader = $pkg.RuneReader = $newType(8, $kindInterface, "io.RuneReader", "RuneReader", "io", null); - stringWriter = $pkg.stringWriter = $newType(8, $kindInterface, "io.stringWriter", "stringWriter", "io", null); - sliceType = $sliceType($Uint8); - WriteString = function(w, s) { - var $ptr, _r, _r$1, _tuple, _tuple$1, _tuple$2, err, n, ok, s, sw, w, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; err = $f.err; n = $f.n; ok = $f.ok; s = $f.s; sw = $f.sw; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - _tuple = $assertType(w, stringWriter, true); - sw = _tuple[0]; - ok = _tuple[1]; - /* */ if (ok) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (ok) { */ case 1: - _r = sw.WriteString(s); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple$1 = _r; - n = _tuple$1[0]; - err = _tuple$1[1]; - /* */ $s = 4; case 4: - return [n, err]; - /* } */ case 2: - _r$1 = w.Write(new sliceType($stringToBytes(s))); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$2 = _r$1; - n = _tuple$2[0]; - err = _tuple$2[1]; - /* */ $s = 6; case 6: - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: WriteString }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.err = err; $f.n = n; $f.ok = ok; $f.s = s; $f.sw = sw; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.WriteString = WriteString; - ReadAtLeast = function(r, buf, min) { - var $ptr, _r, _tmp, _tmp$1, _tuple, buf, err, min, n, nn, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; buf = $f.buf; err = $f.err; min = $f.min; n = $f.n; nn = $f.nn; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - if (buf.$length < min) { - _tmp = 0; - _tmp$1 = $pkg.ErrShortBuffer; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - /* while (true) { */ case 1: - /* if (!(n < min && $interfaceIsEqual(err, $ifaceNil))) { break; } */ if(!(n < min && $interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; } - nn = 0; - _r = r.Read($subslice(buf, n)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - nn = _tuple[0]; - err = _tuple[1]; - n = n + (nn) >> 0; - /* } */ $s = 1; continue; case 2: - if (n >= min) { - err = $ifaceNil; - } else if (n > 0 && $interfaceIsEqual(err, $pkg.EOF)) { - err = $pkg.ErrUnexpectedEOF; - } - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: ReadAtLeast }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.min = min; $f.n = n; $f.nn = nn; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.ReadAtLeast = ReadAtLeast; - ReadFull = function(r, buf) { - var $ptr, _r, _tuple, buf, err, n, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; buf = $f.buf; err = $f.err; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - _r = ReadAtLeast(r, buf, buf.$length); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - n = _tuple[0]; - err = _tuple[1]; - /* */ $s = 2; case 2: - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: ReadFull }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.buf = buf; $f.err = err; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.ReadFull = ReadFull; - Reader.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); - Writer.init([{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); - ByteScanner.init([{prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}]); - RuneReader.init([{prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}]); - stringWriter.init([{prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $pkg.ErrShortWrite = errors.New("short write"); - $pkg.ErrShortBuffer = errors.New("short buffer"); - $pkg.EOF = errors.New("EOF"); - $pkg.ErrUnexpectedEOF = errors.New("unexpected EOF"); - $pkg.ErrNoProgress = errors.New("multiple Read calls return no data or error"); - errWhence = errors.New("Seek: invalid whence"); - errOffset = errors.New("Seek: invalid offset"); - $pkg.ErrClosedPipe = errors.New("io: read/write on closed pipe"); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["unicode"] = (function() { - var $pkg = {}, $init, RangeTable, Range16, Range32, CaseRange, d, foldPair, arrayType, sliceType, sliceType$1, sliceType$3, sliceType$4, _L, _Nd, _CaseRanges, properties, caseOrbit, to, IsDigit, IsLetter, is16, is32, isExcludingLatin, To, ToUpper, ToLower, SimpleFold; - RangeTable = $pkg.RangeTable = $newType(0, $kindStruct, "unicode.RangeTable", "RangeTable", "unicode", function(R16_, R32_, LatinOffset_) { - this.$val = this; - if (arguments.length === 0) { - this.R16 = sliceType.nil; - this.R32 = sliceType$1.nil; - this.LatinOffset = 0; - return; - } - this.R16 = R16_; - this.R32 = R32_; - this.LatinOffset = LatinOffset_; - }); - Range16 = $pkg.Range16 = $newType(0, $kindStruct, "unicode.Range16", "Range16", "unicode", function(Lo_, Hi_, Stride_) { - this.$val = this; - if (arguments.length === 0) { - this.Lo = 0; - this.Hi = 0; - this.Stride = 0; - return; - } - this.Lo = Lo_; - this.Hi = Hi_; - this.Stride = Stride_; - }); - Range32 = $pkg.Range32 = $newType(0, $kindStruct, "unicode.Range32", "Range32", "unicode", function(Lo_, Hi_, Stride_) { - this.$val = this; - if (arguments.length === 0) { - this.Lo = 0; - this.Hi = 0; - this.Stride = 0; - return; - } - this.Lo = Lo_; - this.Hi = Hi_; - this.Stride = Stride_; - }); - CaseRange = $pkg.CaseRange = $newType(0, $kindStruct, "unicode.CaseRange", "CaseRange", "unicode", function(Lo_, Hi_, Delta_) { - this.$val = this; - if (arguments.length === 0) { - this.Lo = 0; - this.Hi = 0; - this.Delta = arrayType.zero(); - return; - } - this.Lo = Lo_; - this.Hi = Hi_; - this.Delta = Delta_; - }); - d = $pkg.d = $newType(12, $kindArray, "unicode.d", "d", "unicode", null); - foldPair = $pkg.foldPair = $newType(0, $kindStruct, "unicode.foldPair", "foldPair", "unicode", function(From_, To_) { - this.$val = this; - if (arguments.length === 0) { - this.From = 0; - this.To = 0; - return; - } - this.From = From_; - this.To = To_; - }); - arrayType = $arrayType($Int32, 3); - sliceType = $sliceType(Range16); - sliceType$1 = $sliceType(Range32); - sliceType$3 = $sliceType(CaseRange); - sliceType$4 = $sliceType(foldPair); - to = function(_case, r, caseRange) { - var $ptr, _case, _q, caseRange, cr, delta, hi, lo, m, r, x; - if (_case < 0 || 3 <= _case) { - return 65533; - } - lo = 0; - hi = caseRange.$length; - while (true) { - if (!(lo < hi)) { break; } - m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - cr = ((m < 0 || m >= caseRange.$length) ? $throwRuntimeError("index out of range") : caseRange.$array[caseRange.$offset + m]); - if ((cr.Lo >> 0) <= r && r <= (cr.Hi >> 0)) { - delta = (x = cr.Delta, ((_case < 0 || _case >= x.length) ? $throwRuntimeError("index out of range") : x[_case])); - if (delta > 1114111) { - return (cr.Lo >> 0) + ((((((r - (cr.Lo >> 0) >> 0)) & ~1) >> 0) | ((_case & 1) >> 0))) >> 0; - } - return r + delta >> 0; - } - if (r < (cr.Lo >> 0)) { - hi = m; - } else { - lo = m + 1 >> 0; - } - } - return r; - }; - IsDigit = function(r) { - var $ptr, r; - if (r <= 255) { - return 48 <= r && r <= 57; - } - return isExcludingLatin($pkg.Digit, r); - }; - $pkg.IsDigit = IsDigit; - IsLetter = function(r) { - var $ptr, r, x; - if ((r >>> 0) <= 255) { - return !(((((x = (r << 24 >>> 24), ((x < 0 || x >= properties.length) ? $throwRuntimeError("index out of range") : properties[x])) & 96) >>> 0) === 0)); - } - return isExcludingLatin($pkg.Letter, r); - }; - $pkg.IsLetter = IsLetter; - is16 = function(ranges, r) { - var $ptr, _i, _q, _r, _r$1, _ref, hi, i, lo, m, r, range_, range_$1, ranges; - if (ranges.$length <= 18 || r <= 255) { - _ref = ranges; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - range_ = ((i < 0 || i >= ranges.$length) ? $throwRuntimeError("index out of range") : ranges.$array[ranges.$offset + i]); - if (r < range_.Lo) { - return false; - } - if (r <= range_.Hi) { - return (_r = ((r - range_.Lo << 16 >>> 16)) % range_.Stride, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0; - } - _i++; - } - return false; - } - lo = 0; - hi = ranges.$length; - while (true) { - if (!(lo < hi)) { break; } - m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - range_$1 = ((m < 0 || m >= ranges.$length) ? $throwRuntimeError("index out of range") : ranges.$array[ranges.$offset + m]); - if (range_$1.Lo <= r && r <= range_$1.Hi) { - return (_r$1 = ((r - range_$1.Lo << 16 >>> 16)) % range_$1.Stride, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0; - } - if (r < range_$1.Lo) { - hi = m; - } else { - lo = m + 1 >> 0; - } - } - return false; - }; - is32 = function(ranges, r) { - var $ptr, _i, _q, _r, _r$1, _ref, hi, i, lo, m, r, range_, range_$1, ranges; - if (ranges.$length <= 18) { - _ref = ranges; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - range_ = ((i < 0 || i >= ranges.$length) ? $throwRuntimeError("index out of range") : ranges.$array[ranges.$offset + i]); - if (r < range_.Lo) { - return false; - } - if (r <= range_.Hi) { - return (_r = ((r - range_.Lo >>> 0)) % range_.Stride, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0; - } - _i++; - } - return false; - } - lo = 0; - hi = ranges.$length; - while (true) { - if (!(lo < hi)) { break; } - m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - range_$1 = $clone(((m < 0 || m >= ranges.$length) ? $throwRuntimeError("index out of range") : ranges.$array[ranges.$offset + m]), Range32); - if (range_$1.Lo <= r && r <= range_$1.Hi) { - return (_r$1 = ((r - range_$1.Lo >>> 0)) % range_$1.Stride, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0; - } - if (r < range_$1.Lo) { - hi = m; - } else { - lo = m + 1 >> 0; - } - } - return false; - }; - isExcludingLatin = function(rangeTab, r) { - var $ptr, off, r, r16, r32, rangeTab, x; - r16 = rangeTab.R16; - off = rangeTab.LatinOffset; - if (r16.$length > off && r <= ((x = r16.$length - 1 >> 0, ((x < 0 || x >= r16.$length) ? $throwRuntimeError("index out of range") : r16.$array[r16.$offset + x])).Hi >> 0)) { - return is16($subslice(r16, off), (r << 16 >>> 16)); - } - r32 = rangeTab.R32; - if (r32.$length > 0 && r >= ((0 >= r32.$length ? $throwRuntimeError("index out of range") : r32.$array[r32.$offset + 0]).Lo >> 0)) { - return is32(r32, (r >>> 0)); - } - return false; - }; - To = function(_case, r) { - var $ptr, _case, r; - return to(_case, r, $pkg.CaseRanges); - }; - $pkg.To = To; - ToUpper = function(r) { - var $ptr, r; - if (r <= 127) { - if (97 <= r && r <= 122) { - r = r - (32) >> 0; - } - return r; - } - return To(0, r); - }; - $pkg.ToUpper = ToUpper; - ToLower = function(r) { - var $ptr, r; - if (r <= 127) { - if (65 <= r && r <= 90) { - r = r + (32) >> 0; - } - return r; - } - return To(1, r); - }; - $pkg.ToLower = ToLower; - SimpleFold = function(r) { - var $ptr, _q, hi, l, lo, m, r; - lo = 0; - hi = caseOrbit.$length; - while (true) { - if (!(lo < hi)) { break; } - m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - if ((((m < 0 || m >= caseOrbit.$length) ? $throwRuntimeError("index out of range") : caseOrbit.$array[caseOrbit.$offset + m]).From >> 0) < r) { - lo = m + 1 >> 0; - } else { - hi = m; - } - } - if (lo < caseOrbit.$length && ((((lo < 0 || lo >= caseOrbit.$length) ? $throwRuntimeError("index out of range") : caseOrbit.$array[caseOrbit.$offset + lo]).From >> 0) === r)) { - return (((lo < 0 || lo >= caseOrbit.$length) ? $throwRuntimeError("index out of range") : caseOrbit.$array[caseOrbit.$offset + lo]).To >> 0); - } - l = ToLower(r); - if (!((l === r))) { - return l; - } - return ToUpper(r); - }; - $pkg.SimpleFold = SimpleFold; - RangeTable.init([{prop: "R16", name: "R16", pkg: "", typ: sliceType, tag: ""}, {prop: "R32", name: "R32", pkg: "", typ: sliceType$1, tag: ""}, {prop: "LatinOffset", name: "LatinOffset", pkg: "", typ: $Int, tag: ""}]); - Range16.init([{prop: "Lo", name: "Lo", pkg: "", typ: $Uint16, tag: ""}, {prop: "Hi", name: "Hi", pkg: "", typ: $Uint16, tag: ""}, {prop: "Stride", name: "Stride", pkg: "", typ: $Uint16, tag: ""}]); - Range32.init([{prop: "Lo", name: "Lo", pkg: "", typ: $Uint32, tag: ""}, {prop: "Hi", name: "Hi", pkg: "", typ: $Uint32, tag: ""}, {prop: "Stride", name: "Stride", pkg: "", typ: $Uint32, tag: ""}]); - CaseRange.init([{prop: "Lo", name: "Lo", pkg: "", typ: $Uint32, tag: ""}, {prop: "Hi", name: "Hi", pkg: "", typ: $Uint32, tag: ""}, {prop: "Delta", name: "Delta", pkg: "", typ: d, tag: ""}]); - d.init($Int32, 3); - foldPair.init([{prop: "From", name: "From", pkg: "", typ: $Uint16, tag: ""}, {prop: "To", name: "To", pkg: "", typ: $Uint16, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _L = new RangeTable.ptr(new sliceType([new Range16.ptr(65, 90, 1), new Range16.ptr(97, 122, 1), new Range16.ptr(170, 181, 11), new Range16.ptr(186, 192, 6), new Range16.ptr(193, 214, 1), new Range16.ptr(216, 246, 1), new Range16.ptr(248, 705, 1), new Range16.ptr(710, 721, 1), new Range16.ptr(736, 740, 1), new Range16.ptr(748, 750, 2), new Range16.ptr(880, 884, 1), new Range16.ptr(886, 887, 1), new Range16.ptr(890, 893, 1), new Range16.ptr(895, 902, 7), new Range16.ptr(904, 906, 1), new Range16.ptr(908, 910, 2), new Range16.ptr(911, 929, 1), new Range16.ptr(931, 1013, 1), new Range16.ptr(1015, 1153, 1), new Range16.ptr(1162, 1327, 1), new Range16.ptr(1329, 1366, 1), new Range16.ptr(1369, 1377, 8), new Range16.ptr(1378, 1415, 1), new Range16.ptr(1488, 1514, 1), new Range16.ptr(1520, 1522, 1), new Range16.ptr(1568, 1610, 1), new Range16.ptr(1646, 1647, 1), new Range16.ptr(1649, 1747, 1), new Range16.ptr(1749, 1765, 16), new Range16.ptr(1766, 1774, 8), new Range16.ptr(1775, 1786, 11), new Range16.ptr(1787, 1788, 1), new Range16.ptr(1791, 1808, 17), new Range16.ptr(1810, 1839, 1), new Range16.ptr(1869, 1957, 1), new Range16.ptr(1969, 1994, 25), new Range16.ptr(1995, 2026, 1), new Range16.ptr(2036, 2037, 1), new Range16.ptr(2042, 2048, 6), new Range16.ptr(2049, 2069, 1), new Range16.ptr(2074, 2084, 10), new Range16.ptr(2088, 2112, 24), new Range16.ptr(2113, 2136, 1), new Range16.ptr(2208, 2228, 1), new Range16.ptr(2308, 2361, 1), new Range16.ptr(2365, 2384, 19), new Range16.ptr(2392, 2401, 1), new Range16.ptr(2417, 2432, 1), new Range16.ptr(2437, 2444, 1), new Range16.ptr(2447, 2448, 1), new Range16.ptr(2451, 2472, 1), new Range16.ptr(2474, 2480, 1), new Range16.ptr(2482, 2486, 4), new Range16.ptr(2487, 2489, 1), new Range16.ptr(2493, 2510, 17), new Range16.ptr(2524, 2525, 1), new Range16.ptr(2527, 2529, 1), new Range16.ptr(2544, 2545, 1), new Range16.ptr(2565, 2570, 1), new Range16.ptr(2575, 2576, 1), new Range16.ptr(2579, 2600, 1), new Range16.ptr(2602, 2608, 1), new Range16.ptr(2610, 2611, 1), new Range16.ptr(2613, 2614, 1), new Range16.ptr(2616, 2617, 1), new Range16.ptr(2649, 2652, 1), new Range16.ptr(2654, 2674, 20), new Range16.ptr(2675, 2676, 1), new Range16.ptr(2693, 2701, 1), new Range16.ptr(2703, 2705, 1), new Range16.ptr(2707, 2728, 1), new Range16.ptr(2730, 2736, 1), new Range16.ptr(2738, 2739, 1), new Range16.ptr(2741, 2745, 1), new Range16.ptr(2749, 2768, 19), new Range16.ptr(2784, 2785, 1), new Range16.ptr(2809, 2821, 12), new Range16.ptr(2822, 2828, 1), new Range16.ptr(2831, 2832, 1), new Range16.ptr(2835, 2856, 1), new Range16.ptr(2858, 2864, 1), new Range16.ptr(2866, 2867, 1), new Range16.ptr(2869, 2873, 1), new Range16.ptr(2877, 2908, 31), new Range16.ptr(2909, 2911, 2), new Range16.ptr(2912, 2913, 1), new Range16.ptr(2929, 2947, 18), new Range16.ptr(2949, 2954, 1), new Range16.ptr(2958, 2960, 1), new Range16.ptr(2962, 2965, 1), new Range16.ptr(2969, 2970, 1), new Range16.ptr(2972, 2974, 2), new Range16.ptr(2975, 2979, 4), new Range16.ptr(2980, 2984, 4), new Range16.ptr(2985, 2986, 1), new Range16.ptr(2990, 3001, 1), new Range16.ptr(3024, 3077, 53), new Range16.ptr(3078, 3084, 1), new Range16.ptr(3086, 3088, 1), new Range16.ptr(3090, 3112, 1), new Range16.ptr(3114, 3129, 1), new Range16.ptr(3133, 3160, 27), new Range16.ptr(3161, 3162, 1), new Range16.ptr(3168, 3169, 1), new Range16.ptr(3205, 3212, 1), new Range16.ptr(3214, 3216, 1), new Range16.ptr(3218, 3240, 1), new Range16.ptr(3242, 3251, 1), new Range16.ptr(3253, 3257, 1), new Range16.ptr(3261, 3294, 33), new Range16.ptr(3296, 3297, 1), new Range16.ptr(3313, 3314, 1), new Range16.ptr(3333, 3340, 1), new Range16.ptr(3342, 3344, 1), new Range16.ptr(3346, 3386, 1), new Range16.ptr(3389, 3423, 17), new Range16.ptr(3424, 3425, 1), new Range16.ptr(3450, 3455, 1), new Range16.ptr(3461, 3478, 1), new Range16.ptr(3482, 3505, 1), new Range16.ptr(3507, 3515, 1), new Range16.ptr(3517, 3520, 3), new Range16.ptr(3521, 3526, 1), new Range16.ptr(3585, 3632, 1), new Range16.ptr(3634, 3635, 1), new Range16.ptr(3648, 3654, 1), new Range16.ptr(3713, 3714, 1), new Range16.ptr(3716, 3719, 3), new Range16.ptr(3720, 3722, 2), new Range16.ptr(3725, 3732, 7), new Range16.ptr(3733, 3735, 1), new Range16.ptr(3737, 3743, 1), new Range16.ptr(3745, 3747, 1), new Range16.ptr(3749, 3751, 2), new Range16.ptr(3754, 3755, 1), new Range16.ptr(3757, 3760, 1), new Range16.ptr(3762, 3763, 1), new Range16.ptr(3773, 3776, 3), new Range16.ptr(3777, 3780, 1), new Range16.ptr(3782, 3804, 22), new Range16.ptr(3805, 3807, 1), new Range16.ptr(3840, 3904, 64), new Range16.ptr(3905, 3911, 1), new Range16.ptr(3913, 3948, 1), new Range16.ptr(3976, 3980, 1), new Range16.ptr(4096, 4138, 1), new Range16.ptr(4159, 4176, 17), new Range16.ptr(4177, 4181, 1), new Range16.ptr(4186, 4189, 1), new Range16.ptr(4193, 4197, 4), new Range16.ptr(4198, 4206, 8), new Range16.ptr(4207, 4208, 1), new Range16.ptr(4213, 4225, 1), new Range16.ptr(4238, 4256, 18), new Range16.ptr(4257, 4293, 1), new Range16.ptr(4295, 4301, 6), new Range16.ptr(4304, 4346, 1), new Range16.ptr(4348, 4680, 1), new Range16.ptr(4682, 4685, 1), new Range16.ptr(4688, 4694, 1), new Range16.ptr(4696, 4698, 2), new Range16.ptr(4699, 4701, 1), new Range16.ptr(4704, 4744, 1), new Range16.ptr(4746, 4749, 1), new Range16.ptr(4752, 4784, 1), new Range16.ptr(4786, 4789, 1), new Range16.ptr(4792, 4798, 1), new Range16.ptr(4800, 4802, 2), new Range16.ptr(4803, 4805, 1), new Range16.ptr(4808, 4822, 1), new Range16.ptr(4824, 4880, 1), new Range16.ptr(4882, 4885, 1), new Range16.ptr(4888, 4954, 1), new Range16.ptr(4992, 5007, 1), new Range16.ptr(5024, 5109, 1), new Range16.ptr(5112, 5117, 1), new Range16.ptr(5121, 5740, 1), new Range16.ptr(5743, 5759, 1), new Range16.ptr(5761, 5786, 1), new Range16.ptr(5792, 5866, 1), new Range16.ptr(5873, 5880, 1), new Range16.ptr(5888, 5900, 1), new Range16.ptr(5902, 5905, 1), new Range16.ptr(5920, 5937, 1), new Range16.ptr(5952, 5969, 1), new Range16.ptr(5984, 5996, 1), new Range16.ptr(5998, 6000, 1), new Range16.ptr(6016, 6067, 1), new Range16.ptr(6103, 6108, 5), new Range16.ptr(6176, 6263, 1), new Range16.ptr(6272, 6312, 1), new Range16.ptr(6314, 6320, 6), new Range16.ptr(6321, 6389, 1), new Range16.ptr(6400, 6430, 1), new Range16.ptr(6480, 6509, 1), new Range16.ptr(6512, 6516, 1), new Range16.ptr(6528, 6571, 1), new Range16.ptr(6576, 6601, 1), new Range16.ptr(6656, 6678, 1), new Range16.ptr(6688, 6740, 1), new Range16.ptr(6823, 6917, 94), new Range16.ptr(6918, 6963, 1), new Range16.ptr(6981, 6987, 1), new Range16.ptr(7043, 7072, 1), new Range16.ptr(7086, 7087, 1), new Range16.ptr(7098, 7141, 1), new Range16.ptr(7168, 7203, 1), new Range16.ptr(7245, 7247, 1), new Range16.ptr(7258, 7293, 1), new Range16.ptr(7401, 7404, 1), new Range16.ptr(7406, 7409, 1), new Range16.ptr(7413, 7414, 1), new Range16.ptr(7424, 7615, 1), new Range16.ptr(7680, 7957, 1), new Range16.ptr(7960, 7965, 1), new Range16.ptr(7968, 8005, 1), new Range16.ptr(8008, 8013, 1), new Range16.ptr(8016, 8023, 1), new Range16.ptr(8025, 8031, 2), new Range16.ptr(8032, 8061, 1), new Range16.ptr(8064, 8116, 1), new Range16.ptr(8118, 8124, 1), new Range16.ptr(8126, 8130, 4), new Range16.ptr(8131, 8132, 1), new Range16.ptr(8134, 8140, 1), new Range16.ptr(8144, 8147, 1), new Range16.ptr(8150, 8155, 1), new Range16.ptr(8160, 8172, 1), new Range16.ptr(8178, 8180, 1), new Range16.ptr(8182, 8188, 1), new Range16.ptr(8305, 8319, 14), new Range16.ptr(8336, 8348, 1), new Range16.ptr(8450, 8455, 5), new Range16.ptr(8458, 8467, 1), new Range16.ptr(8469, 8473, 4), new Range16.ptr(8474, 8477, 1), new Range16.ptr(8484, 8490, 2), new Range16.ptr(8491, 8493, 1), new Range16.ptr(8495, 8505, 1), new Range16.ptr(8508, 8511, 1), new Range16.ptr(8517, 8521, 1), new Range16.ptr(8526, 8579, 53), new Range16.ptr(8580, 11264, 2684), new Range16.ptr(11265, 11310, 1), new Range16.ptr(11312, 11358, 1), new Range16.ptr(11360, 11492, 1), new Range16.ptr(11499, 11502, 1), new Range16.ptr(11506, 11507, 1), new Range16.ptr(11520, 11557, 1), new Range16.ptr(11559, 11565, 6), new Range16.ptr(11568, 11623, 1), new Range16.ptr(11631, 11648, 17), new Range16.ptr(11649, 11670, 1), new Range16.ptr(11680, 11686, 1), new Range16.ptr(11688, 11694, 1), new Range16.ptr(11696, 11702, 1), new Range16.ptr(11704, 11710, 1), new Range16.ptr(11712, 11718, 1), new Range16.ptr(11720, 11726, 1), new Range16.ptr(11728, 11734, 1), new Range16.ptr(11736, 11742, 1), new Range16.ptr(11823, 12293, 470), new Range16.ptr(12294, 12337, 43), new Range16.ptr(12338, 12341, 1), new Range16.ptr(12347, 12348, 1), new Range16.ptr(12353, 12438, 1), new Range16.ptr(12445, 12447, 1), new Range16.ptr(12449, 12538, 1), new Range16.ptr(12540, 12543, 1), new Range16.ptr(12549, 12589, 1), new Range16.ptr(12593, 12686, 1), new Range16.ptr(12704, 12730, 1), new Range16.ptr(12784, 12799, 1), new Range16.ptr(13312, 19893, 1), new Range16.ptr(19968, 40917, 1), new Range16.ptr(40960, 42124, 1), new Range16.ptr(42192, 42237, 1), new Range16.ptr(42240, 42508, 1), new Range16.ptr(42512, 42527, 1), new Range16.ptr(42538, 42539, 1), new Range16.ptr(42560, 42606, 1), new Range16.ptr(42623, 42653, 1), new Range16.ptr(42656, 42725, 1), new Range16.ptr(42775, 42783, 1), new Range16.ptr(42786, 42888, 1), new Range16.ptr(42891, 42925, 1), new Range16.ptr(42928, 42935, 1), new Range16.ptr(42999, 43009, 1), new Range16.ptr(43011, 43013, 1), new Range16.ptr(43015, 43018, 1), new Range16.ptr(43020, 43042, 1), new Range16.ptr(43072, 43123, 1), new Range16.ptr(43138, 43187, 1), new Range16.ptr(43250, 43255, 1), new Range16.ptr(43259, 43261, 2), new Range16.ptr(43274, 43301, 1), new Range16.ptr(43312, 43334, 1), new Range16.ptr(43360, 43388, 1), new Range16.ptr(43396, 43442, 1), new Range16.ptr(43471, 43488, 17), new Range16.ptr(43489, 43492, 1), new Range16.ptr(43494, 43503, 1), new Range16.ptr(43514, 43518, 1), new Range16.ptr(43520, 43560, 1), new Range16.ptr(43584, 43586, 1), new Range16.ptr(43588, 43595, 1), new Range16.ptr(43616, 43638, 1), new Range16.ptr(43642, 43646, 4), new Range16.ptr(43647, 43695, 1), new Range16.ptr(43697, 43701, 4), new Range16.ptr(43702, 43705, 3), new Range16.ptr(43706, 43709, 1), new Range16.ptr(43712, 43714, 2), new Range16.ptr(43739, 43741, 1), new Range16.ptr(43744, 43754, 1), new Range16.ptr(43762, 43764, 1), new Range16.ptr(43777, 43782, 1), new Range16.ptr(43785, 43790, 1), new Range16.ptr(43793, 43798, 1), new Range16.ptr(43808, 43814, 1), new Range16.ptr(43816, 43822, 1), new Range16.ptr(43824, 43866, 1), new Range16.ptr(43868, 43877, 1), new Range16.ptr(43888, 44002, 1), new Range16.ptr(44032, 55203, 1), new Range16.ptr(55216, 55238, 1), new Range16.ptr(55243, 55291, 1), new Range16.ptr(63744, 64109, 1), new Range16.ptr(64112, 64217, 1), new Range16.ptr(64256, 64262, 1), new Range16.ptr(64275, 64279, 1), new Range16.ptr(64285, 64287, 2), new Range16.ptr(64288, 64296, 1), new Range16.ptr(64298, 64310, 1), new Range16.ptr(64312, 64316, 1), new Range16.ptr(64318, 64320, 2), new Range16.ptr(64321, 64323, 2), new Range16.ptr(64324, 64326, 2), new Range16.ptr(64327, 64433, 1), new Range16.ptr(64467, 64829, 1), new Range16.ptr(64848, 64911, 1), new Range16.ptr(64914, 64967, 1), new Range16.ptr(65008, 65019, 1), new Range16.ptr(65136, 65140, 1), new Range16.ptr(65142, 65276, 1), new Range16.ptr(65313, 65338, 1), new Range16.ptr(65345, 65370, 1), new Range16.ptr(65382, 65470, 1), new Range16.ptr(65474, 65479, 1), new Range16.ptr(65482, 65487, 1), new Range16.ptr(65490, 65495, 1), new Range16.ptr(65498, 65500, 1)]), new sliceType$1([new Range32.ptr(65536, 65547, 1), new Range32.ptr(65549, 65574, 1), new Range32.ptr(65576, 65594, 1), new Range32.ptr(65596, 65597, 1), new Range32.ptr(65599, 65613, 1), new Range32.ptr(65616, 65629, 1), new Range32.ptr(65664, 65786, 1), new Range32.ptr(66176, 66204, 1), new Range32.ptr(66208, 66256, 1), new Range32.ptr(66304, 66335, 1), new Range32.ptr(66352, 66368, 1), new Range32.ptr(66370, 66377, 1), new Range32.ptr(66384, 66421, 1), new Range32.ptr(66432, 66461, 1), new Range32.ptr(66464, 66499, 1), new Range32.ptr(66504, 66511, 1), new Range32.ptr(66560, 66717, 1), new Range32.ptr(66816, 66855, 1), new Range32.ptr(66864, 66915, 1), new Range32.ptr(67072, 67382, 1), new Range32.ptr(67392, 67413, 1), new Range32.ptr(67424, 67431, 1), new Range32.ptr(67584, 67589, 1), new Range32.ptr(67592, 67594, 2), new Range32.ptr(67595, 67637, 1), new Range32.ptr(67639, 67640, 1), new Range32.ptr(67644, 67647, 3), new Range32.ptr(67648, 67669, 1), new Range32.ptr(67680, 67702, 1), new Range32.ptr(67712, 67742, 1), new Range32.ptr(67808, 67826, 1), new Range32.ptr(67828, 67829, 1), new Range32.ptr(67840, 67861, 1), new Range32.ptr(67872, 67897, 1), new Range32.ptr(67968, 68023, 1), new Range32.ptr(68030, 68031, 1), new Range32.ptr(68096, 68112, 16), new Range32.ptr(68113, 68115, 1), new Range32.ptr(68117, 68119, 1), new Range32.ptr(68121, 68147, 1), new Range32.ptr(68192, 68220, 1), new Range32.ptr(68224, 68252, 1), new Range32.ptr(68288, 68295, 1), new Range32.ptr(68297, 68324, 1), new Range32.ptr(68352, 68405, 1), new Range32.ptr(68416, 68437, 1), new Range32.ptr(68448, 68466, 1), new Range32.ptr(68480, 68497, 1), new Range32.ptr(68608, 68680, 1), new Range32.ptr(68736, 68786, 1), new Range32.ptr(68800, 68850, 1), new Range32.ptr(69635, 69687, 1), new Range32.ptr(69763, 69807, 1), new Range32.ptr(69840, 69864, 1), new Range32.ptr(69891, 69926, 1), new Range32.ptr(69968, 70002, 1), new Range32.ptr(70006, 70019, 13), new Range32.ptr(70020, 70066, 1), new Range32.ptr(70081, 70084, 1), new Range32.ptr(70106, 70108, 2), new Range32.ptr(70144, 70161, 1), new Range32.ptr(70163, 70187, 1), new Range32.ptr(70272, 70278, 1), new Range32.ptr(70280, 70282, 2), new Range32.ptr(70283, 70285, 1), new Range32.ptr(70287, 70301, 1), new Range32.ptr(70303, 70312, 1), new Range32.ptr(70320, 70366, 1), new Range32.ptr(70405, 70412, 1), new Range32.ptr(70415, 70416, 1), new Range32.ptr(70419, 70440, 1), new Range32.ptr(70442, 70448, 1), new Range32.ptr(70450, 70451, 1), new Range32.ptr(70453, 70457, 1), new Range32.ptr(70461, 70480, 19), new Range32.ptr(70493, 70497, 1), new Range32.ptr(70784, 70831, 1), new Range32.ptr(70852, 70853, 1), new Range32.ptr(70855, 71040, 185), new Range32.ptr(71041, 71086, 1), new Range32.ptr(71128, 71131, 1), new Range32.ptr(71168, 71215, 1), new Range32.ptr(71236, 71296, 60), new Range32.ptr(71297, 71338, 1), new Range32.ptr(71424, 71449, 1), new Range32.ptr(71840, 71903, 1), new Range32.ptr(71935, 72384, 449), new Range32.ptr(72385, 72440, 1), new Range32.ptr(73728, 74649, 1), new Range32.ptr(74880, 75075, 1), new Range32.ptr(77824, 78894, 1), new Range32.ptr(82944, 83526, 1), new Range32.ptr(92160, 92728, 1), new Range32.ptr(92736, 92766, 1), new Range32.ptr(92880, 92909, 1), new Range32.ptr(92928, 92975, 1), new Range32.ptr(92992, 92995, 1), new Range32.ptr(93027, 93047, 1), new Range32.ptr(93053, 93071, 1), new Range32.ptr(93952, 94020, 1), new Range32.ptr(94032, 94099, 67), new Range32.ptr(94100, 94111, 1), new Range32.ptr(110592, 110593, 1), new Range32.ptr(113664, 113770, 1), new Range32.ptr(113776, 113788, 1), new Range32.ptr(113792, 113800, 1), new Range32.ptr(113808, 113817, 1), new Range32.ptr(119808, 119892, 1), new Range32.ptr(119894, 119964, 1), new Range32.ptr(119966, 119967, 1), new Range32.ptr(119970, 119973, 3), new Range32.ptr(119974, 119977, 3), new Range32.ptr(119978, 119980, 1), new Range32.ptr(119982, 119993, 1), new Range32.ptr(119995, 119997, 2), new Range32.ptr(119998, 120003, 1), new Range32.ptr(120005, 120069, 1), new Range32.ptr(120071, 120074, 1), new Range32.ptr(120077, 120084, 1), new Range32.ptr(120086, 120092, 1), new Range32.ptr(120094, 120121, 1), new Range32.ptr(120123, 120126, 1), new Range32.ptr(120128, 120132, 1), new Range32.ptr(120134, 120138, 4), new Range32.ptr(120139, 120144, 1), new Range32.ptr(120146, 120485, 1), new Range32.ptr(120488, 120512, 1), new Range32.ptr(120514, 120538, 1), new Range32.ptr(120540, 120570, 1), new Range32.ptr(120572, 120596, 1), new Range32.ptr(120598, 120628, 1), new Range32.ptr(120630, 120654, 1), new Range32.ptr(120656, 120686, 1), new Range32.ptr(120688, 120712, 1), new Range32.ptr(120714, 120744, 1), new Range32.ptr(120746, 120770, 1), new Range32.ptr(120772, 120779, 1), new Range32.ptr(124928, 125124, 1), new Range32.ptr(126464, 126467, 1), new Range32.ptr(126469, 126495, 1), new Range32.ptr(126497, 126498, 1), new Range32.ptr(126500, 126503, 3), new Range32.ptr(126505, 126514, 1), new Range32.ptr(126516, 126519, 1), new Range32.ptr(126521, 126523, 2), new Range32.ptr(126530, 126535, 5), new Range32.ptr(126537, 126541, 2), new Range32.ptr(126542, 126543, 1), new Range32.ptr(126545, 126546, 1), new Range32.ptr(126548, 126551, 3), new Range32.ptr(126553, 126561, 2), new Range32.ptr(126562, 126564, 2), new Range32.ptr(126567, 126570, 1), new Range32.ptr(126572, 126578, 1), new Range32.ptr(126580, 126583, 1), new Range32.ptr(126585, 126588, 1), new Range32.ptr(126590, 126592, 2), new Range32.ptr(126593, 126601, 1), new Range32.ptr(126603, 126619, 1), new Range32.ptr(126625, 126627, 1), new Range32.ptr(126629, 126633, 1), new Range32.ptr(126635, 126651, 1), new Range32.ptr(131072, 173782, 1), new Range32.ptr(173824, 177972, 1), new Range32.ptr(177984, 178205, 1), new Range32.ptr(178208, 183969, 1), new Range32.ptr(194560, 195101, 1)]), 6); - _Nd = new RangeTable.ptr(new sliceType([new Range16.ptr(48, 57, 1), new Range16.ptr(1632, 1641, 1), new Range16.ptr(1776, 1785, 1), new Range16.ptr(1984, 1993, 1), new Range16.ptr(2406, 2415, 1), new Range16.ptr(2534, 2543, 1), new Range16.ptr(2662, 2671, 1), new Range16.ptr(2790, 2799, 1), new Range16.ptr(2918, 2927, 1), new Range16.ptr(3046, 3055, 1), new Range16.ptr(3174, 3183, 1), new Range16.ptr(3302, 3311, 1), new Range16.ptr(3430, 3439, 1), new Range16.ptr(3558, 3567, 1), new Range16.ptr(3664, 3673, 1), new Range16.ptr(3792, 3801, 1), new Range16.ptr(3872, 3881, 1), new Range16.ptr(4160, 4169, 1), new Range16.ptr(4240, 4249, 1), new Range16.ptr(6112, 6121, 1), new Range16.ptr(6160, 6169, 1), new Range16.ptr(6470, 6479, 1), new Range16.ptr(6608, 6617, 1), new Range16.ptr(6784, 6793, 1), new Range16.ptr(6800, 6809, 1), new Range16.ptr(6992, 7001, 1), new Range16.ptr(7088, 7097, 1), new Range16.ptr(7232, 7241, 1), new Range16.ptr(7248, 7257, 1), new Range16.ptr(42528, 42537, 1), new Range16.ptr(43216, 43225, 1), new Range16.ptr(43264, 43273, 1), new Range16.ptr(43472, 43481, 1), new Range16.ptr(43504, 43513, 1), new Range16.ptr(43600, 43609, 1), new Range16.ptr(44016, 44025, 1), new Range16.ptr(65296, 65305, 1)]), new sliceType$1([new Range32.ptr(66720, 66729, 1), new Range32.ptr(69734, 69743, 1), new Range32.ptr(69872, 69881, 1), new Range32.ptr(69942, 69951, 1), new Range32.ptr(70096, 70105, 1), new Range32.ptr(70384, 70393, 1), new Range32.ptr(70864, 70873, 1), new Range32.ptr(71248, 71257, 1), new Range32.ptr(71360, 71369, 1), new Range32.ptr(71472, 71481, 1), new Range32.ptr(71904, 71913, 1), new Range32.ptr(92768, 92777, 1), new Range32.ptr(93008, 93017, 1), new Range32.ptr(120782, 120831, 1)]), 1); - $pkg.Digit = _Nd; - $pkg.Letter = _L; - _CaseRanges = new sliceType$3([new CaseRange.ptr(65, 90, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(97, 122, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(181, 181, $toNativeArray($kindInt32, [743, 0, 743])), new CaseRange.ptr(192, 214, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(216, 222, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(224, 246, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(248, 254, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(255, 255, $toNativeArray($kindInt32, [121, 0, 121])), new CaseRange.ptr(256, 303, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(304, 304, $toNativeArray($kindInt32, [0, -199, 0])), new CaseRange.ptr(305, 305, $toNativeArray($kindInt32, [-232, 0, -232])), new CaseRange.ptr(306, 311, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(313, 328, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(330, 375, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(376, 376, $toNativeArray($kindInt32, [0, -121, 0])), new CaseRange.ptr(377, 382, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(383, 383, $toNativeArray($kindInt32, [-300, 0, -300])), new CaseRange.ptr(384, 384, $toNativeArray($kindInt32, [195, 0, 195])), new CaseRange.ptr(385, 385, $toNativeArray($kindInt32, [0, 210, 0])), new CaseRange.ptr(386, 389, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(390, 390, $toNativeArray($kindInt32, [0, 206, 0])), new CaseRange.ptr(391, 392, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(393, 394, $toNativeArray($kindInt32, [0, 205, 0])), new CaseRange.ptr(395, 396, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(398, 398, $toNativeArray($kindInt32, [0, 79, 0])), new CaseRange.ptr(399, 399, $toNativeArray($kindInt32, [0, 202, 0])), new CaseRange.ptr(400, 400, $toNativeArray($kindInt32, [0, 203, 0])), new CaseRange.ptr(401, 402, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(403, 403, $toNativeArray($kindInt32, [0, 205, 0])), new CaseRange.ptr(404, 404, $toNativeArray($kindInt32, [0, 207, 0])), new CaseRange.ptr(405, 405, $toNativeArray($kindInt32, [97, 0, 97])), new CaseRange.ptr(406, 406, $toNativeArray($kindInt32, [0, 211, 0])), new CaseRange.ptr(407, 407, $toNativeArray($kindInt32, [0, 209, 0])), new CaseRange.ptr(408, 409, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(410, 410, $toNativeArray($kindInt32, [163, 0, 163])), new CaseRange.ptr(412, 412, $toNativeArray($kindInt32, [0, 211, 0])), new CaseRange.ptr(413, 413, $toNativeArray($kindInt32, [0, 213, 0])), new CaseRange.ptr(414, 414, $toNativeArray($kindInt32, [130, 0, 130])), new CaseRange.ptr(415, 415, $toNativeArray($kindInt32, [0, 214, 0])), new CaseRange.ptr(416, 421, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(422, 422, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(423, 424, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(425, 425, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(428, 429, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(430, 430, $toNativeArray($kindInt32, [0, 218, 0])), new CaseRange.ptr(431, 432, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(433, 434, $toNativeArray($kindInt32, [0, 217, 0])), new CaseRange.ptr(435, 438, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(439, 439, $toNativeArray($kindInt32, [0, 219, 0])), new CaseRange.ptr(440, 441, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(444, 445, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(447, 447, $toNativeArray($kindInt32, [56, 0, 56])), new CaseRange.ptr(452, 452, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(453, 453, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(454, 454, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(455, 455, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(456, 456, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(457, 457, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(458, 458, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(459, 459, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(460, 460, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(461, 476, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(477, 477, $toNativeArray($kindInt32, [-79, 0, -79])), new CaseRange.ptr(478, 495, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(497, 497, $toNativeArray($kindInt32, [0, 2, 1])), new CaseRange.ptr(498, 498, $toNativeArray($kindInt32, [-1, 1, 0])), new CaseRange.ptr(499, 499, $toNativeArray($kindInt32, [-2, 0, -1])), new CaseRange.ptr(500, 501, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(502, 502, $toNativeArray($kindInt32, [0, -97, 0])), new CaseRange.ptr(503, 503, $toNativeArray($kindInt32, [0, -56, 0])), new CaseRange.ptr(504, 543, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(544, 544, $toNativeArray($kindInt32, [0, -130, 0])), new CaseRange.ptr(546, 563, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(570, 570, $toNativeArray($kindInt32, [0, 10795, 0])), new CaseRange.ptr(571, 572, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(573, 573, $toNativeArray($kindInt32, [0, -163, 0])), new CaseRange.ptr(574, 574, $toNativeArray($kindInt32, [0, 10792, 0])), new CaseRange.ptr(575, 576, $toNativeArray($kindInt32, [10815, 0, 10815])), new CaseRange.ptr(577, 578, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(579, 579, $toNativeArray($kindInt32, [0, -195, 0])), new CaseRange.ptr(580, 580, $toNativeArray($kindInt32, [0, 69, 0])), new CaseRange.ptr(581, 581, $toNativeArray($kindInt32, [0, 71, 0])), new CaseRange.ptr(582, 591, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(592, 592, $toNativeArray($kindInt32, [10783, 0, 10783])), new CaseRange.ptr(593, 593, $toNativeArray($kindInt32, [10780, 0, 10780])), new CaseRange.ptr(594, 594, $toNativeArray($kindInt32, [10782, 0, 10782])), new CaseRange.ptr(595, 595, $toNativeArray($kindInt32, [-210, 0, -210])), new CaseRange.ptr(596, 596, $toNativeArray($kindInt32, [-206, 0, -206])), new CaseRange.ptr(598, 599, $toNativeArray($kindInt32, [-205, 0, -205])), new CaseRange.ptr(601, 601, $toNativeArray($kindInt32, [-202, 0, -202])), new CaseRange.ptr(603, 603, $toNativeArray($kindInt32, [-203, 0, -203])), new CaseRange.ptr(604, 604, $toNativeArray($kindInt32, [42319, 0, 42319])), new CaseRange.ptr(608, 608, $toNativeArray($kindInt32, [-205, 0, -205])), new CaseRange.ptr(609, 609, $toNativeArray($kindInt32, [42315, 0, 42315])), new CaseRange.ptr(611, 611, $toNativeArray($kindInt32, [-207, 0, -207])), new CaseRange.ptr(613, 613, $toNativeArray($kindInt32, [42280, 0, 42280])), new CaseRange.ptr(614, 614, $toNativeArray($kindInt32, [42308, 0, 42308])), new CaseRange.ptr(616, 616, $toNativeArray($kindInt32, [-209, 0, -209])), new CaseRange.ptr(617, 617, $toNativeArray($kindInt32, [-211, 0, -211])), new CaseRange.ptr(619, 619, $toNativeArray($kindInt32, [10743, 0, 10743])), new CaseRange.ptr(620, 620, $toNativeArray($kindInt32, [42305, 0, 42305])), new CaseRange.ptr(623, 623, $toNativeArray($kindInt32, [-211, 0, -211])), new CaseRange.ptr(625, 625, $toNativeArray($kindInt32, [10749, 0, 10749])), new CaseRange.ptr(626, 626, $toNativeArray($kindInt32, [-213, 0, -213])), new CaseRange.ptr(629, 629, $toNativeArray($kindInt32, [-214, 0, -214])), new CaseRange.ptr(637, 637, $toNativeArray($kindInt32, [10727, 0, 10727])), new CaseRange.ptr(640, 640, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(643, 643, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(647, 647, $toNativeArray($kindInt32, [42282, 0, 42282])), new CaseRange.ptr(648, 648, $toNativeArray($kindInt32, [-218, 0, -218])), new CaseRange.ptr(649, 649, $toNativeArray($kindInt32, [-69, 0, -69])), new CaseRange.ptr(650, 651, $toNativeArray($kindInt32, [-217, 0, -217])), new CaseRange.ptr(652, 652, $toNativeArray($kindInt32, [-71, 0, -71])), new CaseRange.ptr(658, 658, $toNativeArray($kindInt32, [-219, 0, -219])), new CaseRange.ptr(669, 669, $toNativeArray($kindInt32, [42261, 0, 42261])), new CaseRange.ptr(670, 670, $toNativeArray($kindInt32, [42258, 0, 42258])), new CaseRange.ptr(837, 837, $toNativeArray($kindInt32, [84, 0, 84])), new CaseRange.ptr(880, 883, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(886, 887, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(891, 893, $toNativeArray($kindInt32, [130, 0, 130])), new CaseRange.ptr(895, 895, $toNativeArray($kindInt32, [0, 116, 0])), new CaseRange.ptr(902, 902, $toNativeArray($kindInt32, [0, 38, 0])), new CaseRange.ptr(904, 906, $toNativeArray($kindInt32, [0, 37, 0])), new CaseRange.ptr(908, 908, $toNativeArray($kindInt32, [0, 64, 0])), new CaseRange.ptr(910, 911, $toNativeArray($kindInt32, [0, 63, 0])), new CaseRange.ptr(913, 929, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(931, 939, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(940, 940, $toNativeArray($kindInt32, [-38, 0, -38])), new CaseRange.ptr(941, 943, $toNativeArray($kindInt32, [-37, 0, -37])), new CaseRange.ptr(945, 961, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(962, 962, $toNativeArray($kindInt32, [-31, 0, -31])), new CaseRange.ptr(963, 971, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(972, 972, $toNativeArray($kindInt32, [-64, 0, -64])), new CaseRange.ptr(973, 974, $toNativeArray($kindInt32, [-63, 0, -63])), new CaseRange.ptr(975, 975, $toNativeArray($kindInt32, [0, 8, 0])), new CaseRange.ptr(976, 976, $toNativeArray($kindInt32, [-62, 0, -62])), new CaseRange.ptr(977, 977, $toNativeArray($kindInt32, [-57, 0, -57])), new CaseRange.ptr(981, 981, $toNativeArray($kindInt32, [-47, 0, -47])), new CaseRange.ptr(982, 982, $toNativeArray($kindInt32, [-54, 0, -54])), new CaseRange.ptr(983, 983, $toNativeArray($kindInt32, [-8, 0, -8])), new CaseRange.ptr(984, 1007, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1008, 1008, $toNativeArray($kindInt32, [-86, 0, -86])), new CaseRange.ptr(1009, 1009, $toNativeArray($kindInt32, [-80, 0, -80])), new CaseRange.ptr(1010, 1010, $toNativeArray($kindInt32, [7, 0, 7])), new CaseRange.ptr(1011, 1011, $toNativeArray($kindInt32, [-116, 0, -116])), new CaseRange.ptr(1012, 1012, $toNativeArray($kindInt32, [0, -60, 0])), new CaseRange.ptr(1013, 1013, $toNativeArray($kindInt32, [-96, 0, -96])), new CaseRange.ptr(1015, 1016, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1017, 1017, $toNativeArray($kindInt32, [0, -7, 0])), new CaseRange.ptr(1018, 1019, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1021, 1023, $toNativeArray($kindInt32, [0, -130, 0])), new CaseRange.ptr(1024, 1039, $toNativeArray($kindInt32, [0, 80, 0])), new CaseRange.ptr(1040, 1071, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(1072, 1103, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(1104, 1119, $toNativeArray($kindInt32, [-80, 0, -80])), new CaseRange.ptr(1120, 1153, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1162, 1215, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1216, 1216, $toNativeArray($kindInt32, [0, 15, 0])), new CaseRange.ptr(1217, 1230, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1231, 1231, $toNativeArray($kindInt32, [-15, 0, -15])), new CaseRange.ptr(1232, 1327, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(1329, 1366, $toNativeArray($kindInt32, [0, 48, 0])), new CaseRange.ptr(1377, 1414, $toNativeArray($kindInt32, [-48, 0, -48])), new CaseRange.ptr(4256, 4293, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(4295, 4295, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(4301, 4301, $toNativeArray($kindInt32, [0, 7264, 0])), new CaseRange.ptr(5024, 5103, $toNativeArray($kindInt32, [0, 38864, 0])), new CaseRange.ptr(5104, 5109, $toNativeArray($kindInt32, [0, 8, 0])), new CaseRange.ptr(5112, 5117, $toNativeArray($kindInt32, [-8, 0, -8])), new CaseRange.ptr(7545, 7545, $toNativeArray($kindInt32, [35332, 0, 35332])), new CaseRange.ptr(7549, 7549, $toNativeArray($kindInt32, [3814, 0, 3814])), new CaseRange.ptr(7680, 7829, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(7835, 7835, $toNativeArray($kindInt32, [-59, 0, -59])), new CaseRange.ptr(7838, 7838, $toNativeArray($kindInt32, [0, -7615, 0])), new CaseRange.ptr(7840, 7935, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(7936, 7943, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7944, 7951, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7952, 7957, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7960, 7965, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7968, 7975, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7976, 7983, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(7984, 7991, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(7992, 7999, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8000, 8005, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8008, 8013, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8017, 8017, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8019, 8019, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8021, 8021, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8023, 8023, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8025, 8025, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8027, 8027, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8029, 8029, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8031, 8031, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8032, 8039, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8040, 8047, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8048, 8049, $toNativeArray($kindInt32, [74, 0, 74])), new CaseRange.ptr(8050, 8053, $toNativeArray($kindInt32, [86, 0, 86])), new CaseRange.ptr(8054, 8055, $toNativeArray($kindInt32, [100, 0, 100])), new CaseRange.ptr(8056, 8057, $toNativeArray($kindInt32, [128, 0, 128])), new CaseRange.ptr(8058, 8059, $toNativeArray($kindInt32, [112, 0, 112])), new CaseRange.ptr(8060, 8061, $toNativeArray($kindInt32, [126, 0, 126])), new CaseRange.ptr(8064, 8071, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8072, 8079, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8080, 8087, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8088, 8095, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8096, 8103, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8104, 8111, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8112, 8113, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8115, 8115, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8120, 8121, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8122, 8123, $toNativeArray($kindInt32, [0, -74, 0])), new CaseRange.ptr(8124, 8124, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8126, 8126, $toNativeArray($kindInt32, [-7205, 0, -7205])), new CaseRange.ptr(8131, 8131, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8136, 8139, $toNativeArray($kindInt32, [0, -86, 0])), new CaseRange.ptr(8140, 8140, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8144, 8145, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8152, 8153, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8154, 8155, $toNativeArray($kindInt32, [0, -100, 0])), new CaseRange.ptr(8160, 8161, $toNativeArray($kindInt32, [8, 0, 8])), new CaseRange.ptr(8165, 8165, $toNativeArray($kindInt32, [7, 0, 7])), new CaseRange.ptr(8168, 8169, $toNativeArray($kindInt32, [0, -8, 0])), new CaseRange.ptr(8170, 8171, $toNativeArray($kindInt32, [0, -112, 0])), new CaseRange.ptr(8172, 8172, $toNativeArray($kindInt32, [0, -7, 0])), new CaseRange.ptr(8179, 8179, $toNativeArray($kindInt32, [9, 0, 9])), new CaseRange.ptr(8184, 8185, $toNativeArray($kindInt32, [0, -128, 0])), new CaseRange.ptr(8186, 8187, $toNativeArray($kindInt32, [0, -126, 0])), new CaseRange.ptr(8188, 8188, $toNativeArray($kindInt32, [0, -9, 0])), new CaseRange.ptr(8486, 8486, $toNativeArray($kindInt32, [0, -7517, 0])), new CaseRange.ptr(8490, 8490, $toNativeArray($kindInt32, [0, -8383, 0])), new CaseRange.ptr(8491, 8491, $toNativeArray($kindInt32, [0, -8262, 0])), new CaseRange.ptr(8498, 8498, $toNativeArray($kindInt32, [0, 28, 0])), new CaseRange.ptr(8526, 8526, $toNativeArray($kindInt32, [-28, 0, -28])), new CaseRange.ptr(8544, 8559, $toNativeArray($kindInt32, [0, 16, 0])), new CaseRange.ptr(8560, 8575, $toNativeArray($kindInt32, [-16, 0, -16])), new CaseRange.ptr(8579, 8580, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(9398, 9423, $toNativeArray($kindInt32, [0, 26, 0])), new CaseRange.ptr(9424, 9449, $toNativeArray($kindInt32, [-26, 0, -26])), new CaseRange.ptr(11264, 11310, $toNativeArray($kindInt32, [0, 48, 0])), new CaseRange.ptr(11312, 11358, $toNativeArray($kindInt32, [-48, 0, -48])), new CaseRange.ptr(11360, 11361, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11362, 11362, $toNativeArray($kindInt32, [0, -10743, 0])), new CaseRange.ptr(11363, 11363, $toNativeArray($kindInt32, [0, -3814, 0])), new CaseRange.ptr(11364, 11364, $toNativeArray($kindInt32, [0, -10727, 0])), new CaseRange.ptr(11365, 11365, $toNativeArray($kindInt32, [-10795, 0, -10795])), new CaseRange.ptr(11366, 11366, $toNativeArray($kindInt32, [-10792, 0, -10792])), new CaseRange.ptr(11367, 11372, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11373, 11373, $toNativeArray($kindInt32, [0, -10780, 0])), new CaseRange.ptr(11374, 11374, $toNativeArray($kindInt32, [0, -10749, 0])), new CaseRange.ptr(11375, 11375, $toNativeArray($kindInt32, [0, -10783, 0])), new CaseRange.ptr(11376, 11376, $toNativeArray($kindInt32, [0, -10782, 0])), new CaseRange.ptr(11378, 11379, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11381, 11382, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11390, 11391, $toNativeArray($kindInt32, [0, -10815, 0])), new CaseRange.ptr(11392, 11491, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11499, 11502, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11506, 11507, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(11520, 11557, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(11559, 11559, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(11565, 11565, $toNativeArray($kindInt32, [-7264, 0, -7264])), new CaseRange.ptr(42560, 42605, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42624, 42651, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42786, 42799, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42802, 42863, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42873, 42876, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42877, 42877, $toNativeArray($kindInt32, [0, -35332, 0])), new CaseRange.ptr(42878, 42887, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42891, 42892, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42893, 42893, $toNativeArray($kindInt32, [0, -42280, 0])), new CaseRange.ptr(42896, 42899, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42902, 42921, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(42922, 42922, $toNativeArray($kindInt32, [0, -42308, 0])), new CaseRange.ptr(42923, 42923, $toNativeArray($kindInt32, [0, -42319, 0])), new CaseRange.ptr(42924, 42924, $toNativeArray($kindInt32, [0, -42315, 0])), new CaseRange.ptr(42925, 42925, $toNativeArray($kindInt32, [0, -42305, 0])), new CaseRange.ptr(42928, 42928, $toNativeArray($kindInt32, [0, -42258, 0])), new CaseRange.ptr(42929, 42929, $toNativeArray($kindInt32, [0, -42282, 0])), new CaseRange.ptr(42930, 42930, $toNativeArray($kindInt32, [0, -42261, 0])), new CaseRange.ptr(42931, 42931, $toNativeArray($kindInt32, [0, 928, 0])), new CaseRange.ptr(42932, 42935, $toNativeArray($kindInt32, [1114112, 1114112, 1114112])), new CaseRange.ptr(43859, 43859, $toNativeArray($kindInt32, [-928, 0, -928])), new CaseRange.ptr(43888, 43967, $toNativeArray($kindInt32, [-38864, 0, -38864])), new CaseRange.ptr(65313, 65338, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(65345, 65370, $toNativeArray($kindInt32, [-32, 0, -32])), new CaseRange.ptr(66560, 66599, $toNativeArray($kindInt32, [0, 40, 0])), new CaseRange.ptr(66600, 66639, $toNativeArray($kindInt32, [-40, 0, -40])), new CaseRange.ptr(68736, 68786, $toNativeArray($kindInt32, [0, 64, 0])), new CaseRange.ptr(68800, 68850, $toNativeArray($kindInt32, [-64, 0, -64])), new CaseRange.ptr(71840, 71871, $toNativeArray($kindInt32, [0, 32, 0])), new CaseRange.ptr(71872, 71903, $toNativeArray($kindInt32, [-32, 0, -32]))]); - $pkg.CaseRanges = _CaseRanges; - properties = $toNativeArray($kindUint8, [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, 144, 130, 130, 130, 136, 130, 130, 130, 130, 130, 130, 136, 130, 130, 130, 130, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 130, 130, 136, 136, 136, 130, 130, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 130, 130, 130, 136, 130, 136, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 130, 136, 130, 136, 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, 16, 130, 136, 136, 136, 136, 136, 130, 136, 136, 224, 130, 136, 0, 136, 136, 136, 136, 132, 132, 136, 192, 130, 130, 136, 132, 224, 130, 132, 132, 132, 130, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 136, 160, 160, 160, 160, 160, 160, 160, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 136, 192, 192, 192, 192, 192, 192, 192, 192]); - caseOrbit = new sliceType$4([new foldPair.ptr(75, 107), new foldPair.ptr(83, 115), new foldPair.ptr(107, 8490), new foldPair.ptr(115, 383), new foldPair.ptr(181, 924), new foldPair.ptr(197, 229), new foldPair.ptr(223, 7838), new foldPair.ptr(229, 8491), new foldPair.ptr(304, 304), new foldPair.ptr(305, 305), new foldPair.ptr(383, 83), new foldPair.ptr(452, 453), new foldPair.ptr(453, 454), new foldPair.ptr(454, 452), new foldPair.ptr(455, 456), new foldPair.ptr(456, 457), new foldPair.ptr(457, 455), new foldPair.ptr(458, 459), new foldPair.ptr(459, 460), new foldPair.ptr(460, 458), new foldPair.ptr(497, 498), new foldPair.ptr(498, 499), new foldPair.ptr(499, 497), new foldPair.ptr(837, 921), new foldPair.ptr(914, 946), new foldPair.ptr(917, 949), new foldPair.ptr(920, 952), new foldPair.ptr(921, 953), new foldPair.ptr(922, 954), new foldPair.ptr(924, 956), new foldPair.ptr(928, 960), new foldPair.ptr(929, 961), new foldPair.ptr(931, 962), new foldPair.ptr(934, 966), new foldPair.ptr(937, 969), new foldPair.ptr(946, 976), new foldPair.ptr(949, 1013), new foldPair.ptr(952, 977), new foldPair.ptr(953, 8126), new foldPair.ptr(954, 1008), new foldPair.ptr(956, 181), new foldPair.ptr(960, 982), new foldPair.ptr(961, 1009), new foldPair.ptr(962, 963), new foldPair.ptr(963, 931), new foldPair.ptr(966, 981), new foldPair.ptr(969, 8486), new foldPair.ptr(976, 914), new foldPair.ptr(977, 1012), new foldPair.ptr(981, 934), new foldPair.ptr(982, 928), new foldPair.ptr(1008, 922), new foldPair.ptr(1009, 929), new foldPair.ptr(1012, 920), new foldPair.ptr(1013, 917), new foldPair.ptr(7776, 7777), new foldPair.ptr(7777, 7835), new foldPair.ptr(7835, 7776), new foldPair.ptr(7838, 223), new foldPair.ptr(8126, 837), new foldPair.ptr(8486, 937), new foldPair.ptr(8490, 75), new foldPair.ptr(8491, 197)]); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["unicode/utf8"] = (function() { - var $pkg = {}, $init, acceptRange, first, acceptRanges, DecodeRune, DecodeRuneInString, DecodeLastRune, RuneLen, EncodeRune, RuneCount, RuneCountInString, RuneStart; - acceptRange = $pkg.acceptRange = $newType(0, $kindStruct, "utf8.acceptRange", "acceptRange", "unicode/utf8", function(lo_, hi_) { - this.$val = this; - if (arguments.length === 0) { - this.lo = 0; - this.hi = 0; - return; - } - this.lo = lo_; - this.hi = hi_; - }); - DecodeRune = function(p) { - var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, accept, b1, b2, b3, mask, n, p, p0, r, size, sz, x, x$1; - r = 0; - size = 0; - n = p.$length; - if (n < 1) { - _tmp = 65533; - _tmp$1 = 0; - r = _tmp; - size = _tmp$1; - return [r, size]; - } - p0 = (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0]); - x = ((p0 < 0 || p0 >= first.length) ? $throwRuntimeError("index out of range") : first[p0]); - if (x >= 240) { - mask = ((x >> 0) << 31 >> 0) >> 31 >> 0; - _tmp$2 = ((((0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0]) >> 0) & ~mask) >> 0) | (65533 & mask); - _tmp$3 = 1; - r = _tmp$2; - size = _tmp$3; - return [r, size]; - } - sz = (x & 7) >>> 0; - accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? $throwRuntimeError("index out of range") : acceptRanges[x$1])), acceptRange); - if (n < (sz >> 0)) { - _tmp$4 = 65533; - _tmp$5 = 1; - r = _tmp$4; - size = _tmp$5; - return [r, size]; - } - b1 = (1 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 1]); - if (b1 < accept.lo || accept.hi < b1) { - _tmp$6 = 65533; - _tmp$7 = 1; - r = _tmp$6; - size = _tmp$7; - return [r, size]; - } - if (sz === 2) { - _tmp$8 = ((((p0 & 31) >>> 0) >> 0) << 6 >> 0) | (((b1 & 63) >>> 0) >> 0); - _tmp$9 = 2; - r = _tmp$8; - size = _tmp$9; - return [r, size]; - } - b2 = (2 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 2]); - if (b2 < 128 || 191 < b2) { - _tmp$10 = 65533; - _tmp$11 = 1; - r = _tmp$10; - size = _tmp$11; - return [r, size]; - } - if (sz === 3) { - _tmp$12 = (((((p0 & 15) >>> 0) >> 0) << 12 >> 0) | ((((b1 & 63) >>> 0) >> 0) << 6 >> 0)) | (((b2 & 63) >>> 0) >> 0); - _tmp$13 = 3; - r = _tmp$12; - size = _tmp$13; - return [r, size]; - } - b3 = (3 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 3]); - if (b3 < 128 || 191 < b3) { - _tmp$14 = 65533; - _tmp$15 = 1; - r = _tmp$14; - size = _tmp$15; - return [r, size]; - } - _tmp$16 = ((((((p0 & 7) >>> 0) >> 0) << 18 >> 0) | ((((b1 & 63) >>> 0) >> 0) << 12 >> 0)) | ((((b2 & 63) >>> 0) >> 0) << 6 >> 0)) | (((b3 & 63) >>> 0) >> 0); - _tmp$17 = 4; - r = _tmp$16; - size = _tmp$17; - return [r, size]; - }; - $pkg.DecodeRune = DecodeRune; - DecodeRuneInString = function(s) { - var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, accept, mask, n, r, s, s0, s1, s2, s3, size, sz, x, x$1; - r = 0; - size = 0; - n = s.length; - if (n < 1) { - _tmp = 65533; - _tmp$1 = 0; - r = _tmp; - size = _tmp$1; - return [r, size]; - } - s0 = s.charCodeAt(0); - x = ((s0 < 0 || s0 >= first.length) ? $throwRuntimeError("index out of range") : first[s0]); - if (x >= 240) { - mask = ((x >> 0) << 31 >> 0) >> 31 >> 0; - _tmp$2 = (((s.charCodeAt(0) >> 0) & ~mask) >> 0) | (65533 & mask); - _tmp$3 = 1; - r = _tmp$2; - size = _tmp$3; - return [r, size]; - } - sz = (x & 7) >>> 0; - accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? $throwRuntimeError("index out of range") : acceptRanges[x$1])), acceptRange); - if (n < (sz >> 0)) { - _tmp$4 = 65533; - _tmp$5 = 1; - r = _tmp$4; - size = _tmp$5; - return [r, size]; - } - s1 = s.charCodeAt(1); - if (s1 < accept.lo || accept.hi < s1) { - _tmp$6 = 65533; - _tmp$7 = 1; - r = _tmp$6; - size = _tmp$7; - return [r, size]; - } - if (sz === 2) { - _tmp$8 = ((((s0 & 31) >>> 0) >> 0) << 6 >> 0) | (((s1 & 63) >>> 0) >> 0); - _tmp$9 = 2; - r = _tmp$8; - size = _tmp$9; - return [r, size]; - } - s2 = s.charCodeAt(2); - if (s2 < 128 || 191 < s2) { - _tmp$10 = 65533; - _tmp$11 = 1; - r = _tmp$10; - size = _tmp$11; - return [r, size]; - } - if (sz === 3) { - _tmp$12 = (((((s0 & 15) >>> 0) >> 0) << 12 >> 0) | ((((s1 & 63) >>> 0) >> 0) << 6 >> 0)) | (((s2 & 63) >>> 0) >> 0); - _tmp$13 = 3; - r = _tmp$12; - size = _tmp$13; - return [r, size]; - } - s3 = s.charCodeAt(3); - if (s3 < 128 || 191 < s3) { - _tmp$14 = 65533; - _tmp$15 = 1; - r = _tmp$14; - size = _tmp$15; - return [r, size]; - } - _tmp$16 = ((((((s0 & 7) >>> 0) >> 0) << 18 >> 0) | ((((s1 & 63) >>> 0) >> 0) << 12 >> 0)) | ((((s2 & 63) >>> 0) >> 0) << 6 >> 0)) | (((s3 & 63) >>> 0) >> 0); - _tmp$17 = 4; - r = _tmp$16; - size = _tmp$17; - return [r, size]; - }; - $pkg.DecodeRuneInString = DecodeRuneInString; - DecodeLastRune = function(p) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, end, lim, p, r, size, start; - r = 0; - size = 0; - end = p.$length; - if (end === 0) { - _tmp = 65533; - _tmp$1 = 0; - r = _tmp; - size = _tmp$1; - return [r, size]; - } - start = end - 1 >> 0; - r = (((start < 0 || start >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + start]) >> 0); - if (r < 128) { - _tmp$2 = r; - _tmp$3 = 1; - r = _tmp$2; - size = _tmp$3; - return [r, size]; - } - lim = end - 4 >> 0; - if (lim < 0) { - lim = 0; - } - start = start - (1) >> 0; - while (true) { - if (!(start >= lim)) { break; } - if (RuneStart(((start < 0 || start >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + start]))) { - break; - } - start = start - (1) >> 0; - } - if (start < 0) { - start = 0; - } - _tuple = DecodeRune($subslice(p, start, end)); - r = _tuple[0]; - size = _tuple[1]; - if (!(((start + size >> 0) === end))) { - _tmp$4 = 65533; - _tmp$5 = 1; - r = _tmp$4; - size = _tmp$5; - return [r, size]; - } - _tmp$6 = r; - _tmp$7 = size; - r = _tmp$6; - size = _tmp$7; - return [r, size]; - }; - $pkg.DecodeLastRune = DecodeLastRune; - RuneLen = function(r) { - var $ptr, r; - if (r < 0) { - return -1; - } else if (r <= 127) { - return 1; - } else if (r <= 2047) { - return 2; - } else if (55296 <= r && r <= 57343) { - return -1; - } else if (r <= 65535) { - return 3; - } else if (r <= 1114111) { - return 4; - } - return -1; - }; - $pkg.RuneLen = RuneLen; - EncodeRune = function(p, r) { - var $ptr, i, p, r; - i = (r >>> 0); - if (i <= 127) { - (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0] = (r << 24 >>> 24)); - return 1; - } else if (i <= 2047) { - (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0] = ((192 | ((r >> 6 >> 0) << 24 >>> 24)) >>> 0)); - (1 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 1] = ((128 | (((r << 24 >>> 24) & 63) >>> 0)) >>> 0)); - return 2; - } else if ((i > 1114111) || (55296 <= i && i <= 57343)) { - r = 65533; - (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0] = ((224 | ((r >> 12 >> 0) << 24 >>> 24)) >>> 0)); - (1 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 1] = ((128 | ((((r >> 6 >> 0) << 24 >>> 24) & 63) >>> 0)) >>> 0)); - (2 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 2] = ((128 | (((r << 24 >>> 24) & 63) >>> 0)) >>> 0)); - return 3; - } else if (i <= 65535) { - (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0] = ((224 | ((r >> 12 >> 0) << 24 >>> 24)) >>> 0)); - (1 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 1] = ((128 | ((((r >> 6 >> 0) << 24 >>> 24) & 63) >>> 0)) >>> 0)); - (2 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 2] = ((128 | (((r << 24 >>> 24) & 63) >>> 0)) >>> 0)); - return 3; - } else { - (0 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 0] = ((240 | ((r >> 18 >> 0) << 24 >>> 24)) >>> 0)); - (1 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 1] = ((128 | ((((r >> 12 >> 0) << 24 >>> 24) & 63) >>> 0)) >>> 0)); - (2 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 2] = ((128 | ((((r >> 6 >> 0) << 24 >>> 24) & 63) >>> 0)) >>> 0)); - (3 >= p.$length ? $throwRuntimeError("index out of range") : p.$array[p.$offset + 3] = ((128 | (((r << 24 >>> 24) & 63) >>> 0)) >>> 0)); - return 4; - } - }; - $pkg.EncodeRune = EncodeRune; - RuneCount = function(p) { - var $ptr, accept, c, c$1, c$2, c$3, i, n, np, p, size, x, x$1, x$2, x$3, x$4; - np = p.$length; - n = 0; - i = 0; - while (true) { - if (!(i < np)) { break; } - n = n + (1) >> 0; - c = ((i < 0 || i >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i]); - if (c < 128) { - i = i + (1) >> 0; - continue; - } - x = ((c < 0 || c >= first.length) ? $throwRuntimeError("index out of range") : first[c]); - if (x === 241) { - i = i + (1) >> 0; - continue; - } - size = (((x & 7) >>> 0) >> 0); - if ((i + size >> 0) > np) { - i = i + (1) >> 0; - continue; - } - accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? $throwRuntimeError("index out of range") : acceptRanges[x$1])), acceptRange); - c$1 = (x$2 = i + 1 >> 0, ((x$2 < 0 || x$2 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x$2])); - if (c$1 < accept.lo || accept.hi < c$1) { - size = 1; - } else if (size === 2) { - } else { - c$2 = (x$3 = i + 2 >> 0, ((x$3 < 0 || x$3 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x$3])); - if (c$2 < 128 || 191 < c$2) { - size = 1; - } else if (size === 3) { - } else { - c$3 = (x$4 = i + 3 >> 0, ((x$4 < 0 || x$4 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x$4])); - if (c$3 < 128 || 191 < c$3) { - size = 1; - } - } - } - i = i + (size) >> 0; - } - return n; - }; - $pkg.RuneCount = RuneCount; - RuneCountInString = function(s) { - var $ptr, accept, c, c$1, c$2, c$3, i, n, ns, s, size, x, x$1; - n = 0; - ns = s.length; - i = 0; - while (true) { - if (!(i < ns)) { break; } - c = s.charCodeAt(i); - if (c < 128) { - i = i + (1) >> 0; - n = n + (1) >> 0; - continue; - } - x = ((c < 0 || c >= first.length) ? $throwRuntimeError("index out of range") : first[c]); - if (x === 241) { - i = i + (1) >> 0; - n = n + (1) >> 0; - continue; - } - size = (((x & 7) >>> 0) >> 0); - if ((i + size >> 0) > ns) { - i = i + (1) >> 0; - n = n + (1) >> 0; - continue; - } - accept = $clone((x$1 = x >>> 4 << 24 >>> 24, ((x$1 < 0 || x$1 >= acceptRanges.length) ? $throwRuntimeError("index out of range") : acceptRanges[x$1])), acceptRange); - c$1 = s.charCodeAt((i + 1 >> 0)); - if (c$1 < accept.lo || accept.hi < c$1) { - size = 1; - } else if (size === 2) { - } else { - c$2 = s.charCodeAt((i + 2 >> 0)); - if (c$2 < 128 || 191 < c$2) { - size = 1; - } else if (size === 3) { - } else { - c$3 = s.charCodeAt((i + 3 >> 0)); - if (c$3 < 128 || 191 < c$3) { - size = 1; - } - } - } - i = i + (size) >> 0; - n = n + (1) >> 0; - } - n = n; - return n; - }; - $pkg.RuneCountInString = RuneCountInString; - RuneStart = function(b) { - var $ptr, b; - return !((((b & 192) >>> 0) === 128)); - }; - $pkg.RuneStart = RuneStart; - acceptRange.init([{prop: "lo", name: "lo", pkg: "unicode/utf8", typ: $Uint8, tag: ""}, {prop: "hi", name: "hi", pkg: "unicode/utf8", typ: $Uint8, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - first = $toNativeArray($kindUint8, [240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 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, 19, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 35, 3, 3, 52, 4, 4, 4, 68, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241]); - acceptRanges = $toNativeArray($kindStruct, [new acceptRange.ptr(128, 191), new acceptRange.ptr(160, 191), new acceptRange.ptr(128, 159), new acceptRange.ptr(144, 191), new acceptRange.ptr(128, 143)]); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["bytes"] = (function() { - var $pkg = {}, $init, errors, io, unicode, utf8, Buffer, readOp, ptrType, sliceType, arrayType, arrayType$1, IndexByte, makeSlice, EqualFold; - errors = $packages["errors"]; - io = $packages["io"]; - unicode = $packages["unicode"]; - utf8 = $packages["unicode/utf8"]; - Buffer = $pkg.Buffer = $newType(0, $kindStruct, "bytes.Buffer", "Buffer", "bytes", function(buf_, off_, runeBytes_, bootstrap_, lastRead_) { - this.$val = this; - if (arguments.length === 0) { - this.buf = sliceType.nil; - this.off = 0; - this.runeBytes = arrayType.zero(); - this.bootstrap = arrayType$1.zero(); - this.lastRead = 0; - return; - } - this.buf = buf_; - this.off = off_; - this.runeBytes = runeBytes_; - this.bootstrap = bootstrap_; - this.lastRead = lastRead_; - }); - readOp = $pkg.readOp = $newType(4, $kindInt, "bytes.readOp", "readOp", "bytes", null); - ptrType = $ptrType(Buffer); - sliceType = $sliceType($Uint8); - arrayType = $arrayType($Uint8, 4); - arrayType$1 = $arrayType($Uint8, 64); - IndexByte = function(s, c) { - var $ptr, _i, _ref, b, c, i, s; - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - b = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (b === c) { - return i; - } - _i++; - } - return -1; - }; - $pkg.IndexByte = IndexByte; - Buffer.ptr.prototype.Bytes = function() { - var $ptr, b; - b = this; - return $subslice(b.buf, b.off); - }; - Buffer.prototype.Bytes = function() { return this.$val.Bytes(); }; - Buffer.ptr.prototype.String = function() { - var $ptr, b; - b = this; - if (b === ptrType.nil) { - return ""; - } - return $bytesToString($subslice(b.buf, b.off)); - }; - Buffer.prototype.String = function() { return this.$val.String(); }; - Buffer.ptr.prototype.Len = function() { - var $ptr, b; - b = this; - return b.buf.$length - b.off >> 0; - }; - Buffer.prototype.Len = function() { return this.$val.Len(); }; - Buffer.ptr.prototype.Cap = function() { - var $ptr, b; - b = this; - return b.buf.$capacity; - }; - Buffer.prototype.Cap = function() { return this.$val.Cap(); }; - Buffer.ptr.prototype.Truncate = function(n) { - var $ptr, b, n; - b = this; - b.lastRead = 0; - if (n < 0 || n > b.Len()) { - $panic(new $String("bytes.Buffer: truncation out of range")); - } else if ((n === 0)) { - b.off = 0; - } - b.buf = $subslice(b.buf, 0, (b.off + n >> 0)); - }; - Buffer.prototype.Truncate = function(n) { return this.$val.Truncate(n); }; - Buffer.ptr.prototype.Reset = function() { - var $ptr, b; - b = this; - b.Truncate(0); - }; - Buffer.prototype.Reset = function() { return this.$val.Reset(); }; - Buffer.ptr.prototype.grow = function(n) { - var $ptr, _q, b, buf, m, n; - b = this; - m = b.Len(); - if ((m === 0) && !((b.off === 0))) { - b.Truncate(0); - } - if ((b.buf.$length + n >> 0) > b.buf.$capacity) { - buf = sliceType.nil; - if (b.buf === sliceType.nil && n <= 64) { - buf = $subslice(new sliceType(b.bootstrap), 0); - } else if ((m + n >> 0) <= (_q = b.buf.$capacity / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))) { - $copySlice(b.buf, $subslice(b.buf, b.off)); - buf = $subslice(b.buf, 0, m); - } else { - buf = makeSlice(($imul(2, b.buf.$capacity)) + n >> 0); - $copySlice(buf, $subslice(b.buf, b.off)); - } - b.buf = buf; - b.off = 0; - } - b.buf = $subslice(b.buf, 0, ((b.off + m >> 0) + n >> 0)); - return b.off + m >> 0; - }; - Buffer.prototype.grow = function(n) { return this.$val.grow(n); }; - Buffer.ptr.prototype.Grow = function(n) { - var $ptr, b, m, n; - b = this; - if (n < 0) { - $panic(new $String("bytes.Buffer.Grow: negative count")); - } - m = b.grow(n); - b.buf = $subslice(b.buf, 0, m); - }; - Buffer.prototype.Grow = function(n) { return this.$val.Grow(n); }; - Buffer.ptr.prototype.Write = function(p) { - var $ptr, _tmp, _tmp$1, b, err, m, n, p; - n = 0; - err = $ifaceNil; - b = this; - b.lastRead = 0; - m = b.grow(p.$length); - _tmp = $copySlice($subslice(b.buf, m), p); - _tmp$1 = $ifaceNil; - n = _tmp; - err = _tmp$1; - return [n, err]; - }; - Buffer.prototype.Write = function(p) { return this.$val.Write(p); }; - Buffer.ptr.prototype.WriteString = function(s) { - var $ptr, _tmp, _tmp$1, b, err, m, n, s; - n = 0; - err = $ifaceNil; - b = this; - b.lastRead = 0; - m = b.grow(s.length); - _tmp = $copyString($subslice(b.buf, m), s); - _tmp$1 = $ifaceNil; - n = _tmp; - err = _tmp$1; - return [n, err]; - }; - Buffer.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; - Buffer.ptr.prototype.ReadFrom = function(r) { - var $ptr, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, free, m, n, newBuf, r, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; free = $f.free; m = $f.m; n = $f.n; newBuf = $f.newBuf; r = $f.r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = new $Int64(0, 0); - err = $ifaceNil; - b = this; - b.lastRead = 0; - if (b.off >= b.buf.$length) { - b.Truncate(0); - } - /* while (true) { */ case 1: - free = b.buf.$capacity - b.buf.$length >> 0; - if (free < 512) { - newBuf = b.buf; - if ((b.off + free >> 0) < 512) { - newBuf = makeSlice(($imul(2, b.buf.$capacity)) + 512 >> 0); - } - $copySlice(newBuf, $subslice(b.buf, b.off)); - b.buf = $subslice(newBuf, 0, (b.buf.$length - b.off >> 0)); - b.off = 0; - } - _r = r.Read($subslice(b.buf, b.buf.$length, b.buf.$capacity)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - m = _tuple[0]; - e = _tuple[1]; - b.buf = $subslice(b.buf, 0, (b.buf.$length + m >> 0)); - n = (x = new $Int64(0, m), new $Int64(n.$high + x.$high, n.$low + x.$low)); - if ($interfaceIsEqual(e, io.EOF)) { - /* break; */ $s = 2; continue; - } - if (!($interfaceIsEqual(e, $ifaceNil))) { - _tmp = n; - _tmp$1 = e; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - /* } */ $s = 1; continue; case 2: - _tmp$2 = n; - _tmp$3 = $ifaceNil; - n = _tmp$2; - err = _tmp$3; - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.ReadFrom }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.free = free; $f.m = m; $f.n = n; $f.newBuf = newBuf; $f.r = r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Buffer.prototype.ReadFrom = function(r) { return this.$val.ReadFrom(r); }; - makeSlice = function(n) { - var $ptr, n, $deferred; - /* */ var $err = null; try { $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - $deferred.push([(function() { - var $ptr; - if (!($interfaceIsEqual($recover(), $ifaceNil))) { - $panic($pkg.ErrTooLarge); - } - }), []]); - return $makeSlice(sliceType, n); - /* */ } catch(err) { $err = err; return sliceType.nil; } finally { $callDeferred($deferred, $err); } - }; - Buffer.ptr.prototype.WriteTo = function(w) { - var $ptr, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, m, n, nBytes, w, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; n = $f.n; nBytes = $f.nBytes; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = new $Int64(0, 0); - err = $ifaceNil; - b = this; - b.lastRead = 0; - /* */ if (b.off < b.buf.$length) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (b.off < b.buf.$length) { */ case 1: - nBytes = b.Len(); - _r = w.Write($subslice(b.buf, b.off)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - m = _tuple[0]; - e = _tuple[1]; - if (m > nBytes) { - $panic(new $String("bytes.Buffer.WriteTo: invalid Write count")); - } - b.off = b.off + (m) >> 0; - n = new $Int64(0, m); - if (!($interfaceIsEqual(e, $ifaceNil))) { - _tmp = n; - _tmp$1 = e; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - if (!((m === nBytes))) { - _tmp$2 = n; - _tmp$3 = io.ErrShortWrite; - n = _tmp$2; - err = _tmp$3; - return [n, err]; - } - /* } */ case 2: - b.Truncate(0); - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Buffer.ptr.prototype.WriteTo }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.n = n; $f.nBytes = nBytes; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; - }; - Buffer.prototype.WriteTo = function(w) { return this.$val.WriteTo(w); }; - Buffer.ptr.prototype.WriteByte = function(c) { - var $ptr, b, c, m, x; - b = this; - b.lastRead = 0; - m = b.grow(1); - (x = b.buf, ((m < 0 || m >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + m] = c)); - return $ifaceNil; - }; - Buffer.prototype.WriteByte = function(c) { return this.$val.WriteByte(c); }; - Buffer.ptr.prototype.WriteRune = function(r) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, b, err, n, r; - n = 0; - err = $ifaceNil; - b = this; - if (r < 128) { - b.WriteByte((r << 24 >>> 24)); - _tmp = 1; - _tmp$1 = $ifaceNil; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - n = utf8.EncodeRune($subslice(new sliceType(b.runeBytes), 0), r); - b.Write($subslice(new sliceType(b.runeBytes), 0, n)); - _tmp$2 = n; - _tmp$3 = $ifaceNil; - n = _tmp$2; - err = _tmp$3; - return [n, err]; - }; - Buffer.prototype.WriteRune = function(r) { return this.$val.WriteRune(r); }; - Buffer.ptr.prototype.Read = function(p) { - var $ptr, _tmp, _tmp$1, b, err, n, p; - n = 0; - err = $ifaceNil; - b = this; - b.lastRead = 0; - if (b.off >= b.buf.$length) { - b.Truncate(0); - if (p.$length === 0) { - return [n, err]; - } - _tmp = 0; - _tmp$1 = io.EOF; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - n = $copySlice(p, $subslice(b.buf, b.off)); - b.off = b.off + (n) >> 0; - if (n > 0) { - b.lastRead = 2; - } - return [n, err]; - }; - Buffer.prototype.Read = function(p) { return this.$val.Read(p); }; - Buffer.ptr.prototype.Next = function(n) { - var $ptr, b, data, m, n; - b = this; - b.lastRead = 0; - m = b.Len(); - if (n > m) { - n = m; - } - data = $subslice(b.buf, b.off, (b.off + n >> 0)); - b.off = b.off + (n) >> 0; - if (n > 0) { - b.lastRead = 2; - } - return data; - }; - Buffer.prototype.Next = function(n) { return this.$val.Next(n); }; - Buffer.ptr.prototype.ReadByte = function() { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, b, c, err, x, x$1; - c = 0; - err = $ifaceNil; - b = this; - b.lastRead = 0; - if (b.off >= b.buf.$length) { - b.Truncate(0); - _tmp = 0; - _tmp$1 = io.EOF; - c = _tmp; - err = _tmp$1; - return [c, err]; - } - c = (x = b.buf, x$1 = b.off, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); - b.off = b.off + (1) >> 0; - b.lastRead = 2; - _tmp$2 = c; - _tmp$3 = $ifaceNil; - c = _tmp$2; - err = _tmp$3; - return [c, err]; - }; - Buffer.prototype.ReadByte = function() { return this.$val.ReadByte(); }; - Buffer.ptr.prototype.ReadRune = function() { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tuple, b, c, err, n, r, size, x, x$1; - r = 0; - size = 0; - err = $ifaceNil; - b = this; - b.lastRead = 0; - if (b.off >= b.buf.$length) { - b.Truncate(0); - _tmp = 0; - _tmp$1 = 0; - _tmp$2 = io.EOF; - r = _tmp; - size = _tmp$1; - err = _tmp$2; - return [r, size, err]; - } - b.lastRead = 1; - c = (x = b.buf, x$1 = b.off, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); - if (c < 128) { - b.off = b.off + (1) >> 0; - _tmp$3 = (c >> 0); - _tmp$4 = 1; - _tmp$5 = $ifaceNil; - r = _tmp$3; - size = _tmp$4; - err = _tmp$5; - return [r, size, err]; - } - _tuple = utf8.DecodeRune($subslice(b.buf, b.off)); - r = _tuple[0]; - n = _tuple[1]; - b.off = b.off + (n) >> 0; - _tmp$6 = r; - _tmp$7 = n; - _tmp$8 = $ifaceNil; - r = _tmp$6; - size = _tmp$7; - err = _tmp$8; - return [r, size, err]; - }; - Buffer.prototype.ReadRune = function() { return this.$val.ReadRune(); }; - Buffer.ptr.prototype.UnreadRune = function() { - var $ptr, _tuple, b, n; - b = this; - if (!((b.lastRead === 1))) { - return errors.New("bytes.Buffer: UnreadRune: previous operation was not ReadRune"); - } - b.lastRead = 0; - if (b.off > 0) { - _tuple = utf8.DecodeLastRune($subslice(b.buf, 0, b.off)); - n = _tuple[1]; - b.off = b.off - (n) >> 0; - } - return $ifaceNil; - }; - Buffer.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; - Buffer.ptr.prototype.UnreadByte = function() { - var $ptr, b; - b = this; - if (!((b.lastRead === 1)) && !((b.lastRead === 2))) { - return errors.New("bytes.Buffer: UnreadByte: previous operation was not a read"); - } - b.lastRead = 0; - if (b.off > 0) { - b.off = b.off - (1) >> 0; - } - return $ifaceNil; - }; - Buffer.prototype.UnreadByte = function() { return this.$val.UnreadByte(); }; - Buffer.ptr.prototype.ReadBytes = function(delim) { - var $ptr, _tuple, b, delim, err, line, slice; - line = sliceType.nil; - err = $ifaceNil; - b = this; - _tuple = b.readSlice(delim); - slice = _tuple[0]; - err = _tuple[1]; - line = $appendSlice(line, slice); - return [line, err]; - }; - Buffer.prototype.ReadBytes = function(delim) { return this.$val.ReadBytes(delim); }; - Buffer.ptr.prototype.readSlice = function(delim) { - var $ptr, _tmp, _tmp$1, b, delim, end, err, i, line; - line = sliceType.nil; - err = $ifaceNil; - b = this; - i = IndexByte($subslice(b.buf, b.off), delim); - end = (b.off + i >> 0) + 1 >> 0; - if (i < 0) { - end = b.buf.$length; - err = io.EOF; - } - line = $subslice(b.buf, b.off, end); - b.off = end; - b.lastRead = 2; - _tmp = line; - _tmp$1 = err; - line = _tmp; - err = _tmp$1; - return [line, err]; - }; - Buffer.prototype.readSlice = function(delim) { return this.$val.readSlice(delim); }; - Buffer.ptr.prototype.ReadString = function(delim) { - var $ptr, _tmp, _tmp$1, _tuple, b, delim, err, line, slice; - line = ""; - err = $ifaceNil; - b = this; - _tuple = b.readSlice(delim); - slice = _tuple[0]; - err = _tuple[1]; - _tmp = $bytesToString(slice); - _tmp$1 = err; - line = _tmp; - err = _tmp$1; - return [line, err]; - }; - Buffer.prototype.ReadString = function(delim) { return this.$val.ReadString(delim); }; - EqualFold = function(s, t) { - var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, r, r$1, r$2, s, size, size$1, sr, t, tr; - while (true) { - if (!(!((s.$length === 0)) && !((t.$length === 0)))) { break; } - _tmp = 0; - _tmp$1 = 0; - sr = _tmp; - tr = _tmp$1; - if ((0 >= s.$length ? $throwRuntimeError("index out of range") : s.$array[s.$offset + 0]) < 128) { - _tmp$2 = ((0 >= s.$length ? $throwRuntimeError("index out of range") : s.$array[s.$offset + 0]) >> 0); - _tmp$3 = $subslice(s, 1); - sr = _tmp$2; - s = _tmp$3; - } else { - _tuple = utf8.DecodeRune(s); - r = _tuple[0]; - size = _tuple[1]; - _tmp$4 = r; - _tmp$5 = $subslice(s, size); - sr = _tmp$4; - s = _tmp$5; - } - if ((0 >= t.$length ? $throwRuntimeError("index out of range") : t.$array[t.$offset + 0]) < 128) { - _tmp$6 = ((0 >= t.$length ? $throwRuntimeError("index out of range") : t.$array[t.$offset + 0]) >> 0); - _tmp$7 = $subslice(t, 1); - tr = _tmp$6; - t = _tmp$7; - } else { - _tuple$1 = utf8.DecodeRune(t); - r$1 = _tuple$1[0]; - size$1 = _tuple$1[1]; - _tmp$8 = r$1; - _tmp$9 = $subslice(t, size$1); - tr = _tmp$8; - t = _tmp$9; - } - if (tr === sr) { - continue; - } - if (tr < sr) { - _tmp$10 = sr; - _tmp$11 = tr; - tr = _tmp$10; - sr = _tmp$11; - } - if (tr < 128 && 65 <= sr && sr <= 90) { - if (tr === ((sr + 97 >> 0) - 65 >> 0)) { - continue; - } - return false; - } - r$2 = unicode.SimpleFold(sr); - while (true) { - if (!(!((r$2 === sr)) && r$2 < tr)) { break; } - r$2 = unicode.SimpleFold(r$2); - } - if (r$2 === tr) { - continue; - } - return false; - } - return s.$length === t.$length; - }; - $pkg.EqualFold = EqualFold; - ptrType.methods = [{prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "grow", name: "grow", pkg: "bytes", typ: $funcType([$Int], [$Int], false)}, {prop: "Grow", name: "Grow", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "ReadFrom", name: "ReadFrom", pkg: "", typ: $funcType([io.Reader], [$Int64, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([io.Writer], [$Int64, $error], false)}, {prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [$error], false)}, {prop: "WriteRune", name: "WriteRune", pkg: "", typ: $funcType([$Int32], [$Int, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "Next", name: "Next", pkg: "", typ: $funcType([$Int], [sliceType], false)}, {prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}, {prop: "ReadBytes", name: "ReadBytes", pkg: "", typ: $funcType([$Uint8], [sliceType, $error], false)}, {prop: "readSlice", name: "readSlice", pkg: "bytes", typ: $funcType([$Uint8], [sliceType, $error], false)}, {prop: "ReadString", name: "ReadString", pkg: "", typ: $funcType([$Uint8], [$String, $error], false)}]; - Buffer.init([{prop: "buf", name: "buf", pkg: "bytes", typ: sliceType, tag: ""}, {prop: "off", name: "off", pkg: "bytes", typ: $Int, tag: ""}, {prop: "runeBytes", name: "runeBytes", pkg: "bytes", typ: arrayType, tag: ""}, {prop: "bootstrap", name: "bootstrap", pkg: "bytes", typ: arrayType$1, tag: ""}, {prop: "lastRead", name: "lastRead", pkg: "bytes", typ: readOp, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = unicode.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = utf8.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $pkg.ErrTooLarge = errors.New("bytes.Buffer: too large"); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["math"] = (function() { - var $pkg = {}, $init, js, arrayType, arrayType$1, arrayType$2, structType, arrayType$3, math, zero, posInf, negInf, nan, buf, pow10tab, Exp, Frexp, Inf, IsInf, IsNaN, Log, Log2, NaN, init, Float32bits, Float32frombits, Float64bits, Float64frombits, Abs, normalize, frexp, log2, init$1; - js = $packages["github.com/gopherjs/gopherjs/js"]; - arrayType = $arrayType($Uint32, 2); - arrayType$1 = $arrayType($Float32, 2); - arrayType$2 = $arrayType($Float64, 1); - structType = $structType([{prop: "uint32array", name: "uint32array", pkg: "math", typ: arrayType, tag: ""}, {prop: "float32array", name: "float32array", pkg: "math", typ: arrayType$1, tag: ""}, {prop: "float64array", name: "float64array", pkg: "math", typ: arrayType$2, tag: ""}]); - arrayType$3 = $arrayType($Float64, 70); - Exp = function(x) { - var $ptr, x; - return $parseFloat(math.exp(x)); - }; - $pkg.Exp = Exp; - Frexp = function(f) { - var $ptr, _tuple, exp$1, f, frac; - frac = 0; - exp$1 = 0; - _tuple = frexp(f); - frac = _tuple[0]; - exp$1 = _tuple[1]; - return [frac, exp$1]; - }; - $pkg.Frexp = Frexp; - Inf = function(sign) { - var $ptr, sign; - if (sign >= 0) { - return posInf; - } else { - return negInf; - } - }; - $pkg.Inf = Inf; - IsInf = function(f, sign) { - var $ptr, f, sign; - if (f === posInf) { - return sign >= 0; - } - if (f === negInf) { - return sign <= 0; - } - return false; - }; - $pkg.IsInf = IsInf; - IsNaN = function(f) { - var $ptr, f, is; - is = false; - is = !((f === f)); - return is; - }; - $pkg.IsNaN = IsNaN; - Log = function(x) { - var $ptr, x; - if (!((x === x))) { - return nan; - } - return $parseFloat(math.log(x)); - }; - $pkg.Log = Log; - Log2 = function(x) { - var $ptr, x; - return log2(x); - }; - $pkg.Log2 = Log2; - NaN = function() { - var $ptr; - return nan; - }; - $pkg.NaN = NaN; - init = function() { - var $ptr, ab; - ab = new ($global.ArrayBuffer)(8); - buf.uint32array = new ($global.Uint32Array)(ab); - buf.float32array = new ($global.Float32Array)(ab); - buf.float64array = new ($global.Float64Array)(ab); - }; - Float32bits = function(f) { - var $ptr, f; - buf.float32array[0] = f; - return buf.uint32array[0]; - }; - $pkg.Float32bits = Float32bits; - Float32frombits = function(b) { - var $ptr, b; - buf.uint32array[0] = b; - return buf.float32array[0]; - }; - $pkg.Float32frombits = Float32frombits; - Float64bits = function(f) { - var $ptr, f, x, x$1; - buf.float64array[0] = f; - return (x = $shiftLeft64(new $Uint64(0, buf.uint32array[1]), 32), x$1 = new $Uint64(0, buf.uint32array[0]), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); - }; - $pkg.Float64bits = Float64bits; - Float64frombits = function(b) { - var $ptr, b; - buf.uint32array[0] = (b.$low >>> 0); - buf.uint32array[1] = ($shiftRightUint64(b, 32).$low >>> 0); - return buf.float64array[0]; - }; - $pkg.Float64frombits = Float64frombits; - Abs = function(x) { - var $ptr, x; - if (x < 0) { - return -x; - } - if (x === 0) { - return 0; - } - return x; - }; - $pkg.Abs = Abs; - normalize = function(x) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, exp$1, x, y; - y = 0; - exp$1 = 0; - if (Abs(x) < 2.2250738585072014e-308) { - _tmp = x * 4.503599627370496e+15; - _tmp$1 = -52; - y = _tmp; - exp$1 = _tmp$1; - return [y, exp$1]; - } - _tmp$2 = x; - _tmp$3 = 0; - y = _tmp$2; - exp$1 = _tmp$3; - return [y, exp$1]; - }; - frexp = function(f) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, exp$1, f, frac, x, x$1, x$2, x$3; - frac = 0; - exp$1 = 0; - if ((f === 0)) { - _tmp = f; - _tmp$1 = 0; - frac = _tmp; - exp$1 = _tmp$1; - return [frac, exp$1]; - } else if (IsInf(f, 0) || IsNaN(f)) { - _tmp$2 = f; - _tmp$3 = 0; - frac = _tmp$2; - exp$1 = _tmp$3; - return [frac, exp$1]; - } - _tuple = normalize(f); - f = _tuple[0]; - exp$1 = _tuple[1]; - x = Float64bits(f); - exp$1 = exp$1 + (((((x$1 = $shiftRightUint64(x, 52), new $Uint64(x$1.$high & 0, (x$1.$low & 2047) >>> 0)).$low >> 0) - 1023 >> 0) + 1 >> 0)) >> 0; - x = (x$2 = new $Uint64(2146435072, 0), new $Uint64(x.$high & ~x$2.$high, (x.$low & ~x$2.$low) >>> 0)); - x = (x$3 = new $Uint64(1071644672, 0), new $Uint64(x.$high | x$3.$high, (x.$low | x$3.$low) >>> 0)); - frac = Float64frombits(x); - return [frac, exp$1]; - }; - log2 = function(x) { - var $ptr, _tuple, exp$1, frac, x; - _tuple = Frexp(x); - frac = _tuple[0]; - exp$1 = _tuple[1]; - if (frac === 0.5) { - return (exp$1 - 1 >> 0); - } - return Log(frac) * 1.4426950408889634 + exp$1; - }; - init$1 = function() { - var $ptr, _q, i, m, x; - pow10tab[0] = 1; - pow10tab[1] = 10; - i = 2; - while (true) { - if (!(i < 70)) { break; } - m = (_q = i / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - ((i < 0 || i >= pow10tab.length) ? $throwRuntimeError("index out of range") : pow10tab[i] = ((m < 0 || m >= pow10tab.length) ? $throwRuntimeError("index out of range") : pow10tab[m]) * (x = i - m >> 0, ((x < 0 || x >= pow10tab.length) ? $throwRuntimeError("index out of range") : pow10tab[x]))); - i = i + (1) >> 0; - } - }; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - buf = new structType.ptr(arrayType.zero(), arrayType$1.zero(), arrayType$2.zero()); - pow10tab = arrayType$3.zero(); - math = $global.Math; - zero = 0; - posInf = 1 / zero; - negInf = -1 / zero; - nan = 0 / zero; - init(); - init$1(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["strconv"] = (function() { - var $pkg = {}, $init, errors, math, utf8, NumError, decimal, leftCheat, extFloat, floatInfo, decimalSlice, sliceType, sliceType$1, sliceType$2, sliceType$3, sliceType$4, sliceType$5, arrayType, ptrType, sliceType$6, arrayType$1, arrayType$2, ptrType$1, arrayType$3, arrayType$4, ptrType$2, ptrType$3, ptrType$4, optimize, powtab, float64pow10, float32pow10, leftcheats, smallPowersOfTen, powersOfTen, uint64pow10, float32info, float32info$24ptr, float64info, float64info$24ptr, isPrint16, isNotPrint16, isPrint32, isNotPrint32, isGraphic, shifts, ParseBool, equalIgnoreCase, special, readFloat, atof64exact, atof32exact, atof32, atof64, ParseFloat, syntaxError, rangeError, ParseUint, ParseInt, digitZero, trim, rightShift, prefixIsLessThan, leftShift, shouldRoundUp, frexp10Many, adjustLastDigitFixed, adjustLastDigit, FormatFloat, AppendFloat, genericFtoa, bigFtoa, formatDigits, roundShortest, fmtE, fmtF, fmtB, min, max, FormatInt, Itoa, AppendInt, AppendUint, formatBits, quoteWith, Quote, QuoteToASCII, QuoteRune, AppendQuoteRune, QuoteRuneToASCII, AppendQuoteRuneToASCII, CanBackquote, unhex, UnquoteChar, Unquote, contains, bsearch16, bsearch32, IsPrint, isInGraphicList; - errors = $packages["errors"]; - math = $packages["math"]; - utf8 = $packages["unicode/utf8"]; - NumError = $pkg.NumError = $newType(0, $kindStruct, "strconv.NumError", "NumError", "strconv", function(Func_, Num_, Err_) { - this.$val = this; - if (arguments.length === 0) { - this.Func = ""; - this.Num = ""; - this.Err = $ifaceNil; - return; - } - this.Func = Func_; - this.Num = Num_; - this.Err = Err_; - }); - decimal = $pkg.decimal = $newType(0, $kindStruct, "strconv.decimal", "decimal", "strconv", function(d_, nd_, dp_, neg_, trunc_) { - this.$val = this; - if (arguments.length === 0) { - this.d = arrayType.zero(); - this.nd = 0; - this.dp = 0; - this.neg = false; - this.trunc = false; - return; - } - this.d = d_; - this.nd = nd_; - this.dp = dp_; - this.neg = neg_; - this.trunc = trunc_; - }); - leftCheat = $pkg.leftCheat = $newType(0, $kindStruct, "strconv.leftCheat", "leftCheat", "strconv", function(delta_, cutoff_) { - this.$val = this; - if (arguments.length === 0) { - this.delta = 0; - this.cutoff = ""; - return; - } - this.delta = delta_; - this.cutoff = cutoff_; - }); - extFloat = $pkg.extFloat = $newType(0, $kindStruct, "strconv.extFloat", "extFloat", "strconv", function(mant_, exp_, neg_) { - this.$val = this; - if (arguments.length === 0) { - this.mant = new $Uint64(0, 0); - this.exp = 0; - this.neg = false; - return; - } - this.mant = mant_; - this.exp = exp_; - this.neg = neg_; - }); - floatInfo = $pkg.floatInfo = $newType(0, $kindStruct, "strconv.floatInfo", "floatInfo", "strconv", function(mantbits_, expbits_, bias_) { - this.$val = this; - if (arguments.length === 0) { - this.mantbits = 0; - this.expbits = 0; - this.bias = 0; - return; - } - this.mantbits = mantbits_; - this.expbits = expbits_; - this.bias = bias_; - }); - decimalSlice = $pkg.decimalSlice = $newType(0, $kindStruct, "strconv.decimalSlice", "decimalSlice", "strconv", function(d_, nd_, dp_, neg_) { - this.$val = this; - if (arguments.length === 0) { - this.d = sliceType$6.nil; - this.nd = 0; - this.dp = 0; - this.neg = false; - return; - } - this.d = d_; - this.nd = nd_; - this.dp = dp_; - this.neg = neg_; - }); - sliceType = $sliceType($Int); - sliceType$1 = $sliceType($Float64); - sliceType$2 = $sliceType($Float32); - sliceType$3 = $sliceType(leftCheat); - sliceType$4 = $sliceType($Uint16); - sliceType$5 = $sliceType($Uint32); - arrayType = $arrayType($Uint8, 800); - ptrType = $ptrType(NumError); - sliceType$6 = $sliceType($Uint8); - arrayType$1 = $arrayType($Uint8, 24); - arrayType$2 = $arrayType($Uint8, 32); - ptrType$1 = $ptrType(floatInfo); - arrayType$3 = $arrayType($Uint8, 65); - arrayType$4 = $arrayType($Uint8, 4); - ptrType$2 = $ptrType(decimal); - ptrType$3 = $ptrType(decimalSlice); - ptrType$4 = $ptrType(extFloat); - ParseBool = function(str) { - var $ptr, _1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, err, str, value; - value = false; - err = $ifaceNil; - _1 = str; - if (_1 === ("1") || _1 === ("t") || _1 === ("T") || _1 === ("true") || _1 === ("TRUE") || _1 === ("True")) { - _tmp = true; - _tmp$1 = $ifaceNil; - value = _tmp; - err = _tmp$1; - return [value, err]; - } else if (_1 === ("0") || _1 === ("f") || _1 === ("F") || _1 === ("false") || _1 === ("FALSE") || _1 === ("False")) { - _tmp$2 = false; - _tmp$3 = $ifaceNil; - value = _tmp$2; - err = _tmp$3; - return [value, err]; - } - _tmp$4 = false; - _tmp$5 = syntaxError("ParseBool", str); - value = _tmp$4; - err = _tmp$5; - return [value, err]; - }; - $pkg.ParseBool = ParseBool; - equalIgnoreCase = function(s1, s2) { - var $ptr, c1, c2, i, s1, s2; - if (!((s1.length === s2.length))) { - return false; - } - i = 0; - while (true) { - if (!(i < s1.length)) { break; } - c1 = s1.charCodeAt(i); - if (65 <= c1 && c1 <= 90) { - c1 = c1 + (32) << 24 >>> 24; - } - c2 = s2.charCodeAt(i); - if (65 <= c2 && c2 <= 90) { - c2 = c2 + (32) << 24 >>> 24; - } - if (!((c1 === c2))) { - return false; - } - i = i + (1) >> 0; - } - return true; - }; - special = function(s) { - var $ptr, _1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, f, ok, s; - f = 0; - ok = false; - if (s.length === 0) { - return [f, ok]; - } - _1 = s.charCodeAt(0); - if (_1 === (43)) { - if (equalIgnoreCase(s, "+inf") || equalIgnoreCase(s, "+infinity")) { - _tmp = math.Inf(1); - _tmp$1 = true; - f = _tmp; - ok = _tmp$1; - return [f, ok]; - } - } else if (_1 === (45)) { - if (equalIgnoreCase(s, "-inf") || equalIgnoreCase(s, "-infinity")) { - _tmp$2 = math.Inf(-1); - _tmp$3 = true; - f = _tmp$2; - ok = _tmp$3; - return [f, ok]; - } - } else if ((_1 === (110)) || (_1 === (78))) { - if (equalIgnoreCase(s, "nan")) { - _tmp$4 = math.NaN(); - _tmp$5 = true; - f = _tmp$4; - ok = _tmp$5; - return [f, ok]; - } - } else if ((_1 === (105)) || (_1 === (73))) { - if (equalIgnoreCase(s, "inf") || equalIgnoreCase(s, "infinity")) { - _tmp$6 = math.Inf(1); - _tmp$7 = true; - f = _tmp$6; - ok = _tmp$7; - return [f, ok]; - } - } else { - return [f, ok]; - } - return [f, ok]; - }; - decimal.ptr.prototype.set = function(s) { - var $ptr, b, e, esign, i, ok, s, sawdigits, sawdot, x, x$1; - ok = false; - b = this; - i = 0; - b.neg = false; - b.trunc = false; - if (i >= s.length) { - return ok; - } - if ((s.charCodeAt(i) === 43)) { - i = i + (1) >> 0; - } else if ((s.charCodeAt(i) === 45)) { - b.neg = true; - i = i + (1) >> 0; - } - sawdot = false; - sawdigits = false; - while (true) { - if (!(i < s.length)) { break; } - if ((s.charCodeAt(i) === 46)) { - if (sawdot) { - return ok; - } - sawdot = true; - b.dp = b.nd; - i = i + (1) >> 0; - continue; - } else if (48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57) { - sawdigits = true; - if ((s.charCodeAt(i) === 48) && (b.nd === 0)) { - b.dp = b.dp - (1) >> 0; - i = i + (1) >> 0; - continue; - } - if (b.nd < 800) { - (x = b.d, x$1 = b.nd, ((x$1 < 0 || x$1 >= x.length) ? $throwRuntimeError("index out of range") : x[x$1] = s.charCodeAt(i))); - b.nd = b.nd + (1) >> 0; - } else if (!((s.charCodeAt(i) === 48))) { - b.trunc = true; - } - i = i + (1) >> 0; - continue; - } - break; - } - if (!sawdigits) { - return ok; - } - if (!sawdot) { - b.dp = b.nd; - } - if (i < s.length && ((s.charCodeAt(i) === 101) || (s.charCodeAt(i) === 69))) { - i = i + (1) >> 0; - if (i >= s.length) { - return ok; - } - esign = 1; - if (s.charCodeAt(i) === 43) { - i = i + (1) >> 0; - } else if (s.charCodeAt(i) === 45) { - i = i + (1) >> 0; - esign = -1; - } - if (i >= s.length || s.charCodeAt(i) < 48 || s.charCodeAt(i) > 57) { - return ok; - } - e = 0; - while (true) { - if (!(i < s.length && 48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57)) { break; } - if (e < 10000) { - e = (($imul(e, 10)) + (s.charCodeAt(i) >> 0) >> 0) - 48 >> 0; - } - i = i + (1) >> 0; - } - b.dp = b.dp + (($imul(e, esign))) >> 0; - } - if (!((i === s.length))) { - return ok; - } - ok = true; - return ok; - }; - decimal.prototype.set = function(s) { return this.$val.set(s); }; - readFloat = function(s) { - var $ptr, _2, c, dp, e, esign, exp, i, mantissa, nd, ndMant, neg, ok, s, sawdigits, sawdot, trunc, x; - mantissa = new $Uint64(0, 0); - exp = 0; - neg = false; - trunc = false; - ok = false; - i = 0; - if (i >= s.length) { - return [mantissa, exp, neg, trunc, ok]; - } - if ((s.charCodeAt(i) === 43)) { - i = i + (1) >> 0; - } else if ((s.charCodeAt(i) === 45)) { - neg = true; - i = i + (1) >> 0; - } - sawdot = false; - sawdigits = false; - nd = 0; - ndMant = 0; - dp = 0; - while (true) { - if (!(i < s.length)) { break; } - c = s.charCodeAt(i); - _2 = true; - if (_2 === ((c === 46))) { - if (sawdot) { - return [mantissa, exp, neg, trunc, ok]; - } - sawdot = true; - dp = nd; - i = i + (1) >> 0; - continue; - } else if (_2 === (48 <= c && c <= 57)) { - sawdigits = true; - if ((c === 48) && (nd === 0)) { - dp = dp - (1) >> 0; - i = i + (1) >> 0; - continue; - } - nd = nd + (1) >> 0; - if (ndMant < 19) { - mantissa = $mul64(mantissa, (new $Uint64(0, 10))); - mantissa = (x = new $Uint64(0, (c - 48 << 24 >>> 24)), new $Uint64(mantissa.$high + x.$high, mantissa.$low + x.$low)); - ndMant = ndMant + (1) >> 0; - } else if (!((s.charCodeAt(i) === 48))) { - trunc = true; - } - i = i + (1) >> 0; - continue; - } - break; - } - if (!sawdigits) { - return [mantissa, exp, neg, trunc, ok]; - } - if (!sawdot) { - dp = nd; - } - if (i < s.length && ((s.charCodeAt(i) === 101) || (s.charCodeAt(i) === 69))) { - i = i + (1) >> 0; - if (i >= s.length) { - return [mantissa, exp, neg, trunc, ok]; - } - esign = 1; - if (s.charCodeAt(i) === 43) { - i = i + (1) >> 0; - } else if (s.charCodeAt(i) === 45) { - i = i + (1) >> 0; - esign = -1; - } - if (i >= s.length || s.charCodeAt(i) < 48 || s.charCodeAt(i) > 57) { - return [mantissa, exp, neg, trunc, ok]; - } - e = 0; - while (true) { - if (!(i < s.length && 48 <= s.charCodeAt(i) && s.charCodeAt(i) <= 57)) { break; } - if (e < 10000) { - e = (($imul(e, 10)) + (s.charCodeAt(i) >> 0) >> 0) - 48 >> 0; - } - i = i + (1) >> 0; - } - dp = dp + (($imul(e, esign))) >> 0; - } - if (!((i === s.length))) { - return [mantissa, exp, neg, trunc, ok]; - } - exp = dp - ndMant >> 0; - ok = true; - return [mantissa, exp, neg, trunc, ok]; - }; - decimal.ptr.prototype.floatBits = function(flt) { - var $ptr, _tmp, _tmp$1, b, bits, d, exp, flt, mant, n, n$1, n$2, overflow, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, y, y$1, y$2, y$3, $s; - /* */ $s = 0; s: while (true) { switch ($s) { case 0: - b = new $Uint64(0, 0); - overflow = false; - d = this; - exp = 0; - mant = new $Uint64(0, 0); - /* */ if (d.nd === 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (d.nd === 0) { */ case 1: - mant = new $Uint64(0, 0); - exp = flt.bias; - /* goto out */ $s = 3; continue; - /* } */ case 2: - /* */ if (d.dp > 310) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (d.dp > 310) { */ case 4: - /* goto overflow */ $s = 6; continue; - /* } */ case 5: - /* */ if (d.dp < -330) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (d.dp < -330) { */ case 7: - mant = new $Uint64(0, 0); - exp = flt.bias; - /* goto out */ $s = 3; continue; - /* } */ case 8: - exp = 0; - while (true) { - if (!(d.dp > 0)) { break; } - n = 0; - if (d.dp >= powtab.$length) { - n = 27; - } else { - n = (x = d.dp, ((x < 0 || x >= powtab.$length) ? $throwRuntimeError("index out of range") : powtab.$array[powtab.$offset + x])); - } - d.Shift(-n); - exp = exp + (n) >> 0; - } - while (true) { - if (!(d.dp < 0 || (d.dp === 0) && d.d[0] < 53)) { break; } - n$1 = 0; - if (-d.dp >= powtab.$length) { - n$1 = 27; - } else { - n$1 = (x$1 = -d.dp, ((x$1 < 0 || x$1 >= powtab.$length) ? $throwRuntimeError("index out of range") : powtab.$array[powtab.$offset + x$1])); - } - d.Shift(n$1); - exp = exp - (n$1) >> 0; - } - exp = exp - (1) >> 0; - if (exp < (flt.bias + 1 >> 0)) { - n$2 = (flt.bias + 1 >> 0) - exp >> 0; - d.Shift(-n$2); - exp = exp + (n$2) >> 0; - } - /* */ if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) { */ case 9: - /* goto overflow */ $s = 6; continue; - /* } */ case 10: - d.Shift(((1 + flt.mantbits >>> 0) >> 0)); - mant = d.RoundedInteger(); - /* */ if ((x$2 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) { $s = 11; continue; } - /* */ $s = 12; continue; - /* if ((x$2 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) { */ case 11: - mant = $shiftRightUint64(mant, (1)); - exp = exp + (1) >> 0; - /* */ if ((exp - flt.bias >> 0) >= (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0)) { $s = 13; continue; } - /* */ $s = 14; continue; - /* if ((exp - flt.bias >> 0) >= (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0)) { */ case 13: - /* goto overflow */ $s = 6; continue; - /* } */ case 14: - /* } */ case 12: - if ((x$3 = (x$4 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high & x$4.$high, (mant.$low & x$4.$low) >>> 0)), (x$3.$high === 0 && x$3.$low === 0))) { - exp = flt.bias; - } - /* goto out */ $s = 3; continue; - /* overflow: */ case 6: - mant = new $Uint64(0, 0); - exp = (((y$2 = flt.expbits, y$2 < 32 ? (1 << y$2) : 0) >> 0) - 1 >> 0) + flt.bias >> 0; - overflow = true; - /* out: */ case 3: - bits = (x$5 = (x$6 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$6.$high - 0, x$6.$low - 1)), new $Uint64(mant.$high & x$5.$high, (mant.$low & x$5.$low) >>> 0)); - bits = (x$7 = $shiftLeft64(new $Uint64(0, (((exp - flt.bias >> 0)) & ((((y$3 = flt.expbits, y$3 < 32 ? (1 << y$3) : 0) >> 0) - 1 >> 0)))), flt.mantbits), new $Uint64(bits.$high | x$7.$high, (bits.$low | x$7.$low) >>> 0)); - if (d.neg) { - bits = (x$8 = $shiftLeft64($shiftLeft64(new $Uint64(0, 1), flt.mantbits), flt.expbits), new $Uint64(bits.$high | x$8.$high, (bits.$low | x$8.$low) >>> 0)); - } - _tmp = bits; - _tmp$1 = overflow; - b = _tmp; - overflow = _tmp$1; - return [b, overflow]; - /* */ } return; } - }; - decimal.prototype.floatBits = function(flt) { return this.$val.floatBits(flt); }; - atof64exact = function(mantissa, exp, neg) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, exp, f, mantissa, neg, ok, x, x$1, x$2; - f = 0; - ok = false; - if (!((x = $shiftRightUint64(mantissa, float64info.mantbits), (x.$high === 0 && x.$low === 0)))) { - return [f, ok]; - } - f = $flatten64(mantissa); - if (neg) { - f = -f; - } - if ((exp === 0)) { - _tmp = f; - _tmp$1 = true; - f = _tmp; - ok = _tmp$1; - return [f, ok]; - } else if (exp > 0 && exp <= 37) { - if (exp > 22) { - f = f * ((x$1 = exp - 22 >> 0, ((x$1 < 0 || x$1 >= float64pow10.$length) ? $throwRuntimeError("index out of range") : float64pow10.$array[float64pow10.$offset + x$1]))); - exp = 22; - } - if (f > 1e+15 || f < -1e+15) { - return [f, ok]; - } - _tmp$2 = f * ((exp < 0 || exp >= float64pow10.$length) ? $throwRuntimeError("index out of range") : float64pow10.$array[float64pow10.$offset + exp]); - _tmp$3 = true; - f = _tmp$2; - ok = _tmp$3; - return [f, ok]; - } else if (exp < 0 && exp >= -22) { - _tmp$4 = f / (x$2 = -exp, ((x$2 < 0 || x$2 >= float64pow10.$length) ? $throwRuntimeError("index out of range") : float64pow10.$array[float64pow10.$offset + x$2])); - _tmp$5 = true; - f = _tmp$4; - ok = _tmp$5; - return [f, ok]; - } - return [f, ok]; - }; - atof32exact = function(mantissa, exp, neg) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, exp, f, mantissa, neg, ok, x, x$1, x$2; - f = 0; - ok = false; - if (!((x = $shiftRightUint64(mantissa, float32info.mantbits), (x.$high === 0 && x.$low === 0)))) { - return [f, ok]; - } - f = $flatten64(mantissa); - if (neg) { - f = -f; - } - if ((exp === 0)) { - _tmp = f; - _tmp$1 = true; - f = _tmp; - ok = _tmp$1; - return [f, ok]; - } else if (exp > 0 && exp <= 17) { - if (exp > 10) { - f = $fround(f * ((x$1 = exp - 10 >> 0, ((x$1 < 0 || x$1 >= float32pow10.$length) ? $throwRuntimeError("index out of range") : float32pow10.$array[float32pow10.$offset + x$1])))); - exp = 10; - } - if (f > 1e+07 || f < -1e+07) { - return [f, ok]; - } - _tmp$2 = $fround(f * ((exp < 0 || exp >= float32pow10.$length) ? $throwRuntimeError("index out of range") : float32pow10.$array[float32pow10.$offset + exp])); - _tmp$3 = true; - f = _tmp$2; - ok = _tmp$3; - return [f, ok]; - } else if (exp < 0 && exp >= -10) { - _tmp$4 = $fround(f / (x$2 = -exp, ((x$2 < 0 || x$2 >= float32pow10.$length) ? $throwRuntimeError("index out of range") : float32pow10.$array[float32pow10.$offset + x$2]))); - _tmp$5 = true; - f = _tmp$4; - ok = _tmp$5; - return [f, ok]; - } - return [f, ok]; - }; - atof32 = function(s) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, b$1, d, err, exp, ext, f, f$1, mantissa, neg, ok, ok$1, ok$2, ok$3, ovf, ovf$1, s, trunc, val; - f = 0; - err = $ifaceNil; - _tuple = special(s); - val = _tuple[0]; - ok = _tuple[1]; - if (ok) { - _tmp = $fround(val); - _tmp$1 = $ifaceNil; - f = _tmp; - err = _tmp$1; - return [f, err]; - } - if (optimize) { - _tuple$1 = readFloat(s); - mantissa = _tuple$1[0]; - exp = _tuple$1[1]; - neg = _tuple$1[2]; - trunc = _tuple$1[3]; - ok$1 = _tuple$1[4]; - if (ok$1) { - if (!trunc) { - _tuple$2 = atof32exact(mantissa, exp, neg); - f$1 = _tuple$2[0]; - ok$2 = _tuple$2[1]; - if (ok$2) { - _tmp$2 = f$1; - _tmp$3 = $ifaceNil; - f = _tmp$2; - err = _tmp$3; - return [f, err]; - } - } - ext = new extFloat.ptr(new $Uint64(0, 0), 0, false); - ok$3 = ext.AssignDecimal(mantissa, exp, neg, trunc, float32info); - if (ok$3) { - _tuple$3 = ext.floatBits(float32info); - b = _tuple$3[0]; - ovf = _tuple$3[1]; - f = math.Float32frombits((b.$low >>> 0)); - if (ovf) { - err = rangeError("ParseFloat", s); - } - _tmp$4 = f; - _tmp$5 = err; - f = _tmp$4; - err = _tmp$5; - return [f, err]; - } - } - } - d = new decimal.ptr(arrayType.zero(), 0, 0, false, false); - if (!d.set(s)) { - _tmp$6 = 0; - _tmp$7 = syntaxError("ParseFloat", s); - f = _tmp$6; - err = _tmp$7; - return [f, err]; - } - _tuple$4 = d.floatBits(float32info); - b$1 = _tuple$4[0]; - ovf$1 = _tuple$4[1]; - f = math.Float32frombits((b$1.$low >>> 0)); - if (ovf$1) { - err = rangeError("ParseFloat", s); - } - _tmp$8 = f; - _tmp$9 = err; - f = _tmp$8; - err = _tmp$9; - return [f, err]; - }; - atof64 = function(s) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, b, b$1, d, err, exp, ext, f, f$1, mantissa, neg, ok, ok$1, ok$2, ok$3, ovf, ovf$1, s, trunc, val; - f = 0; - err = $ifaceNil; - _tuple = special(s); - val = _tuple[0]; - ok = _tuple[1]; - if (ok) { - _tmp = val; - _tmp$1 = $ifaceNil; - f = _tmp; - err = _tmp$1; - return [f, err]; - } - if (optimize) { - _tuple$1 = readFloat(s); - mantissa = _tuple$1[0]; - exp = _tuple$1[1]; - neg = _tuple$1[2]; - trunc = _tuple$1[3]; - ok$1 = _tuple$1[4]; - if (ok$1) { - if (!trunc) { - _tuple$2 = atof64exact(mantissa, exp, neg); - f$1 = _tuple$2[0]; - ok$2 = _tuple$2[1]; - if (ok$2) { - _tmp$2 = f$1; - _tmp$3 = $ifaceNil; - f = _tmp$2; - err = _tmp$3; - return [f, err]; - } - } - ext = new extFloat.ptr(new $Uint64(0, 0), 0, false); - ok$3 = ext.AssignDecimal(mantissa, exp, neg, trunc, float64info); - if (ok$3) { - _tuple$3 = ext.floatBits(float64info); - b = _tuple$3[0]; - ovf = _tuple$3[1]; - f = math.Float64frombits(b); - if (ovf) { - err = rangeError("ParseFloat", s); - } - _tmp$4 = f; - _tmp$5 = err; - f = _tmp$4; - err = _tmp$5; - return [f, err]; - } - } - } - d = new decimal.ptr(arrayType.zero(), 0, 0, false, false); - if (!d.set(s)) { - _tmp$6 = 0; - _tmp$7 = syntaxError("ParseFloat", s); - f = _tmp$6; - err = _tmp$7; - return [f, err]; - } - _tuple$4 = d.floatBits(float64info); - b$1 = _tuple$4[0]; - ovf$1 = _tuple$4[1]; - f = math.Float64frombits(b$1); - if (ovf$1) { - err = rangeError("ParseFloat", s); - } - _tmp$8 = f; - _tmp$9 = err; - f = _tmp$8; - err = _tmp$9; - return [f, err]; - }; - ParseFloat = function(s, bitSize) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, bitSize, err, err1, err1$1, f, f1, f1$1, s; - f = 0; - err = $ifaceNil; - if (bitSize === 32) { - _tuple = atof32(s); - f1 = _tuple[0]; - err1 = _tuple[1]; - _tmp = f1; - _tmp$1 = err1; - f = _tmp; - err = _tmp$1; - return [f, err]; - } - _tuple$1 = atof64(s); - f1$1 = _tuple$1[0]; - err1$1 = _tuple$1[1]; - _tmp$2 = f1$1; - _tmp$3 = err1$1; - f = _tmp$2; - err = _tmp$3; - return [f, err]; - }; - $pkg.ParseFloat = ParseFloat; - NumError.ptr.prototype.Error = function() { - var $ptr, _r, e, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return "strconv." + e.Func + ": " + "parsing " + Quote(e.Num) + ": " + _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: NumError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; - }; - NumError.prototype.Error = function() { return this.$val.Error(); }; - syntaxError = function(fn, str) { - var $ptr, fn, str; - return new NumError.ptr(fn, str, $pkg.ErrSyntax); - }; - rangeError = function(fn, str) { - var $ptr, fn, str; - return new NumError.ptr(fn, str, $pkg.ErrRange); - }; - ParseUint = function(s, base, bitSize) { - var $ptr, _1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, base, bitSize, cutoff, d, err, i, maxVal, n, n1, s, v, x, x$1, x$2, $s; - /* */ $s = 0; s: while (true) { switch ($s) { case 0: - n = new $Uint64(0, 0); - err = $ifaceNil; - _tmp = new $Uint64(0, 0); - _tmp$1 = new $Uint64(0, 0); - cutoff = _tmp; - maxVal = _tmp$1; - if (bitSize === 0) { - bitSize = 32; - } - i = 0; - /* */ if (s.length < 1) { $s = 2; continue; } - /* */ if (2 <= base && base <= 36) { $s = 3; continue; } - /* */ if ((base === 0)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (s.length < 1) { */ case 2: - err = $pkg.ErrSyntax; - /* goto Error */ $s = 7; continue; - $s = 6; continue; - /* } else if (2 <= base && base <= 36) { */ case 3: - $s = 6; continue; - /* } else if ((base === 0)) { */ case 4: - /* */ if ((s.charCodeAt(0) === 48) && s.length > 1 && ((s.charCodeAt(1) === 120) || (s.charCodeAt(1) === 88))) { $s = 9; continue; } - /* */ if ((s.charCodeAt(0) === 48)) { $s = 10; continue; } - /* */ $s = 11; continue; - /* if ((s.charCodeAt(0) === 48) && s.length > 1 && ((s.charCodeAt(1) === 120) || (s.charCodeAt(1) === 88))) { */ case 9: - /* */ if (s.length < 3) { $s = 13; continue; } - /* */ $s = 14; continue; - /* if (s.length < 3) { */ case 13: - err = $pkg.ErrSyntax; - /* goto Error */ $s = 7; continue; - /* } */ case 14: - base = 16; - i = 2; - $s = 12; continue; - /* } else if ((s.charCodeAt(0) === 48)) { */ case 10: - base = 8; - i = 1; - $s = 12; continue; - /* } else { */ case 11: - base = 10; - /* } */ case 12: - case 8: - $s = 6; continue; - /* } else { */ case 5: - err = errors.New("invalid base " + Itoa(base)); - /* goto Error */ $s = 7; continue; - /* } */ case 6: - case 1: - _1 = base; - if (_1 === (10)) { - cutoff = new $Uint64(429496729, 2576980378); - } else if (_1 === (16)) { - cutoff = new $Uint64(268435456, 0); - } else { - cutoff = (x = $div64(new $Uint64(4294967295, 4294967295), new $Uint64(0, base), false), new $Uint64(x.$high + 0, x.$low + 1)); - } - maxVal = (x$1 = $shiftLeft64(new $Uint64(0, 1), (bitSize >>> 0)), new $Uint64(x$1.$high - 0, x$1.$low - 1)); - /* while (true) { */ case 15: - /* if (!(i < s.length)) { break; } */ if(!(i < s.length)) { $s = 16; continue; } - v = 0; - d = s.charCodeAt(i); - /* */ if (48 <= d && d <= 57) { $s = 18; continue; } - /* */ if (97 <= d && d <= 122) { $s = 19; continue; } - /* */ if (65 <= d && d <= 90) { $s = 20; continue; } - /* */ $s = 21; continue; - /* if (48 <= d && d <= 57) { */ case 18: - v = d - 48 << 24 >>> 24; - $s = 22; continue; - /* } else if (97 <= d && d <= 122) { */ case 19: - v = (d - 97 << 24 >>> 24) + 10 << 24 >>> 24; - $s = 22; continue; - /* } else if (65 <= d && d <= 90) { */ case 20: - v = (d - 65 << 24 >>> 24) + 10 << 24 >>> 24; - $s = 22; continue; - /* } else { */ case 21: - n = new $Uint64(0, 0); - err = $pkg.ErrSyntax; - /* goto Error */ $s = 7; continue; - /* } */ case 22: - case 17: - /* */ if (v >= (base << 24 >>> 24)) { $s = 23; continue; } - /* */ $s = 24; continue; - /* if (v >= (base << 24 >>> 24)) { */ case 23: - n = new $Uint64(0, 0); - err = $pkg.ErrSyntax; - /* goto Error */ $s = 7; continue; - /* } */ case 24: - /* */ if ((n.$high > cutoff.$high || (n.$high === cutoff.$high && n.$low >= cutoff.$low))) { $s = 25; continue; } - /* */ $s = 26; continue; - /* if ((n.$high > cutoff.$high || (n.$high === cutoff.$high && n.$low >= cutoff.$low))) { */ case 25: - n = new $Uint64(4294967295, 4294967295); - err = $pkg.ErrRange; - /* goto Error */ $s = 7; continue; - /* } */ case 26: - n = $mul64(n, (new $Uint64(0, base))); - n1 = (x$2 = new $Uint64(0, v), new $Uint64(n.$high + x$2.$high, n.$low + x$2.$low)); - /* */ if ((n1.$high < n.$high || (n1.$high === n.$high && n1.$low < n.$low)) || (n1.$high > maxVal.$high || (n1.$high === maxVal.$high && n1.$low > maxVal.$low))) { $s = 27; continue; } - /* */ $s = 28; continue; - /* if ((n1.$high < n.$high || (n1.$high === n.$high && n1.$low < n.$low)) || (n1.$high > maxVal.$high || (n1.$high === maxVal.$high && n1.$low > maxVal.$low))) { */ case 27: - n = new $Uint64(4294967295, 4294967295); - err = $pkg.ErrRange; - /* goto Error */ $s = 7; continue; - /* } */ case 28: - n = n1; - i = i + (1) >> 0; - /* } */ $s = 15; continue; case 16: - _tmp$2 = n; - _tmp$3 = $ifaceNil; - n = _tmp$2; - err = _tmp$3; - return [n, err]; - /* Error: */ case 7: - _tmp$4 = n; - _tmp$5 = new NumError.ptr("ParseUint", s, err); - n = _tmp$4; - err = _tmp$5; - return [n, err]; - /* */ $s = -1; case -1: } return; } - }; - $pkg.ParseUint = ParseUint; - ParseInt = function(s, base, bitSize) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, base, bitSize, cutoff, err, i, n, neg, s, s0, un, x, x$1; - i = new $Int64(0, 0); - err = $ifaceNil; - if (bitSize === 0) { - bitSize = 32; - } - if (s.length === 0) { - _tmp = new $Int64(0, 0); - _tmp$1 = syntaxError("ParseInt", s); - i = _tmp; - err = _tmp$1; - return [i, err]; - } - s0 = s; - neg = false; - if (s.charCodeAt(0) === 43) { - s = s.substring(1); - } else if (s.charCodeAt(0) === 45) { - neg = true; - s = s.substring(1); - } - un = new $Uint64(0, 0); - _tuple = ParseUint(s, base, bitSize); - un = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil)) && !($interfaceIsEqual($assertType(err, ptrType).Err, $pkg.ErrRange))) { - $assertType(err, ptrType).Func = "ParseInt"; - $assertType(err, ptrType).Num = s0; - _tmp$2 = new $Int64(0, 0); - _tmp$3 = err; - i = _tmp$2; - err = _tmp$3; - return [i, err]; - } - cutoff = $shiftLeft64(new $Uint64(0, 1), ((bitSize - 1 >> 0) >>> 0)); - if (!neg && (un.$high > cutoff.$high || (un.$high === cutoff.$high && un.$low >= cutoff.$low))) { - _tmp$4 = (x = new $Uint64(cutoff.$high - 0, cutoff.$low - 1), new $Int64(x.$high, x.$low)); - _tmp$5 = rangeError("ParseInt", s0); - i = _tmp$4; - err = _tmp$5; - return [i, err]; - } - if (neg && (un.$high > cutoff.$high || (un.$high === cutoff.$high && un.$low > cutoff.$low))) { - _tmp$6 = (x$1 = new $Int64(cutoff.$high, cutoff.$low), new $Int64(-x$1.$high, -x$1.$low)); - _tmp$7 = rangeError("ParseInt", s0); - i = _tmp$6; - err = _tmp$7; - return [i, err]; - } - n = new $Int64(un.$high, un.$low); - if (neg) { - n = new $Int64(-n.$high, -n.$low); - } - _tmp$8 = n; - _tmp$9 = $ifaceNil; - i = _tmp$8; - err = _tmp$9; - return [i, err]; - }; - $pkg.ParseInt = ParseInt; - decimal.ptr.prototype.String = function() { - var $ptr, a, buf, n, w; - a = this; - n = 10 + a.nd >> 0; - if (a.dp > 0) { - n = n + (a.dp) >> 0; - } - if (a.dp < 0) { - n = n + (-a.dp) >> 0; - } - buf = $makeSlice(sliceType$6, n); - w = 0; - if ((a.nd === 0)) { - return "0"; - } else if (a.dp <= 0) { - ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = 48); - w = w + (1) >> 0; - ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = 46); - w = w + (1) >> 0; - w = w + (digitZero($subslice(buf, w, (w + -a.dp >> 0)))) >> 0; - w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), 0, a.nd))) >> 0; - } else if (a.dp < a.nd) { - w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), 0, a.dp))) >> 0; - ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = 46); - w = w + (1) >> 0; - w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), a.dp, a.nd))) >> 0; - } else { - w = w + ($copySlice($subslice(buf, w), $subslice(new sliceType$6(a.d), 0, a.nd))) >> 0; - w = w + (digitZero($subslice(buf, w, ((w + a.dp >> 0) - a.nd >> 0)))) >> 0; - } - return $bytesToString($subslice(buf, 0, w)); - }; - decimal.prototype.String = function() { return this.$val.String(); }; - digitZero = function(dst) { - var $ptr, _i, _ref, dst, i; - _ref = dst; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - ((i < 0 || i >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + i] = 48); - _i++; - } - return dst.$length; - }; - trim = function(a) { - var $ptr, a, x, x$1; - while (true) { - if (!(a.nd > 0 && ((x = a.d, x$1 = a.nd - 1 >> 0, ((x$1 < 0 || x$1 >= x.length) ? $throwRuntimeError("index out of range") : x[x$1])) === 48))) { break; } - a.nd = a.nd - (1) >> 0; - } - if (a.nd === 0) { - a.dp = 0; - } - }; - decimal.ptr.prototype.Assign = function(v) { - var $ptr, a, buf, n, v, v1, x, x$1, x$2; - a = this; - buf = arrayType$1.zero(); - n = 0; - while (true) { - if (!((v.$high > 0 || (v.$high === 0 && v.$low > 0)))) { break; } - v1 = $div64(v, new $Uint64(0, 10), false); - v = (x = $mul64(new $Uint64(0, 10), v1), new $Uint64(v.$high - x.$high, v.$low - x.$low)); - ((n < 0 || n >= buf.length) ? $throwRuntimeError("index out of range") : buf[n] = (new $Uint64(v.$high + 0, v.$low + 48).$low << 24 >>> 24)); - n = n + (1) >> 0; - v = v1; - } - a.nd = 0; - n = n - (1) >> 0; - while (true) { - if (!(n >= 0)) { break; } - (x$1 = a.d, x$2 = a.nd, ((x$2 < 0 || x$2 >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[x$2] = ((n < 0 || n >= buf.length) ? $throwRuntimeError("index out of range") : buf[n]))); - a.nd = a.nd + (1) >> 0; - n = n - (1) >> 0; - } - a.dp = a.nd; - trim(a); - }; - decimal.prototype.Assign = function(v) { return this.$val.Assign(v); }; - rightShift = function(a, k) { - var $ptr, a, c, c$1, dig, dig$1, k, n, r, w, x, x$1, x$2, x$3, y, y$1, y$2, y$3, y$4, y$5; - r = 0; - w = 0; - n = 0; - while (true) { - if (!(((y = k, y < 32 ? (n >>> y) : 0) >>> 0) === 0)) { break; } - if (r >= a.nd) { - if (n === 0) { - a.nd = 0; - return; - } - while (true) { - if (!(((y$1 = k, y$1 < 32 ? (n >>> y$1) : 0) >>> 0) === 0)) { break; } - n = n * 10 >>> 0; - r = r + (1) >> 0; - } - break; - } - c = ((x = a.d, ((r < 0 || r >= x.length) ? $throwRuntimeError("index out of range") : x[r])) >>> 0); - n = ((n * 10 >>> 0) + c >>> 0) - 48 >>> 0; - r = r + (1) >> 0; - } - a.dp = a.dp - ((r - 1 >> 0)) >> 0; - while (true) { - if (!(r < a.nd)) { break; } - c$1 = ((x$1 = a.d, ((r < 0 || r >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[r])) >>> 0); - dig = (y$2 = k, y$2 < 32 ? (n >>> y$2) : 0) >>> 0; - n = n - (((y$3 = k, y$3 < 32 ? (dig << y$3) : 0) >>> 0)) >>> 0; - (x$2 = a.d, ((w < 0 || w >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[w] = ((dig + 48 >>> 0) << 24 >>> 24))); - w = w + (1) >> 0; - n = ((n * 10 >>> 0) + c$1 >>> 0) - 48 >>> 0; - r = r + (1) >> 0; - } - while (true) { - if (!(n > 0)) { break; } - dig$1 = (y$4 = k, y$4 < 32 ? (n >>> y$4) : 0) >>> 0; - n = n - (((y$5 = k, y$5 < 32 ? (dig$1 << y$5) : 0) >>> 0)) >>> 0; - if (w < 800) { - (x$3 = a.d, ((w < 0 || w >= x$3.length) ? $throwRuntimeError("index out of range") : x$3[w] = ((dig$1 + 48 >>> 0) << 24 >>> 24))); - w = w + (1) >> 0; - } else if (dig$1 > 0) { - a.trunc = true; - } - n = n * 10 >>> 0; - } - a.nd = w; - trim(a); - }; - prefixIsLessThan = function(b, s) { - var $ptr, b, i, s; - i = 0; - while (true) { - if (!(i < s.length)) { break; } - if (i >= b.$length) { - return true; - } - if (!((((i < 0 || i >= b.$length) ? $throwRuntimeError("index out of range") : b.$array[b.$offset + i]) === s.charCodeAt(i)))) { - return ((i < 0 || i >= b.$length) ? $throwRuntimeError("index out of range") : b.$array[b.$offset + i]) < s.charCodeAt(i); - } - i = i + (1) >> 0; - } - return false; - }; - leftShift = function(a, k) { - var $ptr, _q, _q$1, a, delta, k, n, quo, quo$1, r, rem, rem$1, w, x, x$1, x$2, y; - delta = ((k < 0 || k >= leftcheats.$length) ? $throwRuntimeError("index out of range") : leftcheats.$array[leftcheats.$offset + k]).delta; - if (prefixIsLessThan($subslice(new sliceType$6(a.d), 0, a.nd), ((k < 0 || k >= leftcheats.$length) ? $throwRuntimeError("index out of range") : leftcheats.$array[leftcheats.$offset + k]).cutoff)) { - delta = delta - (1) >> 0; - } - r = a.nd; - w = a.nd + delta >> 0; - n = 0; - r = r - (1) >> 0; - while (true) { - if (!(r >= 0)) { break; } - n = n + (((y = k, y < 32 ? (((((x = a.d, ((r < 0 || r >= x.length) ? $throwRuntimeError("index out of range") : x[r])) >>> 0) - 48 >>> 0)) << y) : 0) >>> 0)) >>> 0; - quo = (_q = n / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - rem = n - (10 * quo >>> 0) >>> 0; - w = w - (1) >> 0; - if (w < 800) { - (x$1 = a.d, ((w < 0 || w >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[w] = ((rem + 48 >>> 0) << 24 >>> 24))); - } else if (!((rem === 0))) { - a.trunc = true; - } - n = quo; - r = r - (1) >> 0; - } - while (true) { - if (!(n > 0)) { break; } - quo$1 = (_q$1 = n / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); - rem$1 = n - (10 * quo$1 >>> 0) >>> 0; - w = w - (1) >> 0; - if (w < 800) { - (x$2 = a.d, ((w < 0 || w >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[w] = ((rem$1 + 48 >>> 0) << 24 >>> 24))); - } else if (!((rem$1 === 0))) { - a.trunc = true; - } - n = quo$1; - } - a.nd = a.nd + (delta) >> 0; - if (a.nd >= 800) { - a.nd = 800; - } - a.dp = a.dp + (delta) >> 0; - trim(a); - }; - decimal.ptr.prototype.Shift = function(k) { - var $ptr, a, k; - a = this; - if ((a.nd === 0)) { - } else if (k > 0) { - while (true) { - if (!(k > 28)) { break; } - leftShift(a, 28); - k = k - (28) >> 0; - } - leftShift(a, (k >>> 0)); - } else if (k < 0) { - while (true) { - if (!(k < -28)) { break; } - rightShift(a, 28); - k = k + (28) >> 0; - } - rightShift(a, (-k >>> 0)); - } - }; - decimal.prototype.Shift = function(k) { return this.$val.Shift(k); }; - shouldRoundUp = function(a, nd) { - var $ptr, _r, a, nd, x, x$1, x$2, x$3; - if (nd < 0 || nd >= a.nd) { - return false; - } - if (((x = a.d, ((nd < 0 || nd >= x.length) ? $throwRuntimeError("index out of range") : x[nd])) === 53) && ((nd + 1 >> 0) === a.nd)) { - if (a.trunc) { - return true; - } - return nd > 0 && !(((_r = (((x$1 = a.d, x$2 = nd - 1 >> 0, ((x$2 < 0 || x$2 >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[x$2])) - 48 << 24 >>> 24)) % 2, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0)); - } - return (x$3 = a.d, ((nd < 0 || nd >= x$3.length) ? $throwRuntimeError("index out of range") : x$3[nd])) >= 53; - }; - decimal.ptr.prototype.Round = function(nd) { - var $ptr, a, nd; - a = this; - if (nd < 0 || nd >= a.nd) { - return; - } - if (shouldRoundUp(a, nd)) { - a.RoundUp(nd); - } else { - a.RoundDown(nd); - } - }; - decimal.prototype.Round = function(nd) { return this.$val.Round(nd); }; - decimal.ptr.prototype.RoundDown = function(nd) { - var $ptr, a, nd; - a = this; - if (nd < 0 || nd >= a.nd) { - return; - } - a.nd = nd; - trim(a); - }; - decimal.prototype.RoundDown = function(nd) { return this.$val.RoundDown(nd); }; - decimal.ptr.prototype.RoundUp = function(nd) { - var $ptr, a, c, i, nd, x, x$1, x$2; - a = this; - if (nd < 0 || nd >= a.nd) { - return; - } - i = nd - 1 >> 0; - while (true) { - if (!(i >= 0)) { break; } - c = (x = a.d, ((i < 0 || i >= x.length) ? $throwRuntimeError("index out of range") : x[i])); - if (c < 57) { - (x$2 = a.d, ((i < 0 || i >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[i] = ((x$1 = a.d, ((i < 0 || i >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[i])) + (1) << 24 >>> 24))); - a.nd = i + 1 >> 0; - return; - } - i = i - (1) >> 0; - } - a.d[0] = 49; - a.nd = 1; - a.dp = a.dp + (1) >> 0; - }; - decimal.prototype.RoundUp = function(nd) { return this.$val.RoundUp(nd); }; - decimal.ptr.prototype.RoundedInteger = function() { - var $ptr, a, i, n, x, x$1, x$2, x$3; - a = this; - if (a.dp > 20) { - return new $Uint64(4294967295, 4294967295); - } - i = 0; - n = new $Uint64(0, 0); - i = 0; - while (true) { - if (!(i < a.dp && i < a.nd)) { break; } - n = (x = $mul64(n, new $Uint64(0, 10)), x$1 = new $Uint64(0, ((x$2 = a.d, ((i < 0 || i >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[i])) - 48 << 24 >>> 24)), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); - i = i + (1) >> 0; - } - while (true) { - if (!(i < a.dp)) { break; } - n = $mul64(n, (new $Uint64(0, 10))); - i = i + (1) >> 0; - } - if (shouldRoundUp(a, a.dp)) { - n = (x$3 = new $Uint64(0, 1), new $Uint64(n.$high + x$3.$high, n.$low + x$3.$low)); - } - return n; - }; - decimal.prototype.RoundedInteger = function() { return this.$val.RoundedInteger(); }; - extFloat.ptr.prototype.floatBits = function(flt) { - var $ptr, bits, exp, f, flt, mant, n, overflow, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, y$1, y$2; - bits = new $Uint64(0, 0); - overflow = false; - f = this; - f.Normalize(); - exp = f.exp + 63 >> 0; - if (exp < (flt.bias + 1 >> 0)) { - n = (flt.bias + 1 >> 0) - exp >> 0; - f.mant = $shiftRightUint64(f.mant, ((n >>> 0))); - exp = exp + (n) >> 0; - } - mant = $shiftRightUint64(f.mant, ((63 - flt.mantbits >>> 0))); - if (!((x = (x$1 = f.mant, x$2 = $shiftLeft64(new $Uint64(0, 1), ((62 - flt.mantbits >>> 0))), new $Uint64(x$1.$high & x$2.$high, (x$1.$low & x$2.$low) >>> 0)), (x.$high === 0 && x.$low === 0)))) { - mant = (x$3 = new $Uint64(0, 1), new $Uint64(mant.$high + x$3.$high, mant.$low + x$3.$low)); - } - if ((x$4 = $shiftLeft64(new $Uint64(0, 2), flt.mantbits), (mant.$high === x$4.$high && mant.$low === x$4.$low))) { - mant = $shiftRightUint64(mant, (1)); - exp = exp + (1) >> 0; - } - if ((exp - flt.bias >> 0) >= (((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)) { - mant = new $Uint64(0, 0); - exp = (((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0) + flt.bias >> 0; - overflow = true; - } else if ((x$5 = (x$6 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high & x$6.$high, (mant.$low & x$6.$low) >>> 0)), (x$5.$high === 0 && x$5.$low === 0))) { - exp = flt.bias; - } - bits = (x$7 = (x$8 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$8.$high - 0, x$8.$low - 1)), new $Uint64(mant.$high & x$7.$high, (mant.$low & x$7.$low) >>> 0)); - bits = (x$9 = $shiftLeft64(new $Uint64(0, (((exp - flt.bias >> 0)) & ((((y$2 = flt.expbits, y$2 < 32 ? (1 << y$2) : 0) >> 0) - 1 >> 0)))), flt.mantbits), new $Uint64(bits.$high | x$9.$high, (bits.$low | x$9.$low) >>> 0)); - if (f.neg) { - bits = (x$10 = $shiftLeft64(new $Uint64(0, 1), ((flt.mantbits + flt.expbits >>> 0))), new $Uint64(bits.$high | x$10.$high, (bits.$low | x$10.$low) >>> 0)); - } - return [bits, overflow]; - }; - extFloat.prototype.floatBits = function(flt) { return this.$val.floatBits(flt); }; - extFloat.ptr.prototype.AssignComputeBounds = function(mant, exp, neg, flt) { - var $ptr, _tmp, _tmp$1, exp, expBiased, f, flt, lower, mant, neg, upper, x, x$1, x$2, x$3, x$4; - lower = new extFloat.ptr(new $Uint64(0, 0), 0, false); - upper = new extFloat.ptr(new $Uint64(0, 0), 0, false); - f = this; - f.mant = mant; - f.exp = exp - (flt.mantbits >> 0) >> 0; - f.neg = neg; - if (f.exp <= 0 && (x = $shiftLeft64(($shiftRightUint64(mant, (-f.exp >>> 0))), (-f.exp >>> 0)), (mant.$high === x.$high && mant.$low === x.$low))) { - f.mant = $shiftRightUint64(f.mant, ((-f.exp >>> 0))); - f.exp = 0; - _tmp = $clone(f, extFloat); - _tmp$1 = $clone(f, extFloat); - extFloat.copy(lower, _tmp); - extFloat.copy(upper, _tmp$1); - return [lower, upper]; - } - expBiased = exp - flt.bias >> 0; - extFloat.copy(upper, new extFloat.ptr((x$1 = $mul64(new $Uint64(0, 2), f.mant), new $Uint64(x$1.$high + 0, x$1.$low + 1)), f.exp - 1 >> 0, f.neg)); - if (!((x$2 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), (mant.$high === x$2.$high && mant.$low === x$2.$low))) || (expBiased === 1)) { - extFloat.copy(lower, new extFloat.ptr((x$3 = $mul64(new $Uint64(0, 2), f.mant), new $Uint64(x$3.$high - 0, x$3.$low - 1)), f.exp - 1 >> 0, f.neg)); - } else { - extFloat.copy(lower, new extFloat.ptr((x$4 = $mul64(new $Uint64(0, 4), f.mant), new $Uint64(x$4.$high - 0, x$4.$low - 1)), f.exp - 2 >> 0, f.neg)); - } - return [lower, upper]; - }; - extFloat.prototype.AssignComputeBounds = function(mant, exp, neg, flt) { return this.$val.AssignComputeBounds(mant, exp, neg, flt); }; - extFloat.ptr.prototype.Normalize = function() { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, exp, f, mant, shift, x, x$1, x$2, x$3, x$4, x$5; - shift = 0; - f = this; - _tmp = f.mant; - _tmp$1 = f.exp; - mant = _tmp; - exp = _tmp$1; - if ((mant.$high === 0 && mant.$low === 0)) { - shift = 0; - return shift; - } - if ((x = $shiftRightUint64(mant, 32), (x.$high === 0 && x.$low === 0))) { - mant = $shiftLeft64(mant, (32)); - exp = exp - (32) >> 0; - } - if ((x$1 = $shiftRightUint64(mant, 48), (x$1.$high === 0 && x$1.$low === 0))) { - mant = $shiftLeft64(mant, (16)); - exp = exp - (16) >> 0; - } - if ((x$2 = $shiftRightUint64(mant, 56), (x$2.$high === 0 && x$2.$low === 0))) { - mant = $shiftLeft64(mant, (8)); - exp = exp - (8) >> 0; - } - if ((x$3 = $shiftRightUint64(mant, 60), (x$3.$high === 0 && x$3.$low === 0))) { - mant = $shiftLeft64(mant, (4)); - exp = exp - (4) >> 0; - } - if ((x$4 = $shiftRightUint64(mant, 62), (x$4.$high === 0 && x$4.$low === 0))) { - mant = $shiftLeft64(mant, (2)); - exp = exp - (2) >> 0; - } - if ((x$5 = $shiftRightUint64(mant, 63), (x$5.$high === 0 && x$5.$low === 0))) { - mant = $shiftLeft64(mant, (1)); - exp = exp - (1) >> 0; - } - shift = ((f.exp - exp >> 0) >>> 0); - _tmp$2 = mant; - _tmp$3 = exp; - f.mant = _tmp$2; - f.exp = _tmp$3; - return shift; - }; - extFloat.prototype.Normalize = function() { return this.$val.Normalize(); }; - extFloat.ptr.prototype.Multiply = function(g) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, cross1, cross2, f, fhi, flo, g, ghi, glo, rem, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - g = $clone(g, extFloat); - f = this; - _tmp = $shiftRightUint64(f.mant, 32); - _tmp$1 = new $Uint64(0, (f.mant.$low >>> 0)); - fhi = _tmp; - flo = _tmp$1; - _tmp$2 = $shiftRightUint64(g.mant, 32); - _tmp$3 = new $Uint64(0, (g.mant.$low >>> 0)); - ghi = _tmp$2; - glo = _tmp$3; - cross1 = $mul64(fhi, glo); - cross2 = $mul64(flo, ghi); - f.mant = (x = (x$1 = $mul64(fhi, ghi), x$2 = $shiftRightUint64(cross1, 32), new $Uint64(x$1.$high + x$2.$high, x$1.$low + x$2.$low)), x$3 = $shiftRightUint64(cross2, 32), new $Uint64(x.$high + x$3.$high, x.$low + x$3.$low)); - rem = (x$4 = (x$5 = new $Uint64(0, (cross1.$low >>> 0)), x$6 = new $Uint64(0, (cross2.$low >>> 0)), new $Uint64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)), x$7 = $shiftRightUint64(($mul64(flo, glo)), 32), new $Uint64(x$4.$high + x$7.$high, x$4.$low + x$7.$low)); - rem = (x$8 = new $Uint64(0, 2147483648), new $Uint64(rem.$high + x$8.$high, rem.$low + x$8.$low)); - f.mant = (x$9 = f.mant, x$10 = ($shiftRightUint64(rem, 32)), new $Uint64(x$9.$high + x$10.$high, x$9.$low + x$10.$low)); - f.exp = (f.exp + g.exp >> 0) + 64 >> 0; - }; - extFloat.prototype.Multiply = function(g) { return this.$val.Multiply(g); }; - extFloat.ptr.prototype.AssignDecimal = function(mantissa, exp10, neg, trunc, flt) { - var $ptr, _q, _r, adjExp, denormalExp, errors$1, exp10, extrabits, f, flt, halfway, i, mant_extra, mantissa, neg, ok, shift, trunc, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y; - ok = false; - f = this; - errors$1 = 0; - if (trunc) { - errors$1 = errors$1 + (4) >> 0; - } - f.mant = mantissa; - f.exp = 0; - f.neg = neg; - i = (_q = ((exp10 - -348 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - if (exp10 < -348 || i >= 87) { - ok = false; - return ok; - } - adjExp = (_r = ((exp10 - -348 >> 0)) % 8, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); - if (adjExp < 19 && (x = (x$1 = 19 - adjExp >> 0, ((x$1 < 0 || x$1 >= uint64pow10.length) ? $throwRuntimeError("index out of range") : uint64pow10[x$1])), (mantissa.$high < x.$high || (mantissa.$high === x.$high && mantissa.$low < x.$low)))) { - f.mant = $mul64(f.mant, (((adjExp < 0 || adjExp >= uint64pow10.length) ? $throwRuntimeError("index out of range") : uint64pow10[adjExp]))); - f.Normalize(); - } else { - f.Normalize(); - f.Multiply(((adjExp < 0 || adjExp >= smallPowersOfTen.length) ? $throwRuntimeError("index out of range") : smallPowersOfTen[adjExp])); - errors$1 = errors$1 + (4) >> 0; - } - f.Multiply(((i < 0 || i >= powersOfTen.length) ? $throwRuntimeError("index out of range") : powersOfTen[i])); - if (errors$1 > 0) { - errors$1 = errors$1 + (1) >> 0; - } - errors$1 = errors$1 + (4) >> 0; - shift = f.Normalize(); - errors$1 = (y = (shift), y < 32 ? (errors$1 << y) : 0) >> 0; - denormalExp = flt.bias - 63 >> 0; - extrabits = 0; - if (f.exp <= denormalExp) { - extrabits = (((63 - flt.mantbits >>> 0) + 1 >>> 0) + ((denormalExp - f.exp >> 0) >>> 0) >>> 0); - } else { - extrabits = (63 - flt.mantbits >>> 0); - } - halfway = $shiftLeft64(new $Uint64(0, 1), ((extrabits - 1 >>> 0))); - mant_extra = (x$2 = f.mant, x$3 = (x$4 = $shiftLeft64(new $Uint64(0, 1), extrabits), new $Uint64(x$4.$high - 0, x$4.$low - 1)), new $Uint64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)); - if ((x$5 = (x$6 = new $Int64(halfway.$high, halfway.$low), x$7 = new $Int64(0, errors$1), new $Int64(x$6.$high - x$7.$high, x$6.$low - x$7.$low)), x$8 = new $Int64(mant_extra.$high, mant_extra.$low), (x$5.$high < x$8.$high || (x$5.$high === x$8.$high && x$5.$low < x$8.$low))) && (x$9 = new $Int64(mant_extra.$high, mant_extra.$low), x$10 = (x$11 = new $Int64(halfway.$high, halfway.$low), x$12 = new $Int64(0, errors$1), new $Int64(x$11.$high + x$12.$high, x$11.$low + x$12.$low)), (x$9.$high < x$10.$high || (x$9.$high === x$10.$high && x$9.$low < x$10.$low)))) { - ok = false; - return ok; - } - ok = true; - return ok; - }; - extFloat.prototype.AssignDecimal = function(mantissa, exp10, neg, trunc, flt) { return this.$val.AssignDecimal(mantissa, exp10, neg, trunc, flt); }; - extFloat.ptr.prototype.frexp10 = function() { - var $ptr, _q, _q$1, _tmp, _tmp$1, approxExp10, exp, exp10, f, i, index; - exp10 = 0; - index = 0; - f = this; - approxExp10 = (_q = ($imul(((-46 - f.exp >> 0)), 28)) / 93, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - i = (_q$1 = ((approxExp10 - -348 >> 0)) / 8, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); - Loop: - while (true) { - exp = (f.exp + ((i < 0 || i >= powersOfTen.length) ? $throwRuntimeError("index out of range") : powersOfTen[i]).exp >> 0) + 64 >> 0; - if (exp < -60) { - i = i + (1) >> 0; - } else if (exp > -32) { - i = i - (1) >> 0; - } else { - break Loop; - } - } - f.Multiply(((i < 0 || i >= powersOfTen.length) ? $throwRuntimeError("index out of range") : powersOfTen[i])); - _tmp = -((-348 + ($imul(i, 8)) >> 0)); - _tmp$1 = i; - exp10 = _tmp; - index = _tmp$1; - return [exp10, index]; - }; - extFloat.prototype.frexp10 = function() { return this.$val.frexp10(); }; - frexp10Many = function(a, b, c) { - var $ptr, _tuple, a, b, c, exp10, i; - exp10 = 0; - _tuple = c.frexp10(); - exp10 = _tuple[0]; - i = _tuple[1]; - a.Multiply(((i < 0 || i >= powersOfTen.length) ? $throwRuntimeError("index out of range") : powersOfTen[i])); - b.Multiply(((i < 0 || i >= powersOfTen.length) ? $throwRuntimeError("index out of range") : powersOfTen[i])); - return exp10; - }; - extFloat.ptr.prototype.FixedDecimal = function(d, n) { - var $CE$B5, $ptr, _q, _q$1, _tmp, _tmp$1, _tuple, buf, d, digit, exp10, f, fraction, i, i$1, i$2, integer, integerDigits, n, nd, needed, ok, pos, pow, pow10, rest, shift, v, v1, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - f = this; - if ((x = f.mant, (x.$high === 0 && x.$low === 0))) { - d.nd = 0; - d.dp = 0; - d.neg = f.neg; - return true; - } - if (n === 0) { - $panic(new $String("strconv: internal error: extFloat.FixedDecimal called with n == 0")); - } - f.Normalize(); - _tuple = f.frexp10(); - exp10 = _tuple[0]; - shift = (-f.exp >>> 0); - integer = ($shiftRightUint64(f.mant, shift).$low >>> 0); - fraction = (x$1 = f.mant, x$2 = $shiftLeft64(new $Uint64(0, integer), shift), new $Uint64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)); - $CE$B5 = new $Uint64(0, 1); - needed = n; - integerDigits = 0; - pow10 = new $Uint64(0, 1); - _tmp = 0; - _tmp$1 = new $Uint64(0, 1); - i = _tmp; - pow = _tmp$1; - while (true) { - if (!(i < 20)) { break; } - if ((x$3 = new $Uint64(0, integer), (pow.$high > x$3.$high || (pow.$high === x$3.$high && pow.$low > x$3.$low)))) { - integerDigits = i; - break; - } - pow = $mul64(pow, (new $Uint64(0, 10))); - i = i + (1) >> 0; - } - rest = integer; - if (integerDigits > needed) { - pow10 = (x$4 = integerDigits - needed >> 0, ((x$4 < 0 || x$4 >= uint64pow10.length) ? $throwRuntimeError("index out of range") : uint64pow10[x$4])); - integer = (_q = integer / ((pow10.$low >>> 0)), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - rest = rest - (($imul(integer, (pow10.$low >>> 0)) >>> 0)) >>> 0; - } else { - rest = 0; - } - buf = arrayType$2.zero(); - pos = 32; - v = integer; - while (true) { - if (!(v > 0)) { break; } - v1 = (_q$1 = v / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); - v = v - (($imul(10, v1) >>> 0)) >>> 0; - pos = pos - (1) >> 0; - ((pos < 0 || pos >= buf.length) ? $throwRuntimeError("index out of range") : buf[pos] = ((v + 48 >>> 0) << 24 >>> 24)); - v = v1; - } - i$1 = pos; - while (true) { - if (!(i$1 < 32)) { break; } - (x$5 = d.d, x$6 = i$1 - pos >> 0, ((x$6 < 0 || x$6 >= x$5.$length) ? $throwRuntimeError("index out of range") : x$5.$array[x$5.$offset + x$6] = ((i$1 < 0 || i$1 >= buf.length) ? $throwRuntimeError("index out of range") : buf[i$1]))); - i$1 = i$1 + (1) >> 0; - } - nd = 32 - pos >> 0; - d.nd = nd; - d.dp = integerDigits + exp10 >> 0; - needed = needed - (nd) >> 0; - if (needed > 0) { - if (!((rest === 0)) || !((pow10.$high === 0 && pow10.$low === 1))) { - $panic(new $String("strconv: internal error, rest != 0 but needed > 0")); - } - while (true) { - if (!(needed > 0)) { break; } - fraction = $mul64(fraction, (new $Uint64(0, 10))); - $CE$B5 = $mul64($CE$B5, (new $Uint64(0, 10))); - if ((x$7 = $mul64(new $Uint64(0, 2), $CE$B5), x$8 = $shiftLeft64(new $Uint64(0, 1), shift), (x$7.$high > x$8.$high || (x$7.$high === x$8.$high && x$7.$low > x$8.$low)))) { - return false; - } - digit = $shiftRightUint64(fraction, shift); - (x$9 = d.d, ((nd < 0 || nd >= x$9.$length) ? $throwRuntimeError("index out of range") : x$9.$array[x$9.$offset + nd] = (new $Uint64(digit.$high + 0, digit.$low + 48).$low << 24 >>> 24))); - fraction = (x$10 = $shiftLeft64(digit, shift), new $Uint64(fraction.$high - x$10.$high, fraction.$low - x$10.$low)); - nd = nd + (1) >> 0; - needed = needed - (1) >> 0; - } - d.nd = nd; - } - ok = adjustLastDigitFixed(d, (x$11 = $shiftLeft64(new $Uint64(0, rest), shift), new $Uint64(x$11.$high | fraction.$high, (x$11.$low | fraction.$low) >>> 0)), pow10, shift, $CE$B5); - if (!ok) { - return false; - } - i$2 = d.nd - 1 >> 0; - while (true) { - if (!(i$2 >= 0)) { break; } - if (!(((x$12 = d.d, ((i$2 < 0 || i$2 >= x$12.$length) ? $throwRuntimeError("index out of range") : x$12.$array[x$12.$offset + i$2])) === 48))) { - d.nd = i$2 + 1 >> 0; - break; - } - i$2 = i$2 - (1) >> 0; - } - return true; - }; - extFloat.prototype.FixedDecimal = function(d, n) { return this.$val.FixedDecimal(d, n); }; - adjustLastDigitFixed = function(d, num, den, shift, $CE$B5) { - var $CE$B5, $ptr, d, den, i, num, shift, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - if ((x = $shiftLeft64(den, shift), (num.$high > x.$high || (num.$high === x.$high && num.$low > x.$low)))) { - $panic(new $String("strconv: num > den< x$2.$high || (x$1.$high === x$2.$high && x$1.$low > x$2.$low)))) { - $panic(new $String("strconv: \xCE\xB5 > (den< x$6.$high || (x$5.$high === x$6.$high && x$5.$low > x$6.$low)))) { - i = d.nd - 1 >> 0; - while (true) { - if (!(i >= 0)) { break; } - if ((x$7 = d.d, ((i < 0 || i >= x$7.$length) ? $throwRuntimeError("index out of range") : x$7.$array[x$7.$offset + i])) === 57) { - d.nd = d.nd - (1) >> 0; - } else { - break; - } - i = i - (1) >> 0; - } - if (i < 0) { - (x$8 = d.d, (0 >= x$8.$length ? $throwRuntimeError("index out of range") : x$8.$array[x$8.$offset + 0] = 49)); - d.nd = 1; - d.dp = d.dp + (1) >> 0; - } else { - (x$10 = d.d, ((i < 0 || i >= x$10.$length) ? $throwRuntimeError("index out of range") : x$10.$array[x$10.$offset + i] = ((x$9 = d.d, ((i < 0 || i >= x$9.$length) ? $throwRuntimeError("index out of range") : x$9.$array[x$9.$offset + i])) + (1) << 24 >>> 24))); - } - return true; - } - return false; - }; - extFloat.ptr.prototype.ShortestDecimal = function(d, lower, upper) { - var $ptr, _q, _tmp, _tmp$1, _tmp$2, _tmp$3, allowance, buf, currentDiff, d, digit, digit$1, exp10, f, fraction, i, i$1, i$2, integer, integerDigits, lower, multiplier, n, nd, pow, pow$1, shift, targetDiff, upper, v, v1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$22, x$23, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - f = this; - if ((x = f.mant, (x.$high === 0 && x.$low === 0))) { - d.nd = 0; - d.dp = 0; - d.neg = f.neg; - return true; - } - if ((f.exp === 0) && $equal(lower, f, extFloat) && $equal(lower, upper, extFloat)) { - buf = arrayType$1.zero(); - n = 23; - v = f.mant; - while (true) { - if (!((v.$high > 0 || (v.$high === 0 && v.$low > 0)))) { break; } - v1 = $div64(v, new $Uint64(0, 10), false); - v = (x$1 = $mul64(new $Uint64(0, 10), v1), new $Uint64(v.$high - x$1.$high, v.$low - x$1.$low)); - ((n < 0 || n >= buf.length) ? $throwRuntimeError("index out of range") : buf[n] = (new $Uint64(v.$high + 0, v.$low + 48).$low << 24 >>> 24)); - n = n - (1) >> 0; - v = v1; - } - nd = (24 - n >> 0) - 1 >> 0; - i = 0; - while (true) { - if (!(i < nd)) { break; } - (x$3 = d.d, ((i < 0 || i >= x$3.$length) ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + i] = (x$2 = (n + 1 >> 0) + i >> 0, ((x$2 < 0 || x$2 >= buf.length) ? $throwRuntimeError("index out of range") : buf[x$2])))); - i = i + (1) >> 0; - } - _tmp = nd; - _tmp$1 = nd; - d.nd = _tmp; - d.dp = _tmp$1; - while (true) { - if (!(d.nd > 0 && ((x$4 = d.d, x$5 = d.nd - 1 >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + x$5])) === 48))) { break; } - d.nd = d.nd - (1) >> 0; - } - if (d.nd === 0) { - d.dp = 0; - } - d.neg = f.neg; - return true; - } - upper.Normalize(); - if (f.exp > upper.exp) { - f.mant = $shiftLeft64(f.mant, (((f.exp - upper.exp >> 0) >>> 0))); - f.exp = upper.exp; - } - if (lower.exp > upper.exp) { - lower.mant = $shiftLeft64(lower.mant, (((lower.exp - upper.exp >> 0) >>> 0))); - lower.exp = upper.exp; - } - exp10 = frexp10Many(lower, f, upper); - upper.mant = (x$6 = upper.mant, x$7 = new $Uint64(0, 1), new $Uint64(x$6.$high + x$7.$high, x$6.$low + x$7.$low)); - lower.mant = (x$8 = lower.mant, x$9 = new $Uint64(0, 1), new $Uint64(x$8.$high - x$9.$high, x$8.$low - x$9.$low)); - shift = (-upper.exp >>> 0); - integer = ($shiftRightUint64(upper.mant, shift).$low >>> 0); - fraction = (x$10 = upper.mant, x$11 = $shiftLeft64(new $Uint64(0, integer), shift), new $Uint64(x$10.$high - x$11.$high, x$10.$low - x$11.$low)); - allowance = (x$12 = upper.mant, x$13 = lower.mant, new $Uint64(x$12.$high - x$13.$high, x$12.$low - x$13.$low)); - targetDiff = (x$14 = upper.mant, x$15 = f.mant, new $Uint64(x$14.$high - x$15.$high, x$14.$low - x$15.$low)); - integerDigits = 0; - _tmp$2 = 0; - _tmp$3 = new $Uint64(0, 1); - i$1 = _tmp$2; - pow = _tmp$3; - while (true) { - if (!(i$1 < 20)) { break; } - if ((x$16 = new $Uint64(0, integer), (pow.$high > x$16.$high || (pow.$high === x$16.$high && pow.$low > x$16.$low)))) { - integerDigits = i$1; - break; - } - pow = $mul64(pow, (new $Uint64(0, 10))); - i$1 = i$1 + (1) >> 0; - } - i$2 = 0; - while (true) { - if (!(i$2 < integerDigits)) { break; } - pow$1 = (x$17 = (integerDigits - i$2 >> 0) - 1 >> 0, ((x$17 < 0 || x$17 >= uint64pow10.length) ? $throwRuntimeError("index out of range") : uint64pow10[x$17])); - digit = (_q = integer / (pow$1.$low >>> 0), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - (x$18 = d.d, ((i$2 < 0 || i$2 >= x$18.$length) ? $throwRuntimeError("index out of range") : x$18.$array[x$18.$offset + i$2] = ((digit + 48 >>> 0) << 24 >>> 24))); - integer = integer - (($imul(digit, (pow$1.$low >>> 0)) >>> 0)) >>> 0; - currentDiff = (x$19 = $shiftLeft64(new $Uint64(0, integer), shift), new $Uint64(x$19.$high + fraction.$high, x$19.$low + fraction.$low)); - if ((currentDiff.$high < allowance.$high || (currentDiff.$high === allowance.$high && currentDiff.$low < allowance.$low))) { - d.nd = i$2 + 1 >> 0; - d.dp = integerDigits + exp10 >> 0; - d.neg = f.neg; - return adjustLastDigit(d, currentDiff, targetDiff, allowance, $shiftLeft64(pow$1, shift), new $Uint64(0, 2)); - } - i$2 = i$2 + (1) >> 0; - } - d.nd = integerDigits; - d.dp = d.nd + exp10 >> 0; - d.neg = f.neg; - digit$1 = 0; - multiplier = new $Uint64(0, 1); - while (true) { - fraction = $mul64(fraction, (new $Uint64(0, 10))); - multiplier = $mul64(multiplier, (new $Uint64(0, 10))); - digit$1 = ($shiftRightUint64(fraction, shift).$low >> 0); - (x$20 = d.d, x$21 = d.nd, ((x$21 < 0 || x$21 >= x$20.$length) ? $throwRuntimeError("index out of range") : x$20.$array[x$20.$offset + x$21] = ((digit$1 + 48 >> 0) << 24 >>> 24))); - d.nd = d.nd + (1) >> 0; - fraction = (x$22 = $shiftLeft64(new $Uint64(0, digit$1), shift), new $Uint64(fraction.$high - x$22.$high, fraction.$low - x$22.$low)); - if ((x$23 = $mul64(allowance, multiplier), (fraction.$high < x$23.$high || (fraction.$high === x$23.$high && fraction.$low < x$23.$low)))) { - return adjustLastDigit(d, fraction, $mul64(targetDiff, multiplier), $mul64(allowance, multiplier), $shiftLeft64(new $Uint64(0, 1), shift), $mul64(multiplier, new $Uint64(0, 2))); - } - } - }; - extFloat.prototype.ShortestDecimal = function(d, lower, upper) { return this.$val.ShortestDecimal(d, lower, upper); }; - adjustLastDigit = function(d, currentDiff, targetDiff, maxDiff, ulpDecimal, ulpBinary) { - var $ptr, _index, currentDiff, d, maxDiff, targetDiff, ulpBinary, ulpDecimal, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - if ((x = $mul64(new $Uint64(0, 2), ulpBinary), (ulpDecimal.$high < x.$high || (ulpDecimal.$high === x.$high && ulpDecimal.$low < x.$low)))) { - return false; - } - while (true) { - if (!((x$1 = (x$2 = (x$3 = $div64(ulpDecimal, new $Uint64(0, 2), false), new $Uint64(currentDiff.$high + x$3.$high, currentDiff.$low + x$3.$low)), new $Uint64(x$2.$high + ulpBinary.$high, x$2.$low + ulpBinary.$low)), (x$1.$high < targetDiff.$high || (x$1.$high === targetDiff.$high && x$1.$low < targetDiff.$low))))) { break; } - _index = d.nd - 1 >> 0; - (x$5 = d.d, ((_index < 0 || _index >= x$5.$length) ? $throwRuntimeError("index out of range") : x$5.$array[x$5.$offset + _index] = ((x$4 = d.d, ((_index < 0 || _index >= x$4.$length) ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + _index])) - (1) << 24 >>> 24))); - currentDiff = (x$6 = ulpDecimal, new $Uint64(currentDiff.$high + x$6.$high, currentDiff.$low + x$6.$low)); - } - if ((x$7 = new $Uint64(currentDiff.$high + ulpDecimal.$high, currentDiff.$low + ulpDecimal.$low), x$8 = (x$9 = (x$10 = $div64(ulpDecimal, new $Uint64(0, 2), false), new $Uint64(targetDiff.$high + x$10.$high, targetDiff.$low + x$10.$low)), new $Uint64(x$9.$high + ulpBinary.$high, x$9.$low + ulpBinary.$low)), (x$7.$high < x$8.$high || (x$7.$high === x$8.$high && x$7.$low <= x$8.$low)))) { - return false; - } - if ((currentDiff.$high < ulpBinary.$high || (currentDiff.$high === ulpBinary.$high && currentDiff.$low < ulpBinary.$low)) || (x$11 = new $Uint64(maxDiff.$high - ulpBinary.$high, maxDiff.$low - ulpBinary.$low), (currentDiff.$high > x$11.$high || (currentDiff.$high === x$11.$high && currentDiff.$low > x$11.$low)))) { - return false; - } - if ((d.nd === 1) && ((x$12 = d.d, (0 >= x$12.$length ? $throwRuntimeError("index out of range") : x$12.$array[x$12.$offset + 0])) === 48)) { - d.nd = 0; - d.dp = 0; - } - return true; - }; - FormatFloat = function(f, fmt, prec, bitSize) { - var $ptr, bitSize, f, fmt, prec; - return $bytesToString(genericFtoa($makeSlice(sliceType$6, 0, max(prec + 4 >> 0, 24)), f, fmt, prec, bitSize)); - }; - $pkg.FormatFloat = FormatFloat; - AppendFloat = function(dst, f, fmt, prec, bitSize) { - var $ptr, bitSize, dst, f, fmt, prec; - return genericFtoa(dst, f, fmt, prec, bitSize); - }; - $pkg.AppendFloat = AppendFloat; - genericFtoa = function(dst, val, fmt, prec, bitSize) { - var $ptr, _1, _2, _3, _4, _tuple, bitSize, bits, buf, buf$1, digits, digs, dst, exp, f, f$1, flt, fmt, lower, mant, neg, ok, prec, s, shortest, upper, val, x, x$1, x$2, x$3, y, y$1; - bits = new $Uint64(0, 0); - flt = ptrType$1.nil; - _1 = bitSize; - if (_1 === (32)) { - bits = new $Uint64(0, math.Float32bits($fround(val))); - flt = float32info; - } else if (_1 === (64)) { - bits = math.Float64bits(val); - flt = float64info; - } else { - $panic(new $String("strconv: illegal AppendFloat/FormatFloat bitSize")); - } - neg = !((x = $shiftRightUint64(bits, ((flt.expbits + flt.mantbits >>> 0))), (x.$high === 0 && x.$low === 0))); - exp = ($shiftRightUint64(bits, flt.mantbits).$low >> 0) & ((((y = flt.expbits, y < 32 ? (1 << y) : 0) >> 0) - 1 >> 0)); - mant = (x$1 = (x$2 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(x$2.$high - 0, x$2.$low - 1)), new $Uint64(bits.$high & x$1.$high, (bits.$low & x$1.$low) >>> 0)); - _2 = exp; - if (_2 === ((((y$1 = flt.expbits, y$1 < 32 ? (1 << y$1) : 0) >> 0) - 1 >> 0))) { - s = ""; - if (!((mant.$high === 0 && mant.$low === 0))) { - s = "NaN"; - } else if (neg) { - s = "-Inf"; - } else { - s = "+Inf"; - } - return $appendSlice(dst, s); - } else if (_2 === (0)) { - exp = exp + (1) >> 0; - } else { - mant = (x$3 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), new $Uint64(mant.$high | x$3.$high, (mant.$low | x$3.$low) >>> 0)); - } - exp = exp + (flt.bias) >> 0; - if (fmt === 98) { - return fmtB(dst, neg, mant, exp, flt); - } - if (!optimize) { - return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); - } - digs = new decimalSlice.ptr(sliceType$6.nil, 0, 0, false); - ok = false; - shortest = prec < 0; - if (shortest) { - f = new extFloat.ptr(new $Uint64(0, 0), 0, false); - _tuple = f.AssignComputeBounds(mant, exp, neg, flt); - lower = $clone(_tuple[0], extFloat); - upper = $clone(_tuple[1], extFloat); - buf = arrayType$2.zero(); - digs.d = new sliceType$6(buf); - ok = f.ShortestDecimal(digs, lower, upper); - if (!ok) { - return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); - } - _3 = fmt; - if ((_3 === (101)) || (_3 === (69))) { - prec = max(digs.nd - 1 >> 0, 0); - } else if (_3 === (102)) { - prec = max(digs.nd - digs.dp >> 0, 0); - } else if ((_3 === (103)) || (_3 === (71))) { - prec = digs.nd; - } - } else if (!((fmt === 102))) { - digits = prec; - _4 = fmt; - if ((_4 === (101)) || (_4 === (69))) { - digits = digits + (1) >> 0; - } else if ((_4 === (103)) || (_4 === (71))) { - if (prec === 0) { - prec = 1; - } - digits = prec; - } - if (digits <= 15) { - buf$1 = arrayType$1.zero(); - digs.d = new sliceType$6(buf$1); - f$1 = new extFloat.ptr(mant, exp - (flt.mantbits >> 0) >> 0, neg); - ok = f$1.FixedDecimal(digs, digits); - } - } - if (!ok) { - return bigFtoa(dst, prec, fmt, neg, mant, exp, flt); - } - return formatDigits(dst, shortest, neg, digs, prec, fmt); - }; - bigFtoa = function(dst, prec, fmt, neg, mant, exp, flt) { - var $ptr, _5, _6, d, digs, dst, exp, flt, fmt, mant, neg, prec, shortest; - d = new decimal.ptr(arrayType.zero(), 0, 0, false, false); - d.Assign(mant); - d.Shift(exp - (flt.mantbits >> 0) >> 0); - digs = new decimalSlice.ptr(sliceType$6.nil, 0, 0, false); - shortest = prec < 0; - if (shortest) { - roundShortest(d, mant, exp, flt); - decimalSlice.copy(digs, new decimalSlice.ptr(new sliceType$6(d.d), d.nd, d.dp, false)); - _5 = fmt; - if ((_5 === (101)) || (_5 === (69))) { - prec = digs.nd - 1 >> 0; - } else if (_5 === (102)) { - prec = max(digs.nd - digs.dp >> 0, 0); - } else if ((_5 === (103)) || (_5 === (71))) { - prec = digs.nd; - } - } else { - _6 = fmt; - if ((_6 === (101)) || (_6 === (69))) { - d.Round(prec + 1 >> 0); - } else if (_6 === (102)) { - d.Round(d.dp + prec >> 0); - } else if ((_6 === (103)) || (_6 === (71))) { - if (prec === 0) { - prec = 1; - } - d.Round(prec); - } - decimalSlice.copy(digs, new decimalSlice.ptr(new sliceType$6(d.d), d.nd, d.dp, false)); - } - return formatDigits(dst, shortest, neg, digs, prec, fmt); - }; - formatDigits = function(dst, shortest, neg, digs, prec, fmt) { - var $ptr, _7, digs, dst, eprec, exp, fmt, neg, prec, shortest; - digs = $clone(digs, decimalSlice); - _7 = fmt; - if ((_7 === (101)) || (_7 === (69))) { - return fmtE(dst, neg, digs, prec, fmt); - } else if (_7 === (102)) { - return fmtF(dst, neg, digs, prec); - } else if ((_7 === (103)) || (_7 === (71))) { - eprec = prec; - if (eprec > digs.nd && digs.nd >= digs.dp) { - eprec = digs.nd; - } - if (shortest) { - eprec = 6; - } - exp = digs.dp - 1 >> 0; - if (exp < -4 || exp >= eprec) { - if (prec > digs.nd) { - prec = digs.nd; - } - return fmtE(dst, neg, digs, prec - 1 >> 0, (fmt + 101 << 24 >>> 24) - 103 << 24 >>> 24); - } - if (prec > digs.dp) { - prec = digs.nd; - } - return fmtF(dst, neg, digs, max(prec - digs.dp >> 0, 0)); - } - return $append(dst, 37, fmt); - }; - roundShortest = function(d, mant, exp, flt) { - var $ptr, d, exp, explo, flt, i, inclusive, l, lower, m, mant, mantlo, minexp, okdown, okup, u, upper, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; - if ((mant.$high === 0 && mant.$low === 0)) { - d.nd = 0; - return; - } - minexp = flt.bias + 1 >> 0; - if (exp > minexp && ($imul(332, ((d.dp - d.nd >> 0)))) >= ($imul(100, ((exp - (flt.mantbits >> 0) >> 0))))) { - return; - } - upper = new decimal.ptr(arrayType.zero(), 0, 0, false, false); - upper.Assign((x = $mul64(mant, new $Uint64(0, 2)), new $Uint64(x.$high + 0, x.$low + 1))); - upper.Shift((exp - (flt.mantbits >> 0) >> 0) - 1 >> 0); - mantlo = new $Uint64(0, 0); - explo = 0; - if ((x$1 = $shiftLeft64(new $Uint64(0, 1), flt.mantbits), (mant.$high > x$1.$high || (mant.$high === x$1.$high && mant.$low > x$1.$low))) || (exp === minexp)) { - mantlo = new $Uint64(mant.$high - 0, mant.$low - 1); - explo = exp; - } else { - mantlo = (x$2 = $mul64(mant, new $Uint64(0, 2)), new $Uint64(x$2.$high - 0, x$2.$low - 1)); - explo = exp - 1 >> 0; - } - lower = new decimal.ptr(arrayType.zero(), 0, 0, false, false); - lower.Assign((x$3 = $mul64(mantlo, new $Uint64(0, 2)), new $Uint64(x$3.$high + 0, x$3.$low + 1))); - lower.Shift((explo - (flt.mantbits >> 0) >> 0) - 1 >> 0); - inclusive = (x$4 = $div64(mant, new $Uint64(0, 2), true), (x$4.$high === 0 && x$4.$low === 0)); - i = 0; - while (true) { - if (!(i < d.nd)) { break; } - l = 48; - if (i < lower.nd) { - l = (x$5 = lower.d, ((i < 0 || i >= x$5.length) ? $throwRuntimeError("index out of range") : x$5[i])); - } - m = (x$6 = d.d, ((i < 0 || i >= x$6.length) ? $throwRuntimeError("index out of range") : x$6[i])); - u = 48; - if (i < upper.nd) { - u = (x$7 = upper.d, ((i < 0 || i >= x$7.length) ? $throwRuntimeError("index out of range") : x$7[i])); - } - okdown = !((l === m)) || inclusive && ((i + 1 >> 0) === lower.nd); - okup = !((m === u)) && (inclusive || (m + 1 << 24 >>> 24) < u || (i + 1 >> 0) < upper.nd); - if (okdown && okup) { - d.Round(i + 1 >> 0); - return; - } else if (okdown) { - d.RoundDown(i + 1 >> 0); - return; - } else if (okup) { - d.RoundUp(i + 1 >> 0); - return; - } - i = i + (1) >> 0; - } - }; - fmtE = function(dst, neg, d, prec, fmt) { - var $ptr, _q, _q$1, _q$2, _r, _r$1, _r$2, ch, d, dst, exp, fmt, i, m, neg, prec, x; - d = $clone(d, decimalSlice); - if (neg) { - dst = $append(dst, 45); - } - ch = 48; - if (!((d.nd === 0))) { - ch = (x = d.d, (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0])); - } - dst = $append(dst, ch); - if (prec > 0) { - dst = $append(dst, 46); - i = 1; - m = min(d.nd, prec + 1 >> 0); - if (i < m) { - dst = $appendSlice(dst, $subslice(d.d, i, m)); - i = m; - } - while (true) { - if (!(i <= prec)) { break; } - dst = $append(dst, 48); - i = i + (1) >> 0; - } - } - dst = $append(dst, fmt); - exp = d.dp - 1 >> 0; - if (d.nd === 0) { - exp = 0; - } - if (exp < 0) { - ch = 45; - exp = -exp; - } else { - ch = 43; - } - dst = $append(dst, ch); - if (exp < 10) { - dst = $append(dst, 48, (exp << 24 >>> 24) + 48 << 24 >>> 24); - } else if (exp < 100) { - dst = $append(dst, ((_q = exp / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24) + 48 << 24 >>> 24, ((_r = exp % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) << 24 >>> 24) + 48 << 24 >>> 24); - } else { - dst = $append(dst, ((_q$1 = exp / 100, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24) + 48 << 24 >>> 24, (_r$1 = ((_q$2 = exp / 10, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24) % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) + 48 << 24 >>> 24, ((_r$2 = exp % 10, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24) + 48 << 24 >>> 24); - } - return dst; - }; - fmtF = function(dst, neg, d, prec) { - var $ptr, ch, d, dst, i, j, m, neg, prec, x; - d = $clone(d, decimalSlice); - if (neg) { - dst = $append(dst, 45); - } - if (d.dp > 0) { - m = min(d.nd, d.dp); - dst = $appendSlice(dst, $subslice(d.d, 0, m)); - while (true) { - if (!(m < d.dp)) { break; } - dst = $append(dst, 48); - m = m + (1) >> 0; - } - } else { - dst = $append(dst, 48); - } - if (prec > 0) { - dst = $append(dst, 46); - i = 0; - while (true) { - if (!(i < prec)) { break; } - ch = 48; - j = d.dp + i >> 0; - if (0 <= j && j < d.nd) { - ch = (x = d.d, ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j])); - } - dst = $append(dst, ch); - i = i + (1) >> 0; - } - } - return dst; - }; - fmtB = function(dst, neg, mant, exp, flt) { - var $ptr, _tuple, _tuple$1, dst, exp, flt, mant, neg; - if (neg) { - dst = $append(dst, 45); - } - _tuple = formatBits(dst, mant, 10, false, true); - dst = _tuple[0]; - dst = $append(dst, 112); - exp = exp - ((flt.mantbits >> 0)) >> 0; - if (exp >= 0) { - dst = $append(dst, 43); - } - _tuple$1 = formatBits(dst, new $Uint64(0, exp), 10, exp < 0, true); - dst = _tuple$1[0]; - return dst; - }; - min = function(a, b) { - var $ptr, a, b; - if (a < b) { - return a; - } - return b; - }; - max = function(a, b) { - var $ptr, a, b; - if (a > b) { - return a; - } - return b; - }; - FormatInt = function(i, base) { - var $ptr, _tuple, base, i, s; - _tuple = formatBits(sliceType$6.nil, new $Uint64(i.$high, i.$low), base, (i.$high < 0 || (i.$high === 0 && i.$low < 0)), false); - s = _tuple[1]; - return s; - }; - $pkg.FormatInt = FormatInt; - Itoa = function(i) { - var $ptr, i; - return FormatInt(new $Int64(0, i), 10); - }; - $pkg.Itoa = Itoa; - AppendInt = function(dst, i, base) { - var $ptr, _tuple, base, dst, i; - _tuple = formatBits(dst, new $Uint64(i.$high, i.$low), base, (i.$high < 0 || (i.$high === 0 && i.$low < 0)), true); - dst = _tuple[0]; - return dst; - }; - $pkg.AppendInt = AppendInt; - AppendUint = function(dst, i, base) { - var $ptr, _tuple, base, dst, i; - _tuple = formatBits(dst, i, base, false, true); - dst = _tuple[0]; - return dst; - }; - $pkg.AppendUint = AppendUint; - formatBits = function(dst, u, base, neg, append_) { - var $ptr, _q, _q$1, a, append_, b, b$1, base, d, dst, i, j, m, neg, q, q$1, q$2, qs, s, s$1, u, us, us$1, x, x$1; - d = sliceType$6.nil; - s = ""; - if (base < 2 || base > 36) { - $panic(new $String("strconv: illegal AppendInt/FormatInt base")); - } - a = arrayType$3.zero(); - i = 65; - if (neg) { - u = new $Uint64(-u.$high, -u.$low); - } - if (base === 10) { - if (true) { - while (true) { - if (!((u.$high > 0 || (u.$high === 0 && u.$low > 4294967295)))) { break; } - q = $div64(u, new $Uint64(0, 1000000000), false); - us = ((x = $mul64(q, new $Uint64(0, 1000000000)), new $Uint64(u.$high - x.$high, u.$low - x.$low)).$low >>> 0); - j = 9; - while (true) { - if (!(j > 0)) { break; } - i = i - (1) >> 0; - qs = (_q = us / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = (((us - ($imul(qs, 10) >>> 0) >>> 0) + 48 >>> 0) << 24 >>> 24)); - us = qs; - j = j - (1) >> 0; - } - u = q; - } - } - us$1 = (u.$low >>> 0); - while (true) { - if (!(us$1 >= 10)) { break; } - i = i - (1) >> 0; - q$1 = (_q$1 = us$1 / 10, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); - ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = (((us$1 - ($imul(q$1, 10) >>> 0) >>> 0) + 48 >>> 0) << 24 >>> 24)); - us$1 = q$1; - } - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = ((us$1 + 48 >>> 0) << 24 >>> 24)); - } else { - s$1 = ((base < 0 || base >= shifts.length) ? $throwRuntimeError("index out of range") : shifts[base]); - if (s$1 > 0) { - b = new $Uint64(0, base); - m = (b.$low >>> 0) - 1 >>> 0; - while (true) { - if (!((u.$high > b.$high || (u.$high === b.$high && u.$low >= b.$low)))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((((u.$low >>> 0) & m) >>> 0))); - u = $shiftRightUint64(u, (s$1)); - } - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((u.$low >>> 0))); - } else { - b$1 = new $Uint64(0, base); - while (true) { - if (!((u.$high > b$1.$high || (u.$high === b$1.$high && u.$low >= b$1.$low)))) { break; } - i = i - (1) >> 0; - q$2 = $div64(u, b$1, false); - ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((x$1 = $mul64(q$2, b$1), new $Uint64(u.$high - x$1.$high, u.$low - x$1.$low)).$low >>> 0))); - u = q$2; - } - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((u.$low >>> 0))); - } - } - if (neg) { - i = i - (1) >> 0; - ((i < 0 || i >= a.length) ? $throwRuntimeError("index out of range") : a[i] = 45); - } - if (append_) { - d = $appendSlice(dst, $subslice(new sliceType$6(a), i)); - return [d, s]; - } - s = $bytesToString($subslice(new sliceType$6(a), i)); - return [d, s]; - }; - quoteWith = function(s, quote, ASCIIonly, graphicOnly) { - var $ptr, ASCIIonly, _1, _q, _tuple, buf, graphicOnly, n, quote, r, runeTmp, s, s$1, s$2, width; - runeTmp = arrayType$4.zero(); - buf = $makeSlice(sliceType$6, 0, (_q = ($imul(3, s.length)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); - buf = $append(buf, quote); - width = 0; - while (true) { - if (!(s.length > 0)) { break; } - r = (s.charCodeAt(0) >> 0); - width = 1; - if (r >= 128) { - _tuple = utf8.DecodeRuneInString(s); - r = _tuple[0]; - width = _tuple[1]; - } - if ((width === 1) && (r === 65533)) { - buf = $appendSlice(buf, "\\x"); - buf = $append(buf, "0123456789abcdef".charCodeAt((s.charCodeAt(0) >>> 4 << 24 >>> 24))); - buf = $append(buf, "0123456789abcdef".charCodeAt(((s.charCodeAt(0) & 15) >>> 0))); - s = s.substring(width); - continue; - } - if ((r === (quote >> 0)) || (r === 92)) { - buf = $append(buf, 92); - buf = $append(buf, (r << 24 >>> 24)); - s = s.substring(width); - continue; - } - if (ASCIIonly) { - if (r < 128 && IsPrint(r)) { - buf = $append(buf, (r << 24 >>> 24)); - s = s.substring(width); - continue; - } - } else if (IsPrint(r) || graphicOnly && isInGraphicList(r)) { - n = utf8.EncodeRune(new sliceType$6(runeTmp), r); - buf = $appendSlice(buf, $subslice(new sliceType$6(runeTmp), 0, n)); - s = s.substring(width); - continue; - } - _1 = r; - if (_1 === (7)) { - buf = $appendSlice(buf, "\\a"); - } else if (_1 === (8)) { - buf = $appendSlice(buf, "\\b"); - } else if (_1 === (12)) { - buf = $appendSlice(buf, "\\f"); - } else if (_1 === (10)) { - buf = $appendSlice(buf, "\\n"); - } else if (_1 === (13)) { - buf = $appendSlice(buf, "\\r"); - } else if (_1 === (9)) { - buf = $appendSlice(buf, "\\t"); - } else if (_1 === (11)) { - buf = $appendSlice(buf, "\\v"); - } else { - if (r < 32) { - buf = $appendSlice(buf, "\\x"); - buf = $append(buf, "0123456789abcdef".charCodeAt((s.charCodeAt(0) >>> 4 << 24 >>> 24))); - buf = $append(buf, "0123456789abcdef".charCodeAt(((s.charCodeAt(0) & 15) >>> 0))); - } else if (r > 1114111) { - r = 65533; - buf = $appendSlice(buf, "\\u"); - s$1 = 12; - while (true) { - if (!(s$1 >= 0)) { break; } - buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min((s$1 >>> 0), 31)) >> 0) & 15))); - s$1 = s$1 - (4) >> 0; - } - } else if (r < 65536) { - buf = $appendSlice(buf, "\\u"); - s$1 = 12; - while (true) { - if (!(s$1 >= 0)) { break; } - buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min((s$1 >>> 0), 31)) >> 0) & 15))); - s$1 = s$1 - (4) >> 0; - } - } else { - buf = $appendSlice(buf, "\\U"); - s$2 = 28; - while (true) { - if (!(s$2 >= 0)) { break; } - buf = $append(buf, "0123456789abcdef".charCodeAt((((r >> $min((s$2 >>> 0), 31)) >> 0) & 15))); - s$2 = s$2 - (4) >> 0; - } - } - } - s = s.substring(width); - } - buf = $append(buf, quote); - return $bytesToString(buf); - }; - Quote = function(s) { - var $ptr, s; - return quoteWith(s, 34, false, false); - }; - $pkg.Quote = Quote; - QuoteToASCII = function(s) { - var $ptr, s; - return quoteWith(s, 34, true, false); - }; - $pkg.QuoteToASCII = QuoteToASCII; - QuoteRune = function(r) { - var $ptr, r; - return quoteWith($encodeRune(r), 39, false, false); - }; - $pkg.QuoteRune = QuoteRune; - AppendQuoteRune = function(dst, r) { - var $ptr, dst, r; - return $appendSlice(dst, QuoteRune(r)); - }; - $pkg.AppendQuoteRune = AppendQuoteRune; - QuoteRuneToASCII = function(r) { - var $ptr, r; - return quoteWith($encodeRune(r), 39, true, false); - }; - $pkg.QuoteRuneToASCII = QuoteRuneToASCII; - AppendQuoteRuneToASCII = function(dst, r) { - var $ptr, dst, r; - return $appendSlice(dst, QuoteRuneToASCII(r)); - }; - $pkg.AppendQuoteRuneToASCII = AppendQuoteRuneToASCII; - CanBackquote = function(s) { - var $ptr, _tuple, r, s, wid; - while (true) { - if (!(s.length > 0)) { break; } - _tuple = utf8.DecodeRuneInString(s); - r = _tuple[0]; - wid = _tuple[1]; - s = s.substring(wid); - if (wid > 1) { - if (r === 65279) { - return false; - } - continue; - } - if (r === 65533) { - return false; - } - if ((r < 32 && !((r === 9))) || (r === 96) || (r === 127)) { - return false; - } - } - return true; - }; - $pkg.CanBackquote = CanBackquote; - unhex = function(b) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, b, c, ok, v; - v = 0; - ok = false; - c = (b >> 0); - if (48 <= c && c <= 57) { - _tmp = c - 48 >> 0; - _tmp$1 = true; - v = _tmp; - ok = _tmp$1; - return [v, ok]; - } else if (97 <= c && c <= 102) { - _tmp$2 = (c - 97 >> 0) + 10 >> 0; - _tmp$3 = true; - v = _tmp$2; - ok = _tmp$3; - return [v, ok]; - } else if (65 <= c && c <= 70) { - _tmp$4 = (c - 65 >> 0) + 10 >> 0; - _tmp$5 = true; - v = _tmp$4; - ok = _tmp$5; - return [v, ok]; - } - return [v, ok]; - }; - UnquoteChar = function(s, quote) { - var $ptr, _2, _3, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, c, c$1, err, j, j$1, multibyte, n, ok, quote, r, s, size, tail, v, v$1, value, x, x$1; - value = 0; - multibyte = false; - tail = ""; - err = $ifaceNil; - c = s.charCodeAt(0); - if ((c === quote) && ((quote === 39) || (quote === 34))) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } else if (c >= 128) { - _tuple = utf8.DecodeRuneInString(s); - r = _tuple[0]; - size = _tuple[1]; - _tmp = r; - _tmp$1 = true; - _tmp$2 = s.substring(size); - _tmp$3 = $ifaceNil; - value = _tmp; - multibyte = _tmp$1; - tail = _tmp$2; - err = _tmp$3; - return [value, multibyte, tail, err]; - } else if (!((c === 92))) { - _tmp$4 = (s.charCodeAt(0) >> 0); - _tmp$5 = false; - _tmp$6 = s.substring(1); - _tmp$7 = $ifaceNil; - value = _tmp$4; - multibyte = _tmp$5; - tail = _tmp$6; - err = _tmp$7; - return [value, multibyte, tail, err]; - } - if (s.length <= 1) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - c$1 = s.charCodeAt(1); - s = s.substring(2); - switch (0) { default: - _2 = c$1; - if (_2 === (97)) { - value = 7; - } else if (_2 === (98)) { - value = 8; - } else if (_2 === (102)) { - value = 12; - } else if (_2 === (110)) { - value = 10; - } else if (_2 === (114)) { - value = 13; - } else if (_2 === (116)) { - value = 9; - } else if (_2 === (118)) { - value = 11; - } else if ((_2 === (120)) || (_2 === (117)) || (_2 === (85))) { - n = 0; - _3 = c$1; - if (_3 === (120)) { - n = 2; - } else if (_3 === (117)) { - n = 4; - } else if (_3 === (85)) { - n = 8; - } - v = 0; - if (s.length < n) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - j = 0; - while (true) { - if (!(j < n)) { break; } - _tuple$1 = unhex(s.charCodeAt(j)); - x = _tuple$1[0]; - ok = _tuple$1[1]; - if (!ok) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - v = (v << 4 >> 0) | x; - j = j + (1) >> 0; - } - s = s.substring(n); - if (c$1 === 120) { - value = v; - break; - } - if (v > 1114111) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - value = v; - multibyte = true; - } else if ((_2 === (48)) || (_2 === (49)) || (_2 === (50)) || (_2 === (51)) || (_2 === (52)) || (_2 === (53)) || (_2 === (54)) || (_2 === (55))) { - v$1 = (c$1 >> 0) - 48 >> 0; - if (s.length < 2) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - j$1 = 0; - while (true) { - if (!(j$1 < 2)) { break; } - x$1 = (s.charCodeAt(j$1) >> 0) - 48 >> 0; - if (x$1 < 0 || x$1 > 7) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - v$1 = ((v$1 << 3 >> 0)) | x$1; - j$1 = j$1 + (1) >> 0; - } - s = s.substring(2); - if (v$1 > 255) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - value = v$1; - } else if (_2 === (92)) { - value = 92; - } else if ((_2 === (39)) || (_2 === (34))) { - if (!((c$1 === quote))) { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - value = (c$1 >> 0); - } else { - err = $pkg.ErrSyntax; - return [value, multibyte, tail, err]; - } - } - tail = s; - return [value, multibyte, tail, err]; - }; - $pkg.UnquoteChar = UnquoteChar; - Unquote = function(s) { - var $ptr, _4, _q, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, buf, c, err, err$1, multibyte, n, n$1, quote, r, runeTmp, s, size, ss, t; - t = ""; - err = $ifaceNil; - n = s.length; - if (n < 2) { - _tmp = ""; - _tmp$1 = $pkg.ErrSyntax; - t = _tmp; - err = _tmp$1; - return [t, err]; - } - quote = s.charCodeAt(0); - if (!((quote === s.charCodeAt((n - 1 >> 0))))) { - _tmp$2 = ""; - _tmp$3 = $pkg.ErrSyntax; - t = _tmp$2; - err = _tmp$3; - return [t, err]; - } - s = s.substring(1, (n - 1 >> 0)); - if (quote === 96) { - if (contains(s, 96)) { - _tmp$4 = ""; - _tmp$5 = $pkg.ErrSyntax; - t = _tmp$4; - err = _tmp$5; - return [t, err]; - } - _tmp$6 = s; - _tmp$7 = $ifaceNil; - t = _tmp$6; - err = _tmp$7; - return [t, err]; - } - if (!((quote === 34)) && !((quote === 39))) { - _tmp$8 = ""; - _tmp$9 = $pkg.ErrSyntax; - t = _tmp$8; - err = _tmp$9; - return [t, err]; - } - if (contains(s, 10)) { - _tmp$10 = ""; - _tmp$11 = $pkg.ErrSyntax; - t = _tmp$10; - err = _tmp$11; - return [t, err]; - } - if (!contains(s, 92) && !contains(s, quote)) { - _4 = quote; - if (_4 === (34)) { - _tmp$12 = s; - _tmp$13 = $ifaceNil; - t = _tmp$12; - err = _tmp$13; - return [t, err]; - } else if (_4 === (39)) { - _tuple = utf8.DecodeRuneInString(s); - r = _tuple[0]; - size = _tuple[1]; - if ((size === s.length) && (!((r === 65533)) || !((size === 1)))) { - _tmp$14 = s; - _tmp$15 = $ifaceNil; - t = _tmp$14; - err = _tmp$15; - return [t, err]; - } - } - } - runeTmp = arrayType$4.zero(); - buf = $makeSlice(sliceType$6, 0, (_q = ($imul(3, s.length)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); - while (true) { - if (!(s.length > 0)) { break; } - _tuple$1 = UnquoteChar(s, quote); - c = _tuple$1[0]; - multibyte = _tuple$1[1]; - ss = _tuple$1[2]; - err$1 = _tuple$1[3]; - if (!($interfaceIsEqual(err$1, $ifaceNil))) { - _tmp$16 = ""; - _tmp$17 = err$1; - t = _tmp$16; - err = _tmp$17; - return [t, err]; - } - s = ss; - if (c < 128 || !multibyte) { - buf = $append(buf, (c << 24 >>> 24)); - } else { - n$1 = utf8.EncodeRune(new sliceType$6(runeTmp), c); - buf = $appendSlice(buf, $subslice(new sliceType$6(runeTmp), 0, n$1)); - } - if ((quote === 39) && !((s.length === 0))) { - _tmp$18 = ""; - _tmp$19 = $pkg.ErrSyntax; - t = _tmp$18; - err = _tmp$19; - return [t, err]; - } - } - _tmp$20 = $bytesToString(buf); - _tmp$21 = $ifaceNil; - t = _tmp$20; - err = _tmp$21; - return [t, err]; - }; - $pkg.Unquote = Unquote; - contains = function(s, c) { - var $ptr, c, i, s; - i = 0; - while (true) { - if (!(i < s.length)) { break; } - if (s.charCodeAt(i) === c) { - return true; - } - i = i + (1) >> 0; - } - return false; - }; - bsearch16 = function(a, x) { - var $ptr, _q, _tmp, _tmp$1, a, h, i, j, x; - _tmp = 0; - _tmp$1 = a.$length; - i = _tmp; - j = _tmp$1; - while (true) { - if (!(i < j)) { break; } - h = i + (_q = ((j - i >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - if (((h < 0 || h >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + h]) < x) { - i = h + 1 >> 0; - } else { - j = h; - } - } - return i; - }; - bsearch32 = function(a, x) { - var $ptr, _q, _tmp, _tmp$1, a, h, i, j, x; - _tmp = 0; - _tmp$1 = a.$length; - i = _tmp; - j = _tmp$1; - while (true) { - if (!(i < j)) { break; } - h = i + (_q = ((j - i >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - if (((h < 0 || h >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + h]) < x) { - i = h + 1 >> 0; - } else { - j = h; - } - } - return i; - }; - IsPrint = function(r) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, i, i$1, isNotPrint, isNotPrint$1, isPrint, isPrint$1, j, j$1, r, rr, rr$1, x, x$1, x$2, x$3; - if (r <= 255) { - if (32 <= r && r <= 126) { - return true; - } - if (161 <= r && r <= 255) { - return !((r === 173)); - } - return false; - } - if (0 <= r && r < 65536) { - _tmp = (r << 16 >>> 16); - _tmp$1 = isPrint16; - _tmp$2 = isNotPrint16; - rr = _tmp; - isPrint = _tmp$1; - isNotPrint = _tmp$2; - i = bsearch16(isPrint, rr); - if (i >= isPrint.$length || rr < (x = (i & ~1) >> 0, ((x < 0 || x >= isPrint.$length) ? $throwRuntimeError("index out of range") : isPrint.$array[isPrint.$offset + x])) || (x$1 = i | 1, ((x$1 < 0 || x$1 >= isPrint.$length) ? $throwRuntimeError("index out of range") : isPrint.$array[isPrint.$offset + x$1])) < rr) { - return false; - } - j = bsearch16(isNotPrint, rr); - return j >= isNotPrint.$length || !((((j < 0 || j >= isNotPrint.$length) ? $throwRuntimeError("index out of range") : isNotPrint.$array[isNotPrint.$offset + j]) === rr)); - } - _tmp$3 = (r >>> 0); - _tmp$4 = isPrint32; - _tmp$5 = isNotPrint32; - rr$1 = _tmp$3; - isPrint$1 = _tmp$4; - isNotPrint$1 = _tmp$5; - i$1 = bsearch32(isPrint$1, rr$1); - if (i$1 >= isPrint$1.$length || rr$1 < (x$2 = (i$1 & ~1) >> 0, ((x$2 < 0 || x$2 >= isPrint$1.$length) ? $throwRuntimeError("index out of range") : isPrint$1.$array[isPrint$1.$offset + x$2])) || (x$3 = i$1 | 1, ((x$3 < 0 || x$3 >= isPrint$1.$length) ? $throwRuntimeError("index out of range") : isPrint$1.$array[isPrint$1.$offset + x$3])) < rr$1) { - return false; - } - if (r >= 131072) { - return true; - } - r = r - (65536) >> 0; - j$1 = bsearch16(isNotPrint$1, (r << 16 >>> 16)); - return j$1 >= isNotPrint$1.$length || !((((j$1 < 0 || j$1 >= isNotPrint$1.$length) ? $throwRuntimeError("index out of range") : isNotPrint$1.$array[isNotPrint$1.$offset + j$1]) === (r << 16 >>> 16))); - }; - $pkg.IsPrint = IsPrint; - isInGraphicList = function(r) { - var $ptr, i, r, rr; - if (r > 65535) { - return false; - } - rr = (r << 16 >>> 16); - i = bsearch16(isGraphic, rr); - return i < isGraphic.$length && (rr === ((i < 0 || i >= isGraphic.$length) ? $throwRuntimeError("index out of range") : isGraphic.$array[isGraphic.$offset + i])); - }; - ptrType.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$2.methods = [{prop: "set", name: "set", pkg: "strconv", typ: $funcType([$String], [$Bool], false)}, {prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType$1], [$Uint64, $Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Assign", name: "Assign", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "Shift", name: "Shift", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundDown", name: "RoundDown", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundUp", name: "RoundUp", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "RoundedInteger", name: "RoundedInteger", pkg: "", typ: $funcType([], [$Uint64], false)}]; - ptrType$4.methods = [{prop: "floatBits", name: "floatBits", pkg: "strconv", typ: $funcType([ptrType$1], [$Uint64, $Bool], false)}, {prop: "AssignComputeBounds", name: "AssignComputeBounds", pkg: "", typ: $funcType([$Uint64, $Int, $Bool, ptrType$1], [extFloat, extFloat], false)}, {prop: "Normalize", name: "Normalize", pkg: "", typ: $funcType([], [$Uint], false)}, {prop: "Multiply", name: "Multiply", pkg: "", typ: $funcType([extFloat], [], false)}, {prop: "AssignDecimal", name: "AssignDecimal", pkg: "", typ: $funcType([$Uint64, $Int, $Bool, $Bool, ptrType$1], [$Bool], false)}, {prop: "frexp10", name: "frexp10", pkg: "strconv", typ: $funcType([], [$Int, $Int], false)}, {prop: "FixedDecimal", name: "FixedDecimal", pkg: "", typ: $funcType([ptrType$3, $Int], [$Bool], false)}, {prop: "ShortestDecimal", name: "ShortestDecimal", pkg: "", typ: $funcType([ptrType$3, ptrType$4, ptrType$4], [$Bool], false)}]; - NumError.init([{prop: "Func", name: "Func", pkg: "", typ: $String, tag: ""}, {prop: "Num", name: "Num", pkg: "", typ: $String, tag: ""}, {prop: "Err", name: "Err", pkg: "", typ: $error, tag: ""}]); - decimal.init([{prop: "d", name: "d", pkg: "strconv", typ: arrayType, tag: ""}, {prop: "nd", name: "nd", pkg: "strconv", typ: $Int, tag: ""}, {prop: "dp", name: "dp", pkg: "strconv", typ: $Int, tag: ""}, {prop: "neg", name: "neg", pkg: "strconv", typ: $Bool, tag: ""}, {prop: "trunc", name: "trunc", pkg: "strconv", typ: $Bool, tag: ""}]); - leftCheat.init([{prop: "delta", name: "delta", pkg: "strconv", typ: $Int, tag: ""}, {prop: "cutoff", name: "cutoff", pkg: "strconv", typ: $String, tag: ""}]); - extFloat.init([{prop: "mant", name: "mant", pkg: "strconv", typ: $Uint64, tag: ""}, {prop: "exp", name: "exp", pkg: "strconv", typ: $Int, tag: ""}, {prop: "neg", name: "neg", pkg: "strconv", typ: $Bool, tag: ""}]); - floatInfo.init([{prop: "mantbits", name: "mantbits", pkg: "strconv", typ: $Uint, tag: ""}, {prop: "expbits", name: "expbits", pkg: "strconv", typ: $Uint, tag: ""}, {prop: "bias", name: "bias", pkg: "strconv", typ: $Int, tag: ""}]); - decimalSlice.init([{prop: "d", name: "d", pkg: "strconv", typ: sliceType$6, tag: ""}, {prop: "nd", name: "nd", pkg: "strconv", typ: $Int, tag: ""}, {prop: "dp", name: "dp", pkg: "strconv", typ: $Int, tag: ""}, {prop: "neg", name: "neg", pkg: "strconv", typ: $Bool, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = math.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = utf8.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - optimize = true; - powtab = new sliceType([1, 3, 6, 9, 13, 16, 19, 23, 26]); - float64pow10 = new sliceType$1([1, 10, 100, 1000, 10000, 100000, 1e+06, 1e+07, 1e+08, 1e+09, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, 1e+21, 1e+22]); - float32pow10 = new sliceType$2([1, 10, 100, 1000, 10000, 100000, 1e+06, 1e+07, 1e+08, 1e+09, 1e+10]); - $pkg.ErrRange = errors.New("value out of range"); - $pkg.ErrSyntax = errors.New("invalid syntax"); - leftcheats = new sliceType$3([new leftCheat.ptr(0, ""), new leftCheat.ptr(1, "5"), new leftCheat.ptr(1, "25"), new leftCheat.ptr(1, "125"), new leftCheat.ptr(2, "625"), new leftCheat.ptr(2, "3125"), new leftCheat.ptr(2, "15625"), new leftCheat.ptr(3, "78125"), new leftCheat.ptr(3, "390625"), new leftCheat.ptr(3, "1953125"), new leftCheat.ptr(4, "9765625"), new leftCheat.ptr(4, "48828125"), new leftCheat.ptr(4, "244140625"), new leftCheat.ptr(4, "1220703125"), new leftCheat.ptr(5, "6103515625"), new leftCheat.ptr(5, "30517578125"), new leftCheat.ptr(5, "152587890625"), new leftCheat.ptr(6, "762939453125"), new leftCheat.ptr(6, "3814697265625"), new leftCheat.ptr(6, "19073486328125"), new leftCheat.ptr(7, "95367431640625"), new leftCheat.ptr(7, "476837158203125"), new leftCheat.ptr(7, "2384185791015625"), new leftCheat.ptr(7, "11920928955078125"), new leftCheat.ptr(8, "59604644775390625"), new leftCheat.ptr(8, "298023223876953125"), new leftCheat.ptr(8, "1490116119384765625"), new leftCheat.ptr(9, "7450580596923828125"), new leftCheat.ptr(9, "37252902984619140625"), new leftCheat.ptr(9, "186264514923095703125"), new leftCheat.ptr(10, "931322574615478515625"), new leftCheat.ptr(10, "4656612873077392578125"), new leftCheat.ptr(10, "23283064365386962890625"), new leftCheat.ptr(10, "116415321826934814453125"), new leftCheat.ptr(11, "582076609134674072265625"), new leftCheat.ptr(11, "2910383045673370361328125"), new leftCheat.ptr(11, "14551915228366851806640625"), new leftCheat.ptr(12, "72759576141834259033203125"), new leftCheat.ptr(12, "363797880709171295166015625"), new leftCheat.ptr(12, "1818989403545856475830078125"), new leftCheat.ptr(13, "9094947017729282379150390625"), new leftCheat.ptr(13, "45474735088646411895751953125"), new leftCheat.ptr(13, "227373675443232059478759765625"), new leftCheat.ptr(13, "1136868377216160297393798828125"), new leftCheat.ptr(14, "5684341886080801486968994140625"), new leftCheat.ptr(14, "28421709430404007434844970703125"), new leftCheat.ptr(14, "142108547152020037174224853515625"), new leftCheat.ptr(15, "710542735760100185871124267578125"), new leftCheat.ptr(15, "3552713678800500929355621337890625"), new leftCheat.ptr(15, "17763568394002504646778106689453125"), new leftCheat.ptr(16, "88817841970012523233890533447265625"), new leftCheat.ptr(16, "444089209850062616169452667236328125"), new leftCheat.ptr(16, "2220446049250313080847263336181640625"), new leftCheat.ptr(16, "11102230246251565404236316680908203125"), new leftCheat.ptr(17, "55511151231257827021181583404541015625"), new leftCheat.ptr(17, "277555756156289135105907917022705078125"), new leftCheat.ptr(17, "1387778780781445675529539585113525390625"), new leftCheat.ptr(18, "6938893903907228377647697925567626953125"), new leftCheat.ptr(18, "34694469519536141888238489627838134765625"), new leftCheat.ptr(18, "173472347597680709441192448139190673828125"), new leftCheat.ptr(19, "867361737988403547205962240695953369140625")]); - smallPowersOfTen = $toNativeArray($kindStruct, [new extFloat.ptr(new $Uint64(2147483648, 0), -63, false), new extFloat.ptr(new $Uint64(2684354560, 0), -60, false), new extFloat.ptr(new $Uint64(3355443200, 0), -57, false), new extFloat.ptr(new $Uint64(4194304000, 0), -54, false), new extFloat.ptr(new $Uint64(2621440000, 0), -50, false), new extFloat.ptr(new $Uint64(3276800000, 0), -47, false), new extFloat.ptr(new $Uint64(4096000000, 0), -44, false), new extFloat.ptr(new $Uint64(2560000000, 0), -40, false)]); - powersOfTen = $toNativeArray($kindStruct, [new extFloat.ptr(new $Uint64(4203730336, 136053384), -1220, false), new extFloat.ptr(new $Uint64(3132023167, 2722021238), -1193, false), new extFloat.ptr(new $Uint64(2333539104, 810921078), -1166, false), new extFloat.ptr(new $Uint64(3477244234, 1573795306), -1140, false), new extFloat.ptr(new $Uint64(2590748842, 1432697645), -1113, false), new extFloat.ptr(new $Uint64(3860516611, 1025131999), -1087, false), new extFloat.ptr(new $Uint64(2876309015, 3348809418), -1060, false), new extFloat.ptr(new $Uint64(4286034428, 3200048207), -1034, false), new extFloat.ptr(new $Uint64(3193344495, 1097586188), -1007, false), new extFloat.ptr(new $Uint64(2379227053, 2424306748), -980, false), new extFloat.ptr(new $Uint64(3545324584, 827693699), -954, false), new extFloat.ptr(new $Uint64(2641472655, 2913388981), -927, false), new extFloat.ptr(new $Uint64(3936100983, 602835915), -901, false), new extFloat.ptr(new $Uint64(2932623761, 1081627501), -874, false), new extFloat.ptr(new $Uint64(2184974969, 1572261463), -847, false), new extFloat.ptr(new $Uint64(3255866422, 1308317239), -821, false), new extFloat.ptr(new $Uint64(2425809519, 944281679), -794, false), new extFloat.ptr(new $Uint64(3614737867, 629291719), -768, false), new extFloat.ptr(new $Uint64(2693189581, 2545915892), -741, false), new extFloat.ptr(new $Uint64(4013165208, 388672741), -715, false), new extFloat.ptr(new $Uint64(2990041083, 708162190), -688, false), new extFloat.ptr(new $Uint64(2227754207, 3536207675), -661, false), new extFloat.ptr(new $Uint64(3319612455, 450088378), -635, false), new extFloat.ptr(new $Uint64(2473304014, 3139815830), -608, false), new extFloat.ptr(new $Uint64(3685510180, 2103616900), -582, false), new extFloat.ptr(new $Uint64(2745919064, 224385782), -555, false), new extFloat.ptr(new $Uint64(4091738259, 3737383206), -529, false), new extFloat.ptr(new $Uint64(3048582568, 2868871352), -502, false), new extFloat.ptr(new $Uint64(2271371013, 1820084875), -475, false), new extFloat.ptr(new $Uint64(3384606560, 885076051), -449, false), new extFloat.ptr(new $Uint64(2521728396, 2444895829), -422, false), new extFloat.ptr(new $Uint64(3757668132, 1881767613), -396, false), new extFloat.ptr(new $Uint64(2799680927, 3102062735), -369, false), new extFloat.ptr(new $Uint64(4171849679, 2289335700), -343, false), new extFloat.ptr(new $Uint64(3108270227, 2410191823), -316, false), new extFloat.ptr(new $Uint64(2315841784, 3205436779), -289, false), new extFloat.ptr(new $Uint64(3450873173, 1697722806), -263, false), new extFloat.ptr(new $Uint64(2571100870, 3497754540), -236, false), new extFloat.ptr(new $Uint64(3831238852, 707476230), -210, false), new extFloat.ptr(new $Uint64(2854495385, 1769181907), -183, false), new extFloat.ptr(new $Uint64(4253529586, 2197867022), -157, false), new extFloat.ptr(new $Uint64(3169126500, 2450594539), -130, false), new extFloat.ptr(new $Uint64(2361183241, 1867548876), -103, false), new extFloat.ptr(new $Uint64(3518437208, 3793315116), -77, false), new extFloat.ptr(new $Uint64(2621440000, 0), -50, false), new extFloat.ptr(new $Uint64(3906250000, 0), -24, false), new extFloat.ptr(new $Uint64(2910383045, 2892103680), 3, false), new extFloat.ptr(new $Uint64(2168404344, 4170451332), 30, false), new extFloat.ptr(new $Uint64(3231174267, 3372684723), 56, false), new extFloat.ptr(new $Uint64(2407412430, 2078956656), 83, false), new extFloat.ptr(new $Uint64(3587324068, 2884206696), 109, false), new extFloat.ptr(new $Uint64(2672764710, 395977285), 136, false), new extFloat.ptr(new $Uint64(3982729777, 3569679143), 162, false), new extFloat.ptr(new $Uint64(2967364920, 2361961896), 189, false), new extFloat.ptr(new $Uint64(2210859150, 447440347), 216, false), new extFloat.ptr(new $Uint64(3294436857, 1114709402), 242, false), new extFloat.ptr(new $Uint64(2454546732, 2786846552), 269, false), new extFloat.ptr(new $Uint64(3657559652, 443583978), 295, false), new extFloat.ptr(new $Uint64(2725094297, 2599384906), 322, false), new extFloat.ptr(new $Uint64(4060706939, 3028118405), 348, false), new extFloat.ptr(new $Uint64(3025462433, 2044532855), 375, false), new extFloat.ptr(new $Uint64(2254145170, 1536935362), 402, false), new extFloat.ptr(new $Uint64(3358938053, 3365297469), 428, false), new extFloat.ptr(new $Uint64(2502603868, 4204241075), 455, false), new extFloat.ptr(new $Uint64(3729170365, 2577424355), 481, false), new extFloat.ptr(new $Uint64(2778448436, 3677981733), 508, false), new extFloat.ptr(new $Uint64(4140210802, 2744688476), 534, false), new extFloat.ptr(new $Uint64(3084697427, 1424604878), 561, false), new extFloat.ptr(new $Uint64(2298278679, 4062331362), 588, false), new extFloat.ptr(new $Uint64(3424702107, 3546052773), 614, false), new extFloat.ptr(new $Uint64(2551601907, 2065781727), 641, false), new extFloat.ptr(new $Uint64(3802183132, 2535403578), 667, false), new extFloat.ptr(new $Uint64(2832847187, 1558426518), 694, false), new extFloat.ptr(new $Uint64(4221271257, 2762425404), 720, false), new extFloat.ptr(new $Uint64(3145092172, 2812560400), 747, false), new extFloat.ptr(new $Uint64(2343276271, 3057687578), 774, false), new extFloat.ptr(new $Uint64(3491753744, 2790753324), 800, false), new extFloat.ptr(new $Uint64(2601559269, 3918606633), 827, false), new extFloat.ptr(new $Uint64(3876625403, 2711358621), 853, false), new extFloat.ptr(new $Uint64(2888311001, 1648096297), 880, false), new extFloat.ptr(new $Uint64(2151959390, 2057817989), 907, false), new extFloat.ptr(new $Uint64(3206669376, 61660461), 933, false), new extFloat.ptr(new $Uint64(2389154863, 1581580175), 960, false), new extFloat.ptr(new $Uint64(3560118173, 2626467905), 986, false), new extFloat.ptr(new $Uint64(2652494738, 3034782633), 1013, false), new extFloat.ptr(new $Uint64(3952525166, 3135207385), 1039, false), new extFloat.ptr(new $Uint64(2944860731, 2616258155), 1066, false)]); - uint64pow10 = $toNativeArray($kindUint64, [new $Uint64(0, 1), new $Uint64(0, 10), new $Uint64(0, 100), new $Uint64(0, 1000), new $Uint64(0, 10000), new $Uint64(0, 100000), new $Uint64(0, 1000000), new $Uint64(0, 10000000), new $Uint64(0, 100000000), new $Uint64(0, 1000000000), new $Uint64(2, 1410065408), new $Uint64(23, 1215752192), new $Uint64(232, 3567587328), new $Uint64(2328, 1316134912), new $Uint64(23283, 276447232), new $Uint64(232830, 2764472320), new $Uint64(2328306, 1874919424), new $Uint64(23283064, 1569325056), new $Uint64(232830643, 2808348672), new $Uint64(2328306436, 2313682944)]); - float32info = new floatInfo.ptr(23, 8, -127); - float64info = new floatInfo.ptr(52, 11, -1023); - isPrint16 = new sliceType$4([32, 126, 161, 887, 890, 895, 900, 1366, 1369, 1418, 1421, 1479, 1488, 1514, 1520, 1524, 1542, 1563, 1566, 1805, 1808, 1866, 1869, 1969, 1984, 2042, 2048, 2093, 2096, 2139, 2142, 2142, 2208, 2228, 2275, 2444, 2447, 2448, 2451, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2531, 2534, 2555, 2561, 2570, 2575, 2576, 2579, 2617, 2620, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2654, 2662, 2677, 2689, 2745, 2748, 2765, 2768, 2768, 2784, 2787, 2790, 2801, 2809, 2809, 2817, 2828, 2831, 2832, 2835, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2915, 2918, 2935, 2946, 2954, 2958, 2965, 2969, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3021, 3024, 3024, 3031, 3031, 3046, 3066, 3072, 3129, 3133, 3149, 3157, 3162, 3168, 3171, 3174, 3183, 3192, 3257, 3260, 3277, 3285, 3286, 3294, 3299, 3302, 3314, 3329, 3386, 3389, 3406, 3415, 3415, 3423, 3427, 3430, 3445, 3449, 3455, 3458, 3478, 3482, 3517, 3520, 3526, 3530, 3530, 3535, 3551, 3558, 3567, 3570, 3572, 3585, 3642, 3647, 3675, 3713, 3716, 3719, 3722, 3725, 3725, 3732, 3751, 3754, 3773, 3776, 3789, 3792, 3801, 3804, 3807, 3840, 3948, 3953, 4058, 4096, 4295, 4301, 4301, 4304, 4685, 4688, 4701, 4704, 4749, 4752, 4789, 4792, 4805, 4808, 4885, 4888, 4954, 4957, 4988, 4992, 5017, 5024, 5109, 5112, 5117, 5120, 5788, 5792, 5880, 5888, 5908, 5920, 5942, 5952, 5971, 5984, 6003, 6016, 6109, 6112, 6121, 6128, 6137, 6144, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6443, 6448, 6459, 6464, 6464, 6468, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6622, 6683, 6686, 6780, 6783, 6793, 6800, 6809, 6816, 6829, 6832, 6846, 6912, 6987, 6992, 7036, 7040, 7155, 7164, 7223, 7227, 7241, 7245, 7295, 7360, 7367, 7376, 7417, 7424, 7669, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8061, 8064, 8147, 8150, 8175, 8178, 8190, 8208, 8231, 8240, 8286, 8304, 8305, 8308, 8348, 8352, 8382, 8400, 8432, 8448, 8587, 8592, 9210, 9216, 9254, 9280, 9290, 9312, 11123, 11126, 11157, 11160, 11193, 11197, 11217, 11244, 11247, 11264, 11507, 11513, 11559, 11565, 11565, 11568, 11623, 11631, 11632, 11647, 11670, 11680, 11842, 11904, 12019, 12032, 12245, 12272, 12283, 12289, 12438, 12441, 12543, 12549, 12589, 12593, 12730, 12736, 12771, 12784, 19893, 19904, 40917, 40960, 42124, 42128, 42182, 42192, 42539, 42560, 42743, 42752, 42925, 42928, 42935, 42999, 43051, 43056, 43065, 43072, 43127, 43136, 43204, 43214, 43225, 43232, 43261, 43264, 43347, 43359, 43388, 43392, 43481, 43486, 43574, 43584, 43597, 43600, 43609, 43612, 43714, 43739, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43877, 43888, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64449, 64467, 64831, 64848, 64911, 64914, 64967, 65008, 65021, 65024, 65049, 65056, 65131, 65136, 65276, 65281, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65504, 65518, 65532, 65533]); - isNotPrint16 = new sliceType$4([173, 907, 909, 930, 1328, 1376, 1416, 1424, 1757, 2111, 2436, 2473, 2481, 2526, 2564, 2601, 2609, 2612, 2615, 2621, 2653, 2692, 2702, 2706, 2729, 2737, 2740, 2758, 2762, 2820, 2857, 2865, 2868, 2910, 2948, 2961, 2971, 2973, 3017, 3076, 3085, 3089, 3113, 3141, 3145, 3159, 3200, 3204, 3213, 3217, 3241, 3252, 3269, 3273, 3295, 3312, 3332, 3341, 3345, 3397, 3401, 3460, 3506, 3516, 3541, 3543, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3770, 3781, 3783, 3912, 3992, 4029, 4045, 4294, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 4881, 5760, 5901, 5997, 6001, 6431, 6751, 7415, 8024, 8026, 8028, 8030, 8117, 8133, 8156, 8181, 8335, 11209, 11311, 11359, 11558, 11687, 11695, 11703, 11711, 11719, 11727, 11735, 11743, 11930, 12352, 12687, 12831, 13055, 43470, 43519, 43815, 43823, 64311, 64317, 64319, 64322, 64325, 65107, 65127, 65141, 65511]); - isPrint32 = new sliceType$5([65536, 65613, 65616, 65629, 65664, 65786, 65792, 65794, 65799, 65843, 65847, 65932, 65936, 65947, 65952, 65952, 66000, 66045, 66176, 66204, 66208, 66256, 66272, 66299, 66304, 66339, 66352, 66378, 66384, 66426, 66432, 66499, 66504, 66517, 66560, 66717, 66720, 66729, 66816, 66855, 66864, 66915, 66927, 66927, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67640, 67644, 67644, 67647, 67742, 67751, 67759, 67808, 67829, 67835, 67867, 67871, 67897, 67903, 67903, 67968, 68023, 68028, 68047, 68050, 68102, 68108, 68147, 68152, 68154, 68159, 68167, 68176, 68184, 68192, 68255, 68288, 68326, 68331, 68342, 68352, 68405, 68409, 68437, 68440, 68466, 68472, 68497, 68505, 68508, 68521, 68527, 68608, 68680, 68736, 68786, 68800, 68850, 68858, 68863, 69216, 69246, 69632, 69709, 69714, 69743, 69759, 69825, 69840, 69864, 69872, 69881, 69888, 69955, 69968, 70006, 70016, 70093, 70096, 70132, 70144, 70205, 70272, 70313, 70320, 70378, 70384, 70393, 70400, 70412, 70415, 70416, 70419, 70457, 70460, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70784, 70855, 70864, 70873, 71040, 71093, 71096, 71133, 71168, 71236, 71248, 71257, 71296, 71351, 71360, 71369, 71424, 71449, 71453, 71467, 71472, 71487, 71840, 71922, 71935, 71935, 72384, 72440, 73728, 74649, 74752, 74868, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92777, 92782, 92783, 92880, 92909, 92912, 92917, 92928, 92997, 93008, 93047, 93053, 93071, 93952, 94020, 94032, 94078, 94095, 94111, 110592, 110593, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113820, 113823, 118784, 119029, 119040, 119078, 119081, 119154, 119163, 119272, 119296, 119365, 119552, 119638, 119648, 119665, 119808, 119967, 119970, 119970, 119973, 119974, 119977, 120074, 120077, 120134, 120138, 120485, 120488, 120779, 120782, 121483, 121499, 121519, 124928, 125124, 125127, 125142, 126464, 126500, 126503, 126523, 126530, 126530, 126535, 126548, 126551, 126564, 126567, 126619, 126625, 126651, 126704, 126705, 126976, 127019, 127024, 127123, 127136, 127150, 127153, 127221, 127232, 127244, 127248, 127339, 127344, 127386, 127462, 127490, 127504, 127546, 127552, 127560, 127568, 127569, 127744, 128720, 128736, 128748, 128752, 128755, 128768, 128883, 128896, 128980, 129024, 129035, 129040, 129095, 129104, 129113, 129120, 129159, 129168, 129197, 129296, 129304, 129408, 129412, 129472, 129472, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 194560, 195101, 917760, 917999]); - isNotPrint32 = new sliceType$4([12, 39, 59, 62, 926, 2057, 2102, 2134, 2291, 2564, 2580, 2584, 4285, 4405, 4576, 4626, 4743, 4745, 4750, 4766, 4868, 4905, 4913, 4916, 9327, 27231, 27482, 27490, 54357, 54429, 54445, 54458, 54460, 54468, 54534, 54549, 54557, 54586, 54591, 54597, 54609, 55968, 60932, 60960, 60963, 60968, 60979, 60984, 60986, 61000, 61002, 61004, 61008, 61011, 61016, 61018, 61020, 61022, 61024, 61027, 61035, 61043, 61048, 61053, 61055, 61066, 61092, 61098, 61632, 61648, 61743, 62842, 62884]); - isGraphic = new sliceType$4([160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288]); - shifts = $toNativeArray($kindUint, [0, 0, 1, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0]); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["reflect"] = (function() { - var $pkg = {}, $init, errors, js, math, runtime, strconv, sync, mapIter, Type, Kind, rtype, typeAlg, method, uncommonType, ChanDir, arrayType, chanType, funcType, imethod, interfaceType, mapType, ptrType, sliceType, structField, structType, Method, StructField, StructTag, fieldScan, Value, flag, ValueError, nonEmptyInterface, ptrType$1, sliceType$1, sliceType$2, ptrType$3, funcType$1, sliceType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, sliceType$4, sliceType$5, sliceType$6, structType$6, sliceType$7, sliceType$8, ptrType$8, arrayType$1, structType$7, ptrType$9, sliceType$9, ptrType$10, ptrType$11, ptrType$12, sliceType$11, sliceType$12, ptrType$13, sliceType$13, ptrType$18, sliceType$15, funcType$3, funcType$4, funcType$5, arrayType$3, ptrType$20, initialized, stringPtrMap, callHelper, jsObjectPtr, selectHelper, kindNames, uint8Type, init, jsType, reflectType, setKindType, newStringPtr, isWrapped, copyStruct, makeValue, MakeSlice, TypeOf, ValueOf, SliceOf, Zero, unsafe_New, makeInt, typedmemmove, keyFor, mapaccess, mapassign, mapdelete, mapiterinit, mapiterkey, mapiternext, maplen, cvtDirect, methodReceiver, valueInterface, ifaceE2I, methodName, makeMethodValue, wrapJsObject, unwrapJsObject, getJsTag, chanrecv, chansend, PtrTo, implements$1, directlyAssignable, haveIdenticalUnderlyingType, toType, ifaceIndir, overflowFloat32, New, convertOp, makeFloat, makeComplex, makeString, makeBytes, makeRunes, cvtInt, cvtUint, cvtFloatInt, cvtFloatUint, cvtIntFloat, cvtUintFloat, cvtFloat, cvtComplex, cvtIntString, cvtUintString, cvtBytesString, cvtStringBytes, cvtRunesString, cvtStringRunes, cvtT2I, cvtI2I; - errors = $packages["errors"]; - js = $packages["github.com/gopherjs/gopherjs/js"]; - math = $packages["math"]; - runtime = $packages["runtime"]; - strconv = $packages["strconv"]; - sync = $packages["sync"]; - mapIter = $pkg.mapIter = $newType(0, $kindStruct, "reflect.mapIter", "mapIter", "reflect", function(t_, m_, keys_, i_) { - this.$val = this; - if (arguments.length === 0) { - this.t = $ifaceNil; - this.m = null; - this.keys = null; - this.i = 0; - return; - } - this.t = t_; - this.m = m_; - this.keys = keys_; - this.i = i_; - }); - Type = $pkg.Type = $newType(8, $kindInterface, "reflect.Type", "Type", "reflect", null); - Kind = $pkg.Kind = $newType(4, $kindUint, "reflect.Kind", "Kind", "reflect", null); - rtype = $pkg.rtype = $newType(0, $kindStruct, "reflect.rtype", "rtype", "reflect", function(size_, ptrdata_, hash_, _$3_, align_, fieldAlign_, kind_, alg_, gcdata_, string_, uncommonType_, ptrToThis_) { - this.$val = this; - if (arguments.length === 0) { - this.size = 0; - this.ptrdata = 0; - this.hash = 0; - this._$3 = 0; - this.align = 0; - this.fieldAlign = 0; - this.kind = 0; - this.alg = ptrType$4.nil; - this.gcdata = ptrType$5.nil; - this.string = ptrType$6.nil; - this.uncommonType = ptrType$7.nil; - this.ptrToThis = ptrType$1.nil; - return; - } - this.size = size_; - this.ptrdata = ptrdata_; - this.hash = hash_; - this._$3 = _$3_; - this.align = align_; - this.fieldAlign = fieldAlign_; - this.kind = kind_; - this.alg = alg_; - this.gcdata = gcdata_; - this.string = string_; - this.uncommonType = uncommonType_; - this.ptrToThis = ptrToThis_; - }); - typeAlg = $pkg.typeAlg = $newType(0, $kindStruct, "reflect.typeAlg", "typeAlg", "reflect", function(hash_, equal_) { - this.$val = this; - if (arguments.length === 0) { - this.hash = $throwNilPointerError; - this.equal = $throwNilPointerError; - return; - } - this.hash = hash_; - this.equal = equal_; - }); - method = $pkg.method = $newType(0, $kindStruct, "reflect.method", "method", "reflect", function(name_, pkgPath_, mtyp_, typ_, ifn_, tfn_) { - this.$val = this; - if (arguments.length === 0) { - this.name = ptrType$6.nil; - this.pkgPath = ptrType$6.nil; - this.mtyp = ptrType$1.nil; - this.typ = ptrType$1.nil; - this.ifn = 0; - this.tfn = 0; - return; - } - this.name = name_; - this.pkgPath = pkgPath_; - this.mtyp = mtyp_; - this.typ = typ_; - this.ifn = ifn_; - this.tfn = tfn_; - }); - uncommonType = $pkg.uncommonType = $newType(0, $kindStruct, "reflect.uncommonType", "uncommonType", "reflect", function(name_, pkgPath_, methods_) { - this.$val = this; - if (arguments.length === 0) { - this.name = ptrType$6.nil; - this.pkgPath = ptrType$6.nil; - this.methods = sliceType$4.nil; - return; - } - this.name = name_; - this.pkgPath = pkgPath_; - this.methods = methods_; - }); - ChanDir = $pkg.ChanDir = $newType(4, $kindInt, "reflect.ChanDir", "ChanDir", "reflect", null); - arrayType = $pkg.arrayType = $newType(0, $kindStruct, "reflect.arrayType", "arrayType", "reflect", function(rtype_, elem_, slice_, len_) { - this.$val = this; - if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); - this.elem = ptrType$1.nil; - this.slice = ptrType$1.nil; - this.len = 0; - return; - } - this.rtype = rtype_; - this.elem = elem_; - this.slice = slice_; - this.len = len_; - }); - chanType = $pkg.chanType = $newType(0, $kindStruct, "reflect.chanType", "chanType", "reflect", function(rtype_, elem_, dir_) { - this.$val = this; - if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); - this.elem = ptrType$1.nil; - this.dir = 0; - return; - } - this.rtype = rtype_; - this.elem = elem_; - this.dir = dir_; - }); - funcType = $pkg.funcType = $newType(0, $kindStruct, "reflect.funcType", "funcType", "reflect", function(rtype_, dotdotdot_, in$2_, out_) { - this.$val = this; - if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); - this.dotdotdot = false; - this.in$2 = sliceType$1.nil; - this.out = sliceType$1.nil; - return; - } - this.rtype = rtype_; - this.dotdotdot = dotdotdot_; - this.in$2 = in$2_; - this.out = out_; - }); - imethod = $pkg.imethod = $newType(0, $kindStruct, "reflect.imethod", "imethod", "reflect", function(name_, pkgPath_, typ_) { - this.$val = this; - if (arguments.length === 0) { - this.name = ptrType$6.nil; - this.pkgPath = ptrType$6.nil; - this.typ = ptrType$1.nil; - return; - } - this.name = name_; - this.pkgPath = pkgPath_; - this.typ = typ_; - }); - interfaceType = $pkg.interfaceType = $newType(0, $kindStruct, "reflect.interfaceType", "interfaceType", "reflect", function(rtype_, methods_) { - this.$val = this; - if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); - this.methods = sliceType$5.nil; - return; - } - this.rtype = rtype_; - this.methods = methods_; - }); - mapType = $pkg.mapType = $newType(0, $kindStruct, "reflect.mapType", "mapType", "reflect", function(rtype_, key_, elem_, bucket_, hmap_, keysize_, indirectkey_, valuesize_, indirectvalue_, bucketsize_, reflexivekey_, needkeyupdate_) { - this.$val = this; - if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); - this.key = ptrType$1.nil; - this.elem = ptrType$1.nil; - this.bucket = ptrType$1.nil; - this.hmap = ptrType$1.nil; - this.keysize = 0; - this.indirectkey = 0; - this.valuesize = 0; - this.indirectvalue = 0; - this.bucketsize = 0; - this.reflexivekey = false; - this.needkeyupdate = false; - return; - } - this.rtype = rtype_; - this.key = key_; - this.elem = elem_; - this.bucket = bucket_; - this.hmap = hmap_; - this.keysize = keysize_; - this.indirectkey = indirectkey_; - this.valuesize = valuesize_; - this.indirectvalue = indirectvalue_; - this.bucketsize = bucketsize_; - this.reflexivekey = reflexivekey_; - this.needkeyupdate = needkeyupdate_; - }); - ptrType = $pkg.ptrType = $newType(0, $kindStruct, "reflect.ptrType", "ptrType", "reflect", function(rtype_, elem_) { - this.$val = this; - if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); - this.elem = ptrType$1.nil; - return; - } - this.rtype = rtype_; - this.elem = elem_; - }); - sliceType = $pkg.sliceType = $newType(0, $kindStruct, "reflect.sliceType", "sliceType", "reflect", function(rtype_, elem_) { - this.$val = this; - if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); - this.elem = ptrType$1.nil; - return; - } - this.rtype = rtype_; - this.elem = elem_; - }); - structField = $pkg.structField = $newType(0, $kindStruct, "reflect.structField", "structField", "reflect", function(name_, pkgPath_, typ_, tag_, offset_) { - this.$val = this; - if (arguments.length === 0) { - this.name = ptrType$6.nil; - this.pkgPath = ptrType$6.nil; - this.typ = ptrType$1.nil; - this.tag = ptrType$6.nil; - this.offset = 0; - return; - } - this.name = name_; - this.pkgPath = pkgPath_; - this.typ = typ_; - this.tag = tag_; - this.offset = offset_; - }); - structType = $pkg.structType = $newType(0, $kindStruct, "reflect.structType", "structType", "reflect", function(rtype_, fields_) { - this.$val = this; - if (arguments.length === 0) { - this.rtype = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); - this.fields = sliceType$6.nil; - return; - } - this.rtype = rtype_; - this.fields = fields_; - }); - Method = $pkg.Method = $newType(0, $kindStruct, "reflect.Method", "Method", "reflect", function(Name_, PkgPath_, Type_, Func_, Index_) { - this.$val = this; - if (arguments.length === 0) { - this.Name = ""; - this.PkgPath = ""; - this.Type = $ifaceNil; - this.Func = new Value.ptr(ptrType$1.nil, 0, 0); - this.Index = 0; - return; - } - this.Name = Name_; - this.PkgPath = PkgPath_; - this.Type = Type_; - this.Func = Func_; - this.Index = Index_; - }); - StructField = $pkg.StructField = $newType(0, $kindStruct, "reflect.StructField", "StructField", "reflect", function(Name_, PkgPath_, Type_, Tag_, Offset_, Index_, Anonymous_) { - this.$val = this; - if (arguments.length === 0) { - this.Name = ""; - this.PkgPath = ""; - this.Type = $ifaceNil; - this.Tag = ""; - this.Offset = 0; - this.Index = sliceType$11.nil; - this.Anonymous = false; - return; - } - this.Name = Name_; - this.PkgPath = PkgPath_; - this.Type = Type_; - this.Tag = Tag_; - this.Offset = Offset_; - this.Index = Index_; - this.Anonymous = Anonymous_; - }); - StructTag = $pkg.StructTag = $newType(8, $kindString, "reflect.StructTag", "StructTag", "reflect", null); - fieldScan = $pkg.fieldScan = $newType(0, $kindStruct, "reflect.fieldScan", "fieldScan", "reflect", function(typ_, index_) { - this.$val = this; - if (arguments.length === 0) { - this.typ = ptrType$13.nil; - this.index = sliceType$11.nil; - return; - } - this.typ = typ_; - this.index = index_; - }); - Value = $pkg.Value = $newType(0, $kindStruct, "reflect.Value", "Value", "reflect", function(typ_, ptr_, flag_) { - this.$val = this; - if (arguments.length === 0) { - this.typ = ptrType$1.nil; - this.ptr = 0; - this.flag = 0; - return; - } - this.typ = typ_; - this.ptr = ptr_; - this.flag = flag_; - }); - flag = $pkg.flag = $newType(4, $kindUintptr, "reflect.flag", "flag", "reflect", null); - ValueError = $pkg.ValueError = $newType(0, $kindStruct, "reflect.ValueError", "ValueError", "reflect", function(Method_, Kind_) { - this.$val = this; - if (arguments.length === 0) { - this.Method = ""; - this.Kind = 0; - return; - } - this.Method = Method_; - this.Kind = Kind_; - }); - nonEmptyInterface = $pkg.nonEmptyInterface = $newType(0, $kindStruct, "reflect.nonEmptyInterface", "nonEmptyInterface", "reflect", function(itab_, word_) { - this.$val = this; - if (arguments.length === 0) { - this.itab = ptrType$9.nil; - this.word = 0; - return; - } - this.itab = itab_; - this.word = word_; - }); - ptrType$1 = $ptrType(rtype); - sliceType$1 = $sliceType(ptrType$1); - sliceType$2 = $sliceType($emptyInterface); - ptrType$3 = $ptrType(js.Object); - funcType$1 = $funcType([sliceType$2], [ptrType$3], true); - sliceType$3 = $sliceType($String); - ptrType$4 = $ptrType(typeAlg); - ptrType$5 = $ptrType($Uint8); - ptrType$6 = $ptrType($String); - ptrType$7 = $ptrType(uncommonType); - sliceType$4 = $sliceType(method); - sliceType$5 = $sliceType(imethod); - sliceType$6 = $sliceType(structField); - structType$6 = $structType([{prop: "str", name: "str", pkg: "reflect", typ: $String, tag: ""}]); - sliceType$7 = $sliceType(ptrType$3); - sliceType$8 = $sliceType(Value); - ptrType$8 = $ptrType(nonEmptyInterface); - arrayType$1 = $arrayType($UnsafePointer, 100000); - structType$7 = $structType([{prop: "ityp", name: "ityp", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "link", name: "link", pkg: "reflect", typ: $UnsafePointer, tag: ""}, {prop: "bad", name: "bad", pkg: "reflect", typ: $Int32, tag: ""}, {prop: "unused", name: "unused", pkg: "reflect", typ: $Int32, tag: ""}, {prop: "fun", name: "fun", pkg: "reflect", typ: arrayType$1, tag: ""}]); - ptrType$9 = $ptrType(structType$7); - sliceType$9 = $sliceType(sliceType$7); - ptrType$10 = $ptrType(method); - ptrType$11 = $ptrType(interfaceType); - ptrType$12 = $ptrType(imethod); - sliceType$11 = $sliceType($Int); - sliceType$12 = $sliceType(fieldScan); - ptrType$13 = $ptrType(structType); - sliceType$13 = $sliceType($Uint8); - ptrType$18 = $ptrType($UnsafePointer); - sliceType$15 = $sliceType($Int32); - funcType$3 = $funcType([$String], [$Bool], false); - funcType$4 = $funcType([$UnsafePointer, $Uintptr], [$Uintptr], false); - funcType$5 = $funcType([$UnsafePointer, $UnsafePointer], [$Bool], false); - arrayType$3 = $arrayType($Uintptr, 2); - ptrType$20 = $ptrType(ValueError); - init = function() { - var $ptr, used, x, x$1, x$10, x$11, x$12, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; used = $f.used; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - used = (function(i) { - var $ptr, i; - }); - $r = used((x = new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), new x.constructor.elem(x))); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$1 = new uncommonType.ptr(ptrType$6.nil, ptrType$6.nil, sliceType$4.nil), new x$1.constructor.elem(x$1))); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$2 = new method.ptr(ptrType$6.nil, ptrType$6.nil, ptrType$1.nil, ptrType$1.nil, 0, 0), new x$2.constructor.elem(x$2))); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$3 = new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), ptrType$1.nil, ptrType$1.nil, 0), new x$3.constructor.elem(x$3))); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$4 = new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), ptrType$1.nil, 0), new x$4.constructor.elem(x$4))); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$5 = new funcType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), false, sliceType$1.nil, sliceType$1.nil), new x$5.constructor.elem(x$5))); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$6 = new interfaceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), sliceType$5.nil), new x$6.constructor.elem(x$6))); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$7 = new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, ptrType$1.nil, 0, 0, 0, 0, 0, false, false), new x$7.constructor.elem(x$7))); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$8 = new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), ptrType$1.nil), new x$8.constructor.elem(x$8))); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$9 = new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), ptrType$1.nil), new x$9.constructor.elem(x$9))); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$10 = new structType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), sliceType$6.nil), new x$10.constructor.elem(x$10))); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$11 = new imethod.ptr(ptrType$6.nil, ptrType$6.nil, ptrType$1.nil), new x$11.constructor.elem(x$11))); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = used((x$12 = new structField.ptr(ptrType$6.nil, ptrType$6.nil, ptrType$1.nil, ptrType$6.nil, 0), new x$12.constructor.elem(x$12))); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - initialized = true; - uint8Type = $assertType(TypeOf(new $Uint8(0)), ptrType$1); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: init }; } $f.$ptr = $ptr; $f.used = used; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; - }; - jsType = function(typ) { - var $ptr, typ; - return typ.jsType; - }; - reflectType = function(typ) { - var $ptr, _1, _i, _i$1, _i$2, _i$3, _i$4, _ref, _ref$1, _ref$2, _ref$3, _ref$4, dir, f, fields, i, i$1, i$2, i$3, i$4, imethods, in$1, m, m$1, methodSet, methods, out, params, reflectFields, reflectMethods, results, rt, t, typ; - if (typ.reflectType === undefined) { - rt = new rtype.ptr((($parseInt(typ.size) >> 0) >>> 0), 0, 0, 0, 0, 0, (($parseInt(typ.kind) >> 0) << 24 >>> 24), ptrType$4.nil, ptrType$5.nil, newStringPtr(typ.string), ptrType$7.nil, ptrType$1.nil); - rt.jsType = typ; - typ.reflectType = rt; - methodSet = $methodSet(typ); - if (!($internalize(typ.typeName, $String) === "") || !(($parseInt(methodSet.length) === 0))) { - reflectMethods = $makeSlice(sliceType$4, $parseInt(methodSet.length)); - _ref = reflectMethods; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - m = methodSet[i]; - t = m.typ; - method.copy(((i < 0 || i >= reflectMethods.$length) ? $throwRuntimeError("index out of range") : reflectMethods.$array[reflectMethods.$offset + i]), new method.ptr(newStringPtr(m.name), newStringPtr(m.pkg), reflectType(t), reflectType($funcType(new ($global.Array)(typ).concat(t.params), t.results, t.variadic)), 0, 0)); - _i++; - } - rt.uncommonType = new uncommonType.ptr(newStringPtr(typ.typeName), newStringPtr(typ.pkg), reflectMethods); - rt.uncommonType.jsType = typ; - } - _1 = rt.Kind(); - if (_1 === (17)) { - setKindType(rt, new arrayType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), reflectType(typ.elem), ptrType$1.nil, (($parseInt(typ.len) >> 0) >>> 0))); - } else if (_1 === (18)) { - dir = 3; - if (!!(typ.sendOnly)) { - dir = 2; - } - if (!!(typ.recvOnly)) { - dir = 1; - } - setKindType(rt, new chanType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), reflectType(typ.elem), (dir >>> 0))); - } else if (_1 === (19)) { - params = typ.params; - in$1 = $makeSlice(sliceType$1, $parseInt(params.length)); - _ref$1 = in$1; - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - i$1 = _i$1; - ((i$1 < 0 || i$1 >= in$1.$length) ? $throwRuntimeError("index out of range") : in$1.$array[in$1.$offset + i$1] = reflectType(params[i$1])); - _i$1++; - } - results = typ.results; - out = $makeSlice(sliceType$1, $parseInt(results.length)); - _ref$2 = out; - _i$2 = 0; - while (true) { - if (!(_i$2 < _ref$2.$length)) { break; } - i$2 = _i$2; - ((i$2 < 0 || i$2 >= out.$length) ? $throwRuntimeError("index out of range") : out.$array[out.$offset + i$2] = reflectType(results[i$2])); - _i$2++; - } - setKindType(rt, new funcType.ptr($clone(rt, rtype), !!(typ.variadic), in$1, out)); - } else if (_1 === (20)) { - methods = typ.methods; - imethods = $makeSlice(sliceType$5, $parseInt(methods.length)); - _ref$3 = imethods; - _i$3 = 0; - while (true) { - if (!(_i$3 < _ref$3.$length)) { break; } - i$3 = _i$3; - m$1 = methods[i$3]; - imethod.copy(((i$3 < 0 || i$3 >= imethods.$length) ? $throwRuntimeError("index out of range") : imethods.$array[imethods.$offset + i$3]), new imethod.ptr(newStringPtr(m$1.name), newStringPtr(m$1.pkg), reflectType(m$1.typ))); - _i$3++; - } - setKindType(rt, new interfaceType.ptr($clone(rt, rtype), imethods)); - } else if (_1 === (21)) { - setKindType(rt, new mapType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), reflectType(typ.key), reflectType(typ.elem), ptrType$1.nil, ptrType$1.nil, 0, 0, 0, 0, 0, false, false)); - } else if (_1 === (22)) { - setKindType(rt, new ptrType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), reflectType(typ.elem))); - } else if (_1 === (23)) { - setKindType(rt, new sliceType.ptr(new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil), reflectType(typ.elem))); - } else if (_1 === (25)) { - fields = typ.fields; - reflectFields = $makeSlice(sliceType$6, $parseInt(fields.length)); - _ref$4 = reflectFields; - _i$4 = 0; - while (true) { - if (!(_i$4 < _ref$4.$length)) { break; } - i$4 = _i$4; - f = fields[i$4]; - structField.copy(((i$4 < 0 || i$4 >= reflectFields.$length) ? $throwRuntimeError("index out of range") : reflectFields.$array[reflectFields.$offset + i$4]), new structField.ptr(newStringPtr(f.name), newStringPtr(f.pkg), reflectType(f.typ), newStringPtr(f.tag), (i$4 >>> 0))); - _i$4++; - } - setKindType(rt, new structType.ptr($clone(rt, rtype), reflectFields)); - } - } - return typ.reflectType; - }; - setKindType = function(rt, kindType) { - var $ptr, kindType, rt; - rt.kindType = kindType; - kindType.rtype = rt; - }; - newStringPtr = function(strObj) { - var $ptr, _entry, _key, _tuple, c, ok, ptr, str, str$24ptr, strObj; - c = new structType$6.ptr(""); - c.str = strObj; - str = c.str; - if (str === "") { - return ptrType$6.nil; - } - _tuple = (_entry = stringPtrMap[$String.keyFor(str)], _entry !== undefined ? [_entry.v, true] : [ptrType$6.nil, false]); - ptr = _tuple[0]; - ok = _tuple[1]; - if (!ok) { - ptr = (str$24ptr || (str$24ptr = new ptrType$6(function() { return str; }, function($v) { str = $v; }))); - _key = str; (stringPtrMap || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: ptr }; - } - return ptr; - }; - isWrapped = function(typ) { - var $ptr, typ; - return !!(jsType(typ).wrapped); - }; - copyStruct = function(dst, src, typ) { - var $ptr, dst, fields, i, prop, src, typ; - fields = jsType(typ).fields; - i = 0; - while (true) { - if (!(i < $parseInt(fields.length))) { break; } - prop = $internalize(fields[i].prop, $String); - dst[$externalize(prop, $String)] = src[$externalize(prop, $String)]; - i = i + (1) >> 0; - } - }; - makeValue = function(t, v, fl) { - var $ptr, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _v, _v$1, fl, rt, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _v = $f._v; _v$1 = $f._v$1; fl = $f.fl; rt = $f.rt; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - rt = _r; - _r$1 = t.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - if (_r$1 === 17) { _v$1 = true; $s = 5; continue s; } - _r$2 = t.Kind(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _v$1 = _r$2 === 25; case 5: - if (_v$1) { _v = true; $s = 4; continue s; } - _r$3 = t.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _v = _r$3 === 22; case 4: - /* */ if (_v) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (_v) { */ case 2: - _r$4 = t.Kind(); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - /* */ $s = 10; case 10: - return new Value.ptr(rt, v, (fl | (_r$4 >>> 0)) >>> 0); - /* } */ case 3: - _r$5 = t.Kind(); /* */ $s = 11; case 11: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - /* */ $s = 12; case 12: - return new Value.ptr(rt, $newDataPointer(v, jsType(rt.ptrTo())), (((fl | (_r$5 >>> 0)) >>> 0) | 128) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: makeValue }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._v = _v; $f._v$1 = _v$1; $f.fl = fl; $f.rt = rt; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - MakeSlice = function(typ, len, cap) { - var $ptr, _r, _r$1, cap, len, typ, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; cap = $f.cap; len = $f.len; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - typ = [typ]; - _r = typ[0].Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!((_r === 23))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((_r === 23))) { */ case 1: - $panic(new $String("reflect.MakeSlice of non-slice type")); - /* } */ case 2: - if (len < 0) { - $panic(new $String("reflect.MakeSlice: negative len")); - } - if (cap < 0) { - $panic(new $String("reflect.MakeSlice: negative cap")); - } - if (len > cap) { - $panic(new $String("reflect.MakeSlice: len > cap")); - } - _r$1 = makeValue(typ[0], $makeSlice(jsType(typ[0]), len, cap, (function(typ) { return function $b() { - var $ptr, _r$1, _r$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$1 = typ[0].Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = jsType(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ $s = 3; case 3: - return _r$2.zero(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.$s = $s; $f.$r = $r; return $f; - }; })(typ)), 0); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 5; case 5: - return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: MakeSlice }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.cap = cap; $f.len = len; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.MakeSlice = MakeSlice; - TypeOf = function(i) { - var $ptr, i; - if (!initialized) { - return new rtype.ptr(0, 0, 0, 0, 0, 0, 0, ptrType$4.nil, ptrType$5.nil, ptrType$6.nil, ptrType$7.nil, ptrType$1.nil); - } - if ($interfaceIsEqual(i, $ifaceNil)) { - return $ifaceNil; - } - return reflectType(i.constructor); - }; - $pkg.TypeOf = TypeOf; - ValueOf = function(i) { - var $ptr, _r, i, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - if ($interfaceIsEqual(i, $ifaceNil)) { - return new Value.ptr(ptrType$1.nil, 0, 0); - } - _r = makeValue(reflectType(i.constructor), i.$val, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: ValueOf }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.ValueOf = ValueOf; - rtype.ptr.prototype.ptrTo = function() { - var $ptr, t; - t = this; - return reflectType($ptrType(jsType(t))); - }; - rtype.prototype.ptrTo = function() { return this.$val.ptrTo(); }; - SliceOf = function(t) { - var $ptr, t; - return reflectType($sliceType(jsType(t))); - }; - $pkg.SliceOf = SliceOf; - Zero = function(typ) { - var $ptr, _r, typ, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = makeValue(typ, jsType(typ).zero(), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Zero }; } $f.$ptr = $ptr; $f._r = _r; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Zero = Zero; - unsafe_New = function(typ) { - var $ptr, _3, typ; - _3 = typ.Kind(); - if (_3 === (25)) { - return new (jsType(typ).ptr)(); - } else if (_3 === (17)) { - return jsType(typ).zero(); - } else { - return $newDataPointer(jsType(typ).zero(), jsType(typ.ptrTo())); - } - }; - makeInt = function(f, bits, t) { - var $ptr, _4, _r, bits, f, ptr, t, typ, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _4 = $f._4; _r = $f._r; bits = $f.bits; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - typ = _r; - ptr = unsafe_New(typ); - _4 = typ.Kind(); - if (_4 === (3)) { - ptr.$set((bits.$low << 24 >> 24)); - } else if (_4 === (4)) { - ptr.$set((bits.$low << 16 >> 16)); - } else if ((_4 === (2)) || (_4 === (5))) { - ptr.$set((bits.$low >> 0)); - } else if (_4 === (6)) { - ptr.$set(new $Int64(bits.$high, bits.$low)); - } else if (_4 === (8)) { - ptr.$set((bits.$low << 24 >>> 24)); - } else if (_4 === (9)) { - ptr.$set((bits.$low << 16 >>> 16)); - } else if ((_4 === (7)) || (_4 === (10)) || (_4 === (12))) { - ptr.$set((bits.$low >>> 0)); - } else if (_4 === (11)) { - ptr.$set(bits); - } - return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | (typ.Kind() >>> 0)) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: makeInt }; } $f.$ptr = $ptr; $f._4 = _4; $f._r = _r; $f.bits = bits; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; - }; - typedmemmove = function(t, dst, src) { - var $ptr, dst, src, t; - dst.$set(src.$get()); - }; - keyFor = function(t, key) { - var $ptr, k, key, kv, t; - kv = key; - if (!(kv.$get === undefined)) { - kv = kv.$get(); - } - k = $internalize(jsType(t.Key()).keyFor(kv), $String); - return [kv, k]; - }; - mapaccess = function(t, m, key) { - var $ptr, _tuple, entry, k, key, m, t; - _tuple = keyFor(t, key); - k = _tuple[1]; - entry = m[$externalize(k, $String)]; - if (entry === undefined) { - return 0; - } - return $newDataPointer(entry.v, jsType(PtrTo(t.Elem()))); - }; - mapassign = function(t, m, key, val) { - var $ptr, _r, _tuple, entry, et, jsVal, k, key, kv, m, newVal, t, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; entry = $f.entry; et = $f.et; jsVal = $f.jsVal; k = $f.k; key = $f.key; kv = $f.kv; m = $f.m; newVal = $f.newVal; t = $f.t; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _tuple = keyFor(t, key); - kv = _tuple[0]; - k = _tuple[1]; - jsVal = val.$get(); - et = t.Elem(); - _r = et.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (_r === 25) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (_r === 25) { */ case 1: - newVal = jsType(et).zero(); - copyStruct(newVal, jsVal, et); - jsVal = newVal; - /* } */ case 2: - entry = new ($global.Object)(); - entry.k = kv; - entry.v = jsVal; - m[$externalize(k, $String)] = entry; - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: mapassign }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.entry = entry; $f.et = et; $f.jsVal = jsVal; $f.k = k; $f.key = key; $f.kv = kv; $f.m = m; $f.newVal = newVal; $f.t = t; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; - }; - mapdelete = function(t, m, key) { - var $ptr, _tuple, k, key, m, t; - _tuple = keyFor(t, key); - k = _tuple[1]; - delete m[$externalize(k, $String)]; - }; - mapiterinit = function(t, m) { - var $ptr, m, t; - return new mapIter.ptr(t, m, $keys(m), 0); - }; - mapiterkey = function(it) { - var $ptr, _r, _r$1, _r$2, it, iter, k, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; it = $f.it; iter = $f.iter; k = $f.k; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - iter = it; - k = iter.keys[iter.i]; - _r = iter.t.Key(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = PtrTo(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = jsType(_r$1); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return $newDataPointer(iter.m[$externalize($internalize(k, $String), $String)].k, _r$2); - /* */ } return; } if ($f === undefined) { $f = { $blk: mapiterkey }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.it = it; $f.iter = iter; $f.k = k; $f.$s = $s; $f.$r = $r; return $f; - }; - mapiternext = function(it) { - var $ptr, it, iter; - iter = it; - iter.i = iter.i + (1) >> 0; - }; - maplen = function(m) { - var $ptr, m; - return $parseInt($keys(m).length); - }; - cvtDirect = function(v, typ) { - var $ptr, _6, _arg, _arg$1, _arg$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, k, slice, srcVal, typ, v, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _6 = $f._6; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; k = $f.k; slice = $f.slice; srcVal = $f.srcVal; typ = $f.typ; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - srcVal = v.object(); - /* */ if (srcVal === jsType(v.typ).nil) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (srcVal === jsType(v.typ).nil) { */ case 1: - _r = makeValue(typ, jsType(typ).nil, v.flag); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return _r; - /* } */ case 2: - val = null; - _r$1 = typ.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - k = _r$1; - _6 = k; - /* */ if (_6 === (23)) { $s = 7; continue; } - /* */ if (_6 === (22)) { $s = 8; continue; } - /* */ if (_6 === (25)) { $s = 9; continue; } - /* */ if ((_6 === (17)) || (_6 === (1)) || (_6 === (18)) || (_6 === (19)) || (_6 === (20)) || (_6 === (21)) || (_6 === (24))) { $s = 10; continue; } - /* */ $s = 11; continue; - /* if (_6 === (23)) { */ case 7: - slice = new (jsType(typ))(srcVal.$array); - slice.$offset = srcVal.$offset; - slice.$length = srcVal.$length; - slice.$capacity = srcVal.$capacity; - val = $newDataPointer(slice, jsType(PtrTo(typ))); - $s = 12; continue; - /* } else if (_6 === (22)) { */ case 8: - _r$2 = typ.Elem(); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = _r$2.Kind(); /* */ $s = 16; case 16: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (_r$3 === 25) { $s = 13; continue; } - /* */ $s = 14; continue; - /* if (_r$3 === 25) { */ case 13: - _r$4 = typ.Elem(); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - /* */ if ($interfaceIsEqual(_r$4, v.typ.Elem())) { $s = 17; continue; } - /* */ $s = 18; continue; - /* if ($interfaceIsEqual(_r$4, v.typ.Elem())) { */ case 17: - val = srcVal; - /* break; */ $s = 5; continue; - /* } */ case 18: - val = new (jsType(typ))(); - _arg = val; - _arg$1 = srcVal; - _r$5 = typ.Elem(); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _arg$2 = _r$5; - $r = copyStruct(_arg, _arg$1, _arg$2); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* break; */ $s = 5; continue; - /* } */ case 14: - val = new (jsType(typ))(srcVal.$get, srcVal.$set); - $s = 12; continue; - /* } else if (_6 === (25)) { */ case 9: - val = new (jsType(typ).ptr)(); - copyStruct(val, srcVal, typ); - $s = 12; continue; - /* } else if ((_6 === (17)) || (_6 === (1)) || (_6 === (18)) || (_6 === (19)) || (_6 === (20)) || (_6 === (21)) || (_6 === (24))) { */ case 10: - val = v.ptr; - $s = 12; continue; - /* } else { */ case 11: - $panic(new ValueError.ptr("reflect.Convert", k)); - /* } */ case 12: - case 5: - _r$6 = typ.common(); /* */ $s = 22; case 22: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _r$7 = typ.Kind(); /* */ $s = 23; case 23: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - /* */ $s = 24; case 24: - return new Value.ptr(_r$6, val, (((v.flag & 224) >>> 0) | (_r$7 >>> 0)) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtDirect }; } $f.$ptr = $ptr; $f._6 = _6; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f.k = k; $f.slice = slice; $f.srcVal = srcVal; $f.typ = typ; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; - }; - methodReceiver = function(op, v, i) { - var $ptr, fn, i, iface, m, m$1, op, prop, rcvr, rcvrtype, t, tt, ut, v, x, x$1; - rcvrtype = ptrType$1.nil; - t = ptrType$1.nil; - fn = 0; - v = v; - prop = ""; - if (v.typ.Kind() === 20) { - tt = v.typ.kindType; - if (i < 0 || i >= tt.methods.$length) { - $panic(new $String("reflect: internal error: invalid method index")); - } - m = (x = tt.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - if (!(m.pkgPath === ptrType$6.nil)) { - $panic(new $String("reflect: " + op + " of unexported method")); - } - iface = $pointerOfStructConversion(v.ptr, ptrType$8); - if (iface.itab === ptrType$9.nil) { - $panic(new $String("reflect: " + op + " of method on nil interface value")); - } - t = m.typ; - prop = m.name.$get(); - } else { - ut = v.typ.uncommonType.uncommon(); - if (ut === ptrType$7.nil || i < 0 || i >= ut.methods.$length) { - $panic(new $String("reflect: internal error: invalid method index")); - } - m$1 = (x$1 = ut.methods, ((i < 0 || i >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + i])); - if (!(m$1.pkgPath === ptrType$6.nil)) { - $panic(new $String("reflect: " + op + " of unexported method")); - } - t = m$1.mtyp; - prop = $internalize($methodSet(jsType(v.typ))[i].prop, $String); - } - rcvr = v.object(); - if (isWrapped(v.typ)) { - rcvr = new (jsType(v.typ))(rcvr); - } - fn = rcvr[$externalize(prop, $String)]; - return [rcvrtype, t, fn]; - }; - valueInterface = function(v, safe) { - var $ptr, _r, safe, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; safe = $f.safe; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - if (v.flag === 0) { - $panic(new ValueError.ptr("reflect.Value.Interface", 0)); - } - if (safe && !((((v.flag & 96) >>> 0) === 0))) { - $panic(new $String("reflect.Value.Interface: cannot return value obtained from unexported field or method")); - } - /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: - _r = makeMethodValue("Interface", v); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - v = _r; - /* } */ case 2: - if (isWrapped(v.typ)) { - return new (jsType(v.typ))(v.object()); - } - return v.object(); - /* */ } return; } if ($f === undefined) { $f = { $blk: valueInterface }; } $f.$ptr = $ptr; $f._r = _r; $f.safe = safe; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - ifaceE2I = function(t, src, dst) { - var $ptr, dst, src, t; - dst.$set(src); - }; - methodName = function() { - var $ptr; - return "?FIXME?"; - }; - makeMethodValue = function(op, v) { - var $ptr, _r, _tuple, fn, fv, op, rcvr, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; fn = $f.fn; fv = $f.fv; op = $f.op; rcvr = $f.rcvr; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fn = [fn]; - rcvr = [rcvr]; - v = v; - if (((v.flag & 512) >>> 0) === 0) { - $panic(new $String("reflect: internal error: invalid use of makePartialFunc")); - } - _tuple = methodReceiver(op, v, (v.flag >> 0) >> 10 >> 0); - fn[0] = _tuple[2]; - rcvr[0] = v.object(); - if (isWrapped(v.typ)) { - rcvr[0] = new (jsType(v.typ))(rcvr[0]); - } - fv = $makeFunc((function(fn, rcvr) { return function(arguments$1) { - var $ptr, arguments$1; - return fn[0].apply(rcvr[0], $externalize(arguments$1, sliceType$7)); - }; })(fn, rcvr)); - _r = v.Type().common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return new Value.ptr(_r, fv, (((v.flag & 96) >>> 0) | 19) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: makeMethodValue }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.fn = fn; $f.fv = fv; $f.op = op; $f.rcvr = rcvr; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.ptr.prototype.pointers = function() { - var $ptr, _7, t; - t = this; - _7 = t.Kind(); - if ((_7 === (22)) || (_7 === (21)) || (_7 === (18)) || (_7 === (19)) || (_7 === (25)) || (_7 === (17))) { - return true; - } else { - return false; - } - }; - rtype.prototype.pointers = function() { return this.$val.pointers(); }; - rtype.ptr.prototype.Comparable = function() { - var $ptr, _8, _r, _r$1, _r$2, i, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _8 = $f._8; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; i = $f.i; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - _8 = t.Kind(); - /* */ if ((_8 === (19)) || (_8 === (23)) || (_8 === (21))) { $s = 2; continue; } - /* */ if (_8 === (17)) { $s = 3; continue; } - /* */ if (_8 === (25)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if ((_8 === (19)) || (_8 === (23)) || (_8 === (21))) { */ case 2: - return false; - /* } else if (_8 === (17)) { */ case 3: - _r = t.Elem().Comparable(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 7; case 7: - return _r; - /* } else if (_8 === (25)) { */ case 4: - i = 0; - /* while (true) { */ case 8: - /* if (!(i < t.NumField())) { break; } */ if(!(i < t.NumField())) { $s = 9; continue; } - _r$1 = t.Field(i); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = _r$1.Type.Comparable(); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ if (!_r$2) { $s = 10; continue; } - /* */ $s = 11; continue; - /* if (!_r$2) { */ case 10: - return false; - /* } */ case 11: - i = i + (1) >> 0; - /* } */ $s = 8; continue; case 9: - /* } */ case 5: - case 1: - return true; - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Comparable }; } $f.$ptr = $ptr; $f._8 = _8; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.i = i; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.Comparable = function() { return this.$val.Comparable(); }; - uncommonType.ptr.prototype.Method = function(i) { - var $ptr, fl, fn, i, m, mt, p, prop, t, x; - m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - t = this; - if (t === ptrType$7.nil || i < 0 || i >= t.methods.$length) { - $panic(new $String("reflect: Method index out of range")); - } - p = (x = t.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - if (!(p.name === ptrType$6.nil)) { - m.Name = p.name.$get(); - } - fl = 19; - if (!(p.pkgPath === ptrType$6.nil)) { - m.PkgPath = p.pkgPath.$get(); - fl = (fl | (32)) >>> 0; - } - mt = p.typ; - m.Type = mt; - prop = $internalize($methodSet(t.jsType)[i].prop, $String); - fn = $makeFunc((function(arguments$1) { - var $ptr, arguments$1, rcvr; - rcvr = (0 >= arguments$1.$length ? $throwRuntimeError("index out of range") : arguments$1.$array[arguments$1.$offset + 0]); - return rcvr[$externalize(prop, $String)].apply(rcvr, $externalize($subslice(arguments$1, 1), sliceType$7)); - })); - m.Func = new Value.ptr(mt, fn, fl); - m.Index = i; - return m; - }; - uncommonType.prototype.Method = function(i) { return this.$val.Method(i); }; - Value.ptr.prototype.object = function() { - var $ptr, _9, newVal, v, val; - v = this; - if ((v.typ.Kind() === 17) || (v.typ.Kind() === 25)) { - return v.ptr; - } - if (!((((v.flag & 128) >>> 0) === 0))) { - val = v.ptr.$get(); - if (!(val === $ifaceNil) && !(val.constructor === jsType(v.typ))) { - switch (0) { default: - _9 = v.typ.Kind(); - if ((_9 === (11)) || (_9 === (6))) { - val = new (jsType(v.typ))(val.$high, val.$low); - } else if ((_9 === (15)) || (_9 === (16))) { - val = new (jsType(v.typ))(val.$real, val.$imag); - } else if (_9 === (23)) { - if (val === val.constructor.nil) { - val = jsType(v.typ).nil; - break; - } - newVal = new (jsType(v.typ))(val.$array); - newVal.$offset = val.$offset; - newVal.$length = val.$length; - newVal.$capacity = val.$capacity; - val = newVal; - } - } - } - return val; - } - return v.ptr; - }; - Value.prototype.object = function() { return this.$val.object(); }; - Value.ptr.prototype.call = function(op, in$1) { - var $ptr, _10, _arg, _arg$1, _arg$2, _arg$3, _i, _i$1, _i$2, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _ref$2, _tmp, _tmp$1, _tuple, arg, argsArray, elem, fn, i, i$1, i$2, i$3, in$1, isSlice, m, n, nin, nout, op, origIn, rcvr, results, ret, slice, t, targ, v, x, x$1, x$2, xt, xt$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _10 = $f._10; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _i = $f._i; _i$1 = $f._i$1; _i$2 = $f._i$2; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _ref$2 = $f._ref$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; arg = $f.arg; argsArray = $f.argsArray; elem = $f.elem; fn = $f.fn; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; in$1 = $f.in$1; isSlice = $f.isSlice; m = $f.m; n = $f.n; nin = $f.nin; nout = $f.nout; op = $f.op; origIn = $f.origIn; rcvr = $f.rcvr; results = $f.results; ret = $f.ret; slice = $f.slice; t = $f.t; targ = $f.targ; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; xt = $f.xt; xt$1 = $f.xt$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - t = v.typ; - fn = 0; - rcvr = null; - if (!((((v.flag & 512) >>> 0) === 0))) { - _tuple = methodReceiver(op, v, (v.flag >> 0) >> 10 >> 0); - t = _tuple[1]; - fn = _tuple[2]; - rcvr = v.object(); - if (isWrapped(v.typ)) { - rcvr = new (jsType(v.typ))(rcvr); - } - } else { - fn = v.object(); - rcvr = undefined; - } - if (fn === 0) { - $panic(new $String("reflect.Value.Call: call of nil function")); - } - isSlice = op === "CallSlice"; - n = t.NumIn(); - if (isSlice) { - if (!t.IsVariadic()) { - $panic(new $String("reflect: CallSlice of non-variadic function")); - } - if (in$1.$length < n) { - $panic(new $String("reflect: CallSlice with too few input arguments")); - } - if (in$1.$length > n) { - $panic(new $String("reflect: CallSlice with too many input arguments")); - } - } else { - if (t.IsVariadic()) { - n = n - (1) >> 0; - } - if (in$1.$length < n) { - $panic(new $String("reflect: Call with too few input arguments")); - } - if (!t.IsVariadic() && in$1.$length > n) { - $panic(new $String("reflect: Call with too many input arguments")); - } - } - _ref = in$1; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - x = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (x.Kind() === 0) { - $panic(new $String("reflect: " + op + " using zero Value argument")); - } - _i++; - } - i = 0; - /* while (true) { */ case 1: - /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } - _tmp = ((i < 0 || i >= in$1.$length) ? $throwRuntimeError("index out of range") : in$1.$array[in$1.$offset + i]).Type(); - _tmp$1 = t.In(i); - xt = _tmp; - targ = _tmp$1; - _r = xt.AssignableTo(targ); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!_r) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (!_r) { */ case 3: - _r$1 = xt.String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = targ.String(); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $panic(new $String("reflect: " + op + " using " + _r$1 + " as type " + _r$2)); - /* } */ case 4: - i = i + (1) >> 0; - /* } */ $s = 1; continue; case 2: - /* */ if (!isSlice && t.IsVariadic()) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if (!isSlice && t.IsVariadic()) { */ case 8: - m = in$1.$length - n >> 0; - _r$3 = MakeSlice(t.In(n), m, m); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - slice = _r$3; - _r$4 = t.In(n).Elem(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - elem = _r$4; - i$1 = 0; - /* while (true) { */ case 12: - /* if (!(i$1 < m)) { break; } */ if(!(i$1 < m)) { $s = 13; continue; } - x$2 = (x$1 = n + i$1 >> 0, ((x$1 < 0 || x$1 >= in$1.$length) ? $throwRuntimeError("index out of range") : in$1.$array[in$1.$offset + x$1])); - xt$1 = x$2.Type(); - _r$5 = xt$1.AssignableTo(elem); /* */ $s = 16; case 16: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - /* */ if (!_r$5) { $s = 14; continue; } - /* */ $s = 15; continue; - /* if (!_r$5) { */ case 14: - _r$6 = xt$1.String(); /* */ $s = 17; case 17: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _r$7 = elem.String(); /* */ $s = 18; case 18: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - $panic(new $String("reflect: cannot use " + _r$6 + " as type " + _r$7 + " in " + op)); - /* } */ case 15: - _r$8 = slice.Index(i$1); /* */ $s = 19; case 19: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } - $r = _r$8.Set(x$2); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - i$1 = i$1 + (1) >> 0; - /* } */ $s = 12; continue; case 13: - origIn = in$1; - in$1 = $makeSlice(sliceType$8, (n + 1 >> 0)); - $copySlice($subslice(in$1, 0, n), origIn); - ((n < 0 || n >= in$1.$length) ? $throwRuntimeError("index out of range") : in$1.$array[in$1.$offset + n] = slice); - /* } */ case 9: - nin = in$1.$length; - if (!((nin === t.NumIn()))) { - $panic(new $String("reflect.Value.Call: wrong argument count")); - } - nout = t.NumOut(); - argsArray = new ($global.Array)(t.NumIn()); - _ref$1 = in$1; - _i$1 = 0; - /* while (true) { */ case 21: - /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 22; continue; } - i$2 = _i$1; - arg = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); - _arg = t.In(i$2); - _r$9 = t.In(i$2).common(); /* */ $s = 23; case 23: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } - _arg$1 = _r$9; - _arg$2 = 0; - _r$10 = arg.assignTo("reflect.Value.Call", _arg$1, _arg$2); /* */ $s = 24; case 24: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } - _r$11 = _r$10.object(); /* */ $s = 25; case 25: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } - _arg$3 = _r$11; - _r$12 = unwrapJsObject(_arg, _arg$3); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } - argsArray[i$2] = _r$12; - _i$1++; - /* } */ $s = 21; continue; case 22: - _r$13 = callHelper(new sliceType$2([new $jsObjectPtr(fn), new $jsObjectPtr(rcvr), new $jsObjectPtr(argsArray)])); /* */ $s = 27; case 27: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } - results = _r$13; - _10 = nout; - /* */ if (_10 === (0)) { $s = 29; continue; } - /* */ if (_10 === (1)) { $s = 30; continue; } - /* */ $s = 31; continue; - /* if (_10 === (0)) { */ case 29: - return sliceType$8.nil; - /* } else if (_10 === (1)) { */ case 30: - _r$14 = makeValue(t.Out(0), wrapJsObject(t.Out(0), results), 0); /* */ $s = 33; case 33: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } - /* */ $s = 34; case 34: - return new sliceType$8([$clone(_r$14, Value)]); - /* } else { */ case 31: - ret = $makeSlice(sliceType$8, nout); - _ref$2 = ret; - _i$2 = 0; - /* while (true) { */ case 35: - /* if (!(_i$2 < _ref$2.$length)) { break; } */ if(!(_i$2 < _ref$2.$length)) { $s = 36; continue; } - i$3 = _i$2; - _r$15 = makeValue(t.Out(i$3), wrapJsObject(t.Out(i$3), results[i$3]), 0); /* */ $s = 37; case 37: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } - ((i$3 < 0 || i$3 >= ret.$length) ? $throwRuntimeError("index out of range") : ret.$array[ret.$offset + i$3] = _r$15); - _i$2++; - /* } */ $s = 35; continue; case 36: - return ret; - /* } */ case 32: - case 28: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.call }; } $f.$ptr = $ptr; $f._10 = _10; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._i = _i; $f._i$1 = _i$1; $f._i$2 = _i$2; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._ref$2 = _ref$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.arg = arg; $f.argsArray = argsArray; $f.elem = elem; $f.fn = fn; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.in$1 = in$1; $f.isSlice = isSlice; $f.m = m; $f.n = n; $f.nin = nin; $f.nout = nout; $f.op = op; $f.origIn = origIn; $f.rcvr = rcvr; $f.results = results; $f.ret = ret; $f.slice = slice; $f.t = t; $f.targ = targ; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.xt = xt; $f.xt$1 = xt$1; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.call = function(op, in$1) { return this.$val.call(op, in$1); }; - Value.ptr.prototype.Cap = function() { - var $ptr, _11, k, v; - v = this; - k = new flag(v.flag).kind(); - _11 = k; - if (_11 === (17)) { - return v.typ.Len(); - } else if ((_11 === (18)) || (_11 === (23))) { - return $parseInt(v.object().$capacity) >> 0; - } - $panic(new ValueError.ptr("reflect.Value.Cap", k)); - }; - Value.prototype.Cap = function() { return this.$val.Cap(); }; - wrapJsObject = function(typ, val) { - var $ptr, typ, val; - if ($interfaceIsEqual(typ, jsObjectPtr)) { - return new (jsType(jsObjectPtr))(val); - } - return val; - }; - unwrapJsObject = function(typ, val) { - var $ptr, typ, val; - if ($interfaceIsEqual(typ, jsObjectPtr)) { - return val.object; - } - return val; - }; - Value.ptr.prototype.Elem = function() { - var $ptr, _12, _r, fl, k, tt, typ, v, val, val$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _12 = $f._12; _r = $f._r; fl = $f.fl; k = $f.k; tt = $f.tt; typ = $f.typ; v = $f.v; val = $f.val; val$1 = $f.val$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - k = new flag(v.flag).kind(); - _12 = k; - /* */ if (_12 === (20)) { $s = 2; continue; } - /* */ if (_12 === (22)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (_12 === (20)) { */ case 2: - val = v.object(); - if (val === $ifaceNil) { - return new Value.ptr(ptrType$1.nil, 0, 0); - } - typ = reflectType(val.constructor); - _r = makeValue(typ, val.$val, (v.flag & 96) >>> 0); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 7; case 7: - return _r; - /* } else if (_12 === (22)) { */ case 3: - if (v.IsNil()) { - return new Value.ptr(ptrType$1.nil, 0, 0); - } - val$1 = v.object(); - tt = v.typ.kindType; - fl = (((((v.flag & 96) >>> 0) | 128) >>> 0) | 256) >>> 0; - fl = (fl | ((tt.elem.Kind() >>> 0))) >>> 0; - return new Value.ptr(tt.elem, wrapJsObject(tt.elem, val$1), fl); - /* } else { */ case 4: - $panic(new ValueError.ptr("reflect.Value.Elem", k)); - /* } */ case 5: - case 1: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Elem }; } $f.$ptr = $ptr; $f._12 = _12; $f._r = _r; $f.fl = fl; $f.k = k; $f.tt = tt; $f.typ = typ; $f.v = v; $f.val = val; $f.val$1 = val$1; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Elem = function() { return this.$val.Elem(); }; - Value.ptr.prototype.Field = function(i) { - var $ptr, _r, _r$1, _r$2, field, fl, i, jsTag, o, prop, s, tag, tt, typ, v, x, x$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; field = $f.field; fl = $f.fl; i = $f.i; jsTag = $f.jsTag; o = $f.o; prop = $f.prop; s = $f.s; tag = $f.tag; tt = $f.tt; typ = $f.typ; v = $f.v; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - jsTag = [jsTag]; - prop = [prop]; - s = [s]; - typ = [typ]; - v = this; - new flag(v.flag).mustBe(25); - tt = v.typ.kindType; - if (i < 0 || i >= tt.fields.$length) { - $panic(new $String("reflect: Field index out of range")); - } - prop[0] = $internalize(jsType(v.typ).fields[i].prop, $String); - field = (x = tt.fields, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - typ[0] = field.typ; - fl = (((v.flag & 416) >>> 0) | (typ[0].Kind() >>> 0)) >>> 0; - if (!(field.pkgPath === ptrType$6.nil)) { - if (field.name === ptrType$6.nil) { - fl = (fl | (64)) >>> 0; - } else { - fl = (fl | (32)) >>> 0; - } - } - tag = (x$1 = tt.fields, ((i < 0 || i >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + i])).tag; - /* */ if (!(tag === ptrType$6.nil) && !((i === 0))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!(tag === ptrType$6.nil) && !((i === 0))) { */ case 1: - jsTag[0] = getJsTag(tag.$get()); - /* */ if (!(jsTag[0] === "")) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (!(jsTag[0] === "")) { */ case 3: - /* while (true) { */ case 5: - o = [o]; - _r = v.Field(0); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - v = _r; - /* */ if (v.typ === jsObjectPtr) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if (v.typ === jsObjectPtr) { */ case 8: - o[0] = v.object().object; - return new Value.ptr(typ[0], new (jsType(PtrTo(typ[0])))((function(jsTag, o, prop, s, typ) { return function() { - var $ptr; - return $internalize(o[0][$externalize(jsTag[0], $String)], jsType(typ[0])); - }; })(jsTag, o, prop, s, typ), (function(jsTag, o, prop, s, typ) { return function(x$2) { - var $ptr, x$2; - o[0][$externalize(jsTag[0], $String)] = $externalize(x$2, jsType(typ[0])); - }; })(jsTag, o, prop, s, typ)), fl); - /* } */ case 9: - /* */ if (v.typ.Kind() === 22) { $s = 10; continue; } - /* */ $s = 11; continue; - /* if (v.typ.Kind() === 22) { */ case 10: - _r$1 = v.Elem(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - v = _r$1; - /* } */ case 11: - /* } */ $s = 5; continue; case 6: - /* } */ case 4: - /* } */ case 2: - s[0] = v.ptr; - /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 13; continue; } - /* */ $s = 14; continue; - /* if (!((((fl & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 13: - return new Value.ptr(typ[0], new (jsType(PtrTo(typ[0])))((function(jsTag, prop, s, typ) { return function() { - var $ptr; - return wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]); - }; })(jsTag, prop, s, typ), (function(jsTag, prop, s, typ) { return function(x$2) { - var $ptr, x$2; - s[0][$externalize(prop[0], $String)] = unwrapJsObject(typ[0], x$2); - }; })(jsTag, prop, s, typ)), fl); - /* } */ case 14: - _r$2 = makeValue(typ[0], wrapJsObject(typ[0], s[0][$externalize(prop[0], $String)]), fl); /* */ $s = 15; case 15: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ $s = 16; case 16: - return _r$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Field }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.field = field; $f.fl = fl; $f.i = i; $f.jsTag = jsTag; $f.o = o; $f.prop = prop; $f.s = s; $f.tag = tag; $f.tt = tt; $f.typ = typ; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Field = function(i) { return this.$val.Field(i); }; - getJsTag = function(tag) { - var $ptr, _tuple, i, name, qvalue, tag, value; - while (true) { - if (!(!(tag === ""))) { break; } - i = 0; - while (true) { - if (!(i < tag.length && (tag.charCodeAt(i) === 32))) { break; } - i = i + (1) >> 0; - } - tag = tag.substring(i); - if (tag === "") { - break; - } - i = 0; - while (true) { - if (!(i < tag.length && !((tag.charCodeAt(i) === 32)) && !((tag.charCodeAt(i) === 58)) && !((tag.charCodeAt(i) === 34)))) { break; } - i = i + (1) >> 0; - } - if ((i + 1 >> 0) >= tag.length || !((tag.charCodeAt(i) === 58)) || !((tag.charCodeAt((i + 1 >> 0)) === 34))) { - break; - } - name = tag.substring(0, i); - tag = tag.substring((i + 1 >> 0)); - i = 1; - while (true) { - if (!(i < tag.length && !((tag.charCodeAt(i) === 34)))) { break; } - if (tag.charCodeAt(i) === 92) { - i = i + (1) >> 0; - } - i = i + (1) >> 0; - } - if (i >= tag.length) { - break; - } - qvalue = tag.substring(0, (i + 1 >> 0)); - tag = tag.substring((i + 1 >> 0)); - if (name === "js") { - _tuple = strconv.Unquote(qvalue); - value = _tuple[0]; - return value; - } - } - return ""; - }; - Value.ptr.prototype.Index = function(i) { - var $ptr, _13, _r, _r$1, a, a$1, c, fl, fl$1, fl$2, i, k, s, str, tt, tt$1, typ, typ$1, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _13 = $f._13; _r = $f._r; _r$1 = $f._r$1; a = $f.a; a$1 = $f.a$1; c = $f.c; fl = $f.fl; fl$1 = $f.fl$1; fl$2 = $f.fl$2; i = $f.i; k = $f.k; s = $f.s; str = $f.str; tt = $f.tt; tt$1 = $f.tt$1; typ = $f.typ; typ$1 = $f.typ$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - a = [a]; - a$1 = [a$1]; - c = [c]; - i = [i]; - typ = [typ]; - typ$1 = [typ$1]; - v = this; - k = new flag(v.flag).kind(); - _13 = k; - /* */ if (_13 === (17)) { $s = 2; continue; } - /* */ if (_13 === (23)) { $s = 3; continue; } - /* */ if (_13 === (24)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_13 === (17)) { */ case 2: - tt = v.typ.kindType; - if (i[0] < 0 || i[0] > (tt.len >> 0)) { - $panic(new $String("reflect: array index out of range")); - } - typ$1[0] = tt.elem; - fl = (v.flag & 480) >>> 0; - fl = (fl | ((typ$1[0].Kind() >>> 0))) >>> 0; - a$1[0] = v.ptr; - /* */ if (!((((fl & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (!((((fl & 128) >>> 0) === 0)) && !((typ$1[0].Kind() === 17)) && !((typ$1[0].Kind() === 25))) { */ case 7: - return new Value.ptr(typ$1[0], new (jsType(PtrTo(typ$1[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { - var $ptr; - return wrapJsObject(typ$1[0], a$1[0][i[0]]); - }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { - var $ptr, x; - a$1[0][i[0]] = unwrapJsObject(typ$1[0], x); - }; })(a, a$1, c, i, typ, typ$1)), fl); - /* } */ case 8: - _r = makeValue(typ$1[0], wrapJsObject(typ$1[0], a$1[0][i[0]]), fl); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 10; case 10: - return _r; - /* } else if (_13 === (23)) { */ case 3: - s = v.object(); - if (i[0] < 0 || i[0] >= ($parseInt(s.$length) >> 0)) { - $panic(new $String("reflect: slice index out of range")); - } - tt$1 = v.typ.kindType; - typ[0] = tt$1.elem; - fl$1 = (384 | ((v.flag & 96) >>> 0)) >>> 0; - fl$1 = (fl$1 | ((typ[0].Kind() >>> 0))) >>> 0; - i[0] = i[0] + (($parseInt(s.$offset) >> 0)) >> 0; - a[0] = s.$array; - /* */ if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { $s = 11; continue; } - /* */ $s = 12; continue; - /* if (!((((fl$1 & 128) >>> 0) === 0)) && !((typ[0].Kind() === 17)) && !((typ[0].Kind() === 25))) { */ case 11: - return new Value.ptr(typ[0], new (jsType(PtrTo(typ[0])))((function(a, a$1, c, i, typ, typ$1) { return function() { - var $ptr; - return wrapJsObject(typ[0], a[0][i[0]]); - }; })(a, a$1, c, i, typ, typ$1), (function(a, a$1, c, i, typ, typ$1) { return function(x) { - var $ptr, x; - a[0][i[0]] = unwrapJsObject(typ[0], x); - }; })(a, a$1, c, i, typ, typ$1)), fl$1); - /* } */ case 12: - _r$1 = makeValue(typ[0], wrapJsObject(typ[0], a[0][i[0]]), fl$1); /* */ $s = 13; case 13: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 14; case 14: - return _r$1; - /* } else if (_13 === (24)) { */ case 4: - str = v.ptr.$get(); - if (i[0] < 0 || i[0] >= str.length) { - $panic(new $String("reflect: string index out of range")); - } - fl$2 = (((v.flag & 96) >>> 0) | 8) >>> 0; - c[0] = str.charCodeAt(i[0]); - return new Value.ptr(uint8Type, (c.$ptr || (c.$ptr = new ptrType$5(function() { return this.$target[0]; }, function($v) { this.$target[0] = $v; }, c))), (fl$2 | 128) >>> 0); - /* } else { */ case 5: - $panic(new ValueError.ptr("reflect.Value.Index", k)); - /* } */ case 6: - case 1: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Index }; } $f.$ptr = $ptr; $f._13 = _13; $f._r = _r; $f._r$1 = _r$1; $f.a = a; $f.a$1 = a$1; $f.c = c; $f.fl = fl; $f.fl$1 = fl$1; $f.fl$2 = fl$2; $f.i = i; $f.k = k; $f.s = s; $f.str = str; $f.tt = tt; $f.tt$1 = tt$1; $f.typ = typ; $f.typ$1 = typ$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Index = function(i) { return this.$val.Index(i); }; - Value.ptr.prototype.InterfaceData = function() { - var $ptr, v; - v = this; - $panic(errors.New("InterfaceData is not supported by GopherJS")); - }; - Value.prototype.InterfaceData = function() { return this.$val.InterfaceData(); }; - Value.ptr.prototype.IsNil = function() { - var $ptr, _14, k, v; - v = this; - k = new flag(v.flag).kind(); - _14 = k; - if ((_14 === (22)) || (_14 === (23))) { - return v.object() === jsType(v.typ).nil; - } else if (_14 === (18)) { - return v.object() === $chanNil; - } else if (_14 === (19)) { - return v.object() === $throwNilPointerError; - } else if (_14 === (21)) { - return v.object() === false; - } else if (_14 === (20)) { - return v.object() === $ifaceNil; - } else { - $panic(new ValueError.ptr("reflect.Value.IsNil", k)); - } - }; - Value.prototype.IsNil = function() { return this.$val.IsNil(); }; - Value.ptr.prototype.Len = function() { - var $ptr, _15, k, v; - v = this; - k = new flag(v.flag).kind(); - _15 = k; - if ((_15 === (17)) || (_15 === (24))) { - return $parseInt(v.object().length); - } else if (_15 === (23)) { - return $parseInt(v.object().$length) >> 0; - } else if (_15 === (18)) { - return $parseInt(v.object().$buffer.length) >> 0; - } else if (_15 === (21)) { - return $parseInt($keys(v.object()).length); - } else { - $panic(new ValueError.ptr("reflect.Value.Len", k)); - } - }; - Value.prototype.Len = function() { return this.$val.Len(); }; - Value.ptr.prototype.Pointer = function() { - var $ptr, _16, k, v; - v = this; - k = new flag(v.flag).kind(); - _16 = k; - if ((_16 === (18)) || (_16 === (21)) || (_16 === (22)) || (_16 === (26))) { - if (v.IsNil()) { - return 0; - } - return v.object(); - } else if (_16 === (19)) { - if (v.IsNil()) { - return 0; - } - return 1; - } else if (_16 === (23)) { - if (v.IsNil()) { - return 0; - } - return v.object().$array; - } else { - $panic(new ValueError.ptr("reflect.Value.Pointer", k)); - } - }; - Value.prototype.Pointer = function() { return this.$val.Pointer(); }; - Value.ptr.prototype.Set = function(x) { - var $ptr, _17, _r, _r$1, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _17 = $f._17; _r = $f._r; _r$1 = $f._r$1; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - x = x; - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(x.flag).mustBeExported(); - _r = x.assignTo("reflect.Set", v.typ, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - x = _r; - /* */ if (!((((v.flag & 128) >>> 0) === 0))) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (!((((v.flag & 128) >>> 0) === 0))) { */ case 2: - _17 = v.typ.Kind(); - /* */ if (_17 === (17)) { $s = 5; continue; } - /* */ if (_17 === (20)) { $s = 6; continue; } - /* */ if (_17 === (25)) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (_17 === (17)) { */ case 5: - jsType(v.typ).copy(v.ptr, x.ptr); - $s = 9; continue; - /* } else if (_17 === (20)) { */ case 6: - _r$1 = valueInterface(x, false); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - v.ptr.$set(_r$1); - $s = 9; continue; - /* } else if (_17 === (25)) { */ case 7: - copyStruct(v.ptr, x.ptr, v.typ); - $s = 9; continue; - /* } else { */ case 8: - v.ptr.$set(x.object()); - /* } */ case 9: - case 4: - return; - /* } */ case 3: - v.ptr = x.ptr; - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Set }; } $f.$ptr = $ptr; $f._17 = _17; $f._r = _r; $f._r$1 = _r$1; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Set = function(x) { return this.$val.Set(x); }; - Value.ptr.prototype.SetBytes = function(x) { - var $ptr, _r, _r$1, _v, slice, typedSlice, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _v = $f._v; slice = $f.slice; typedSlice = $f.typedSlice; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(v.flag).mustBe(23); - _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!((_r === 8))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((_r === 8))) { */ case 1: - $panic(new $String("reflect.Value.SetBytes of non-byte slice")); - /* } */ case 2: - slice = x; - if (!(v.typ.Name() === "")) { _v = true; $s = 6; continue s; } - _r$1 = v.typ.Elem().Name(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _v = !(_r$1 === ""); case 6: - /* */ if (_v) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_v) { */ case 4: - typedSlice = new (jsType(v.typ))(slice.$array); - typedSlice.$offset = slice.$offset; - typedSlice.$length = slice.$length; - typedSlice.$capacity = slice.$capacity; - slice = typedSlice; - /* } */ case 5: - v.ptr.$set(slice); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.SetBytes }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._v = _v; $f.slice = slice; $f.typedSlice = typedSlice; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.SetBytes = function(x) { return this.$val.SetBytes(x); }; - Value.ptr.prototype.SetCap = function(n) { - var $ptr, n, newSlice, s, v; - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(v.flag).mustBe(23); - s = v.ptr.$get(); - if (n < ($parseInt(s.$length) >> 0) || n > ($parseInt(s.$capacity) >> 0)) { - $panic(new $String("reflect: slice capacity out of range in SetCap")); - } - newSlice = new (jsType(v.typ))(s.$array); - newSlice.$offset = s.$offset; - newSlice.$length = s.$length; - newSlice.$capacity = n; - v.ptr.$set(newSlice); - }; - Value.prototype.SetCap = function(n) { return this.$val.SetCap(n); }; - Value.ptr.prototype.SetLen = function(n) { - var $ptr, n, newSlice, s, v; - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(v.flag).mustBe(23); - s = v.ptr.$get(); - if (n < 0 || n > ($parseInt(s.$capacity) >> 0)) { - $panic(new $String("reflect: slice length out of range in SetLen")); - } - newSlice = new (jsType(v.typ))(s.$array); - newSlice.$offset = s.$offset; - newSlice.$length = n; - newSlice.$capacity = s.$capacity; - v.ptr.$set(newSlice); - }; - Value.prototype.SetLen = function(n) { return this.$val.SetLen(n); }; - Value.ptr.prototype.Slice = function(i, j) { - var $ptr, _18, _r, _r$1, cap, i, j, kind, s, str, tt, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _18 = $f._18; _r = $f._r; _r$1 = $f._r$1; cap = $f.cap; i = $f.i; j = $f.j; kind = $f.kind; s = $f.s; str = $f.str; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - cap = 0; - typ = $ifaceNil; - s = null; - kind = new flag(v.flag).kind(); - _18 = kind; - /* */ if (_18 === (17)) { $s = 2; continue; } - /* */ if (_18 === (23)) { $s = 3; continue; } - /* */ if (_18 === (24)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_18 === (17)) { */ case 2: - if (((v.flag & 256) >>> 0) === 0) { - $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); - } - tt = v.typ.kindType; - cap = (tt.len >> 0); - typ = SliceOf(tt.elem); - s = new (jsType(typ))(v.object()); - $s = 6; continue; - /* } else if (_18 === (23)) { */ case 3: - typ = v.typ; - s = v.object(); - cap = $parseInt(s.$capacity) >> 0; - $s = 6; continue; - /* } else if (_18 === (24)) { */ case 4: - str = v.ptr.$get(); - if (i < 0 || j < i || j > str.length) { - $panic(new $String("reflect.Value.Slice: string slice index out of bounds")); - } - _r = ValueOf(new $String(str.substring(i, j))); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 8; case 8: - return _r; - /* } else { */ case 5: - $panic(new ValueError.ptr("reflect.Value.Slice", kind)); - /* } */ case 6: - case 1: - if (i < 0 || j < i || j > cap) { - $panic(new $String("reflect.Value.Slice: slice index out of bounds")); - } - _r$1 = makeValue(typ, $subslice(s, i, j), (v.flag & 96) >>> 0); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 10; case 10: - return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice }; } $f.$ptr = $ptr; $f._18 = _18; $f._r = _r; $f._r$1 = _r$1; $f.cap = cap; $f.i = i; $f.j = j; $f.kind = kind; $f.s = s; $f.str = str; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Slice = function(i, j) { return this.$val.Slice(i, j); }; - Value.ptr.prototype.Slice3 = function(i, j, k) { - var $ptr, _19, _r, cap, i, j, k, kind, s, tt, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _19 = $f._19; _r = $f._r; cap = $f.cap; i = $f.i; j = $f.j; k = $f.k; kind = $f.kind; s = $f.s; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - cap = 0; - typ = $ifaceNil; - s = null; - kind = new flag(v.flag).kind(); - _19 = kind; - if (_19 === (17)) { - if (((v.flag & 256) >>> 0) === 0) { - $panic(new $String("reflect.Value.Slice: slice of unaddressable array")); - } - tt = v.typ.kindType; - cap = (tt.len >> 0); - typ = SliceOf(tt.elem); - s = new (jsType(typ))(v.object()); - } else if (_19 === (23)) { - typ = v.typ; - s = v.object(); - cap = $parseInt(s.$capacity) >> 0; - } else { - $panic(new ValueError.ptr("reflect.Value.Slice3", kind)); - } - if (i < 0 || j < i || k < j || k > cap) { - $panic(new $String("reflect.Value.Slice3: slice index out of bounds")); - } - _r = makeValue(typ, $subslice(s, i, j, k), (v.flag & 96) >>> 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Slice3 }; } $f.$ptr = $ptr; $f._19 = _19; $f._r = _r; $f.cap = cap; $f.i = i; $f.j = j; $f.k = k; $f.kind = kind; $f.s = s; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Slice3 = function(i, j, k) { return this.$val.Slice3(i, j, k); }; - Value.ptr.prototype.Close = function() { - var $ptr, v; - v = this; - new flag(v.flag).mustBe(18); - new flag(v.flag).mustBeExported(); - $close(v.object()); - }; - Value.prototype.Close = function() { return this.$val.Close(); }; - chanrecv = function(t, ch, nb, val) { - var $ptr, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, ch, comms, nb, received, recvRes, selectRes, selected, t, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; ch = $f.ch; comms = $f.comms; nb = $f.nb; received = $f.received; recvRes = $f.recvRes; selectRes = $f.selectRes; selected = $f.selected; t = $f.t; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - selected = false; - received = false; - comms = new sliceType$9([new sliceType$7([ch])]); - if (nb) { - comms = $append(comms, new sliceType$7([])); - } - _r = selectHelper(new sliceType$2([comms])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - selectRes = _r; - if (nb && (($parseInt(selectRes[0]) >> 0) === 1)) { - _tmp = false; - _tmp$1 = false; - selected = _tmp; - received = _tmp$1; - return [selected, received]; - } - recvRes = selectRes[1]; - val.$set(recvRes[0]); - _tmp$2 = true; - _tmp$3 = !!(recvRes[1]); - selected = _tmp$2; - received = _tmp$3; - return [selected, received]; - /* */ } return; } if ($f === undefined) { $f = { $blk: chanrecv }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.ch = ch; $f.comms = comms; $f.nb = nb; $f.received = received; $f.recvRes = recvRes; $f.selectRes = selectRes; $f.selected = selected; $f.t = t; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; - }; - chansend = function(t, ch, val, nb) { - var $ptr, _r, ch, comms, nb, selectRes, t, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; ch = $f.ch; comms = $f.comms; nb = $f.nb; selectRes = $f.selectRes; t = $f.t; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - comms = new sliceType$9([new sliceType$7([ch, val.$get()])]); - if (nb) { - comms = $append(comms, new sliceType$7([])); - } - _r = selectHelper(new sliceType$2([comms])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - selectRes = _r; - if (nb && (($parseInt(selectRes[0]) >> 0) === 1)) { - return false; - } - return true; - /* */ } return; } if ($f === undefined) { $f = { $blk: chansend }; } $f.$ptr = $ptr; $f._r = _r; $f.ch = ch; $f.comms = comms; $f.nb = nb; $f.selectRes = selectRes; $f.t = t; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; - }; - Kind.prototype.String = function() { - var $ptr, k; - k = this.$val; - if ((k >> 0) < kindNames.$length) { - return ((k < 0 || k >= kindNames.$length) ? $throwRuntimeError("index out of range") : kindNames.$array[kindNames.$offset + k]); - } - return "kind" + strconv.Itoa((k >> 0)); - }; - $ptrType(Kind).prototype.String = function() { return new Kind(this.$get()).String(); }; - uncommonType.ptr.prototype.uncommon = function() { - var $ptr, t; - t = this; - return t; - }; - uncommonType.prototype.uncommon = function() { return this.$val.uncommon(); }; - uncommonType.ptr.prototype.PkgPath = function() { - var $ptr, t; - t = this; - if (t === ptrType$7.nil || t.pkgPath === ptrType$6.nil) { - return ""; - } - return t.pkgPath.$get(); - }; - uncommonType.prototype.PkgPath = function() { return this.$val.PkgPath(); }; - uncommonType.ptr.prototype.Name = function() { - var $ptr, t; - t = this; - if (t === ptrType$7.nil || t.name === ptrType$6.nil) { - return ""; - } - return t.name.$get(); - }; - uncommonType.prototype.Name = function() { return this.$val.Name(); }; - rtype.ptr.prototype.String = function() { - var $ptr, t; - t = this; - return t.string.$get(); - }; - rtype.prototype.String = function() { return this.$val.String(); }; - rtype.ptr.prototype.Size = function() { - var $ptr, t; - t = this; - return t.size; - }; - rtype.prototype.Size = function() { return this.$val.Size(); }; - rtype.ptr.prototype.Bits = function() { - var $ptr, k, t; - t = this; - if (t === ptrType$1.nil) { - $panic(new $String("reflect: Bits of nil Type")); - } - k = t.Kind(); - if (k < 2 || k > 16) { - $panic(new $String("reflect: Bits of non-arithmetic Type " + t.String())); - } - return $imul((t.size >> 0), 8); - }; - rtype.prototype.Bits = function() { return this.$val.Bits(); }; - rtype.ptr.prototype.Align = function() { - var $ptr, t; - t = this; - return (t.align >> 0); - }; - rtype.prototype.Align = function() { return this.$val.Align(); }; - rtype.ptr.prototype.FieldAlign = function() { - var $ptr, t; - t = this; - return (t.fieldAlign >> 0); - }; - rtype.prototype.FieldAlign = function() { return this.$val.FieldAlign(); }; - rtype.ptr.prototype.Kind = function() { - var $ptr, t; - t = this; - return (((t.kind & 31) >>> 0) >>> 0); - }; - rtype.prototype.Kind = function() { return this.$val.Kind(); }; - rtype.ptr.prototype.common = function() { - var $ptr, t; - t = this; - return t; - }; - rtype.prototype.common = function() { return this.$val.common(); }; - uncommonType.ptr.prototype.NumMethod = function() { - var $ptr, t; - t = this; - if (t === ptrType$7.nil) { - return 0; - } - return t.methods.$length; - }; - uncommonType.prototype.NumMethod = function() { return this.$val.NumMethod(); }; - uncommonType.ptr.prototype.MethodByName = function(name) { - var $ptr, _i, _ref, _tmp, _tmp$1, i, m, name, ok, p, t, x; - m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - ok = false; - t = this; - if (t === ptrType$7.nil) { - return [m, ok]; - } - p = ptrType$10.nil; - _ref = t.methods; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - p = (x = t.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - if (!(p.name === ptrType$6.nil) && p.name.$get() === name) { - _tmp = $clone(t.Method(i), Method); - _tmp$1 = true; - Method.copy(m, _tmp); - ok = _tmp$1; - return [m, ok]; - } - _i++; - } - return [m, ok]; - }; - uncommonType.prototype.MethodByName = function(name) { return this.$val.MethodByName(name); }; - rtype.ptr.prototype.NumMethod = function() { - var $ptr, t, tt; - t = this; - if (t.Kind() === 20) { - tt = t.kindType; - return tt.NumMethod(); - } - return t.uncommonType.NumMethod(); - }; - rtype.prototype.NumMethod = function() { return this.$val.NumMethod(); }; - rtype.ptr.prototype.Method = function(i) { - var $ptr, i, m, t, tt; - m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - t = this; - if (t.Kind() === 20) { - tt = t.kindType; - Method.copy(m, tt.Method(i)); - return m; - } - Method.copy(m, t.uncommonType.Method(i)); - return m; - }; - rtype.prototype.Method = function(i) { return this.$val.Method(i); }; - rtype.ptr.prototype.MethodByName = function(name) { - var $ptr, _tuple, _tuple$1, m, name, ok, t, tt; - m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - ok = false; - t = this; - if (t.Kind() === 20) { - tt = t.kindType; - _tuple = tt.MethodByName(name); - Method.copy(m, _tuple[0]); - ok = _tuple[1]; - return [m, ok]; - } - _tuple$1 = t.uncommonType.MethodByName(name); - Method.copy(m, _tuple$1[0]); - ok = _tuple$1[1]; - return [m, ok]; - }; - rtype.prototype.MethodByName = function(name) { return this.$val.MethodByName(name); }; - rtype.ptr.prototype.PkgPath = function() { - var $ptr, t; - t = this; - return t.uncommonType.PkgPath(); - }; - rtype.prototype.PkgPath = function() { return this.$val.PkgPath(); }; - rtype.ptr.prototype.Name = function() { - var $ptr, t; - t = this; - return t.uncommonType.Name(); - }; - rtype.prototype.Name = function() { return this.$val.Name(); }; - rtype.ptr.prototype.ChanDir = function() { - var $ptr, t, tt; - t = this; - if (!((t.Kind() === 18))) { - $panic(new $String("reflect: ChanDir of non-chan type")); - } - tt = t.kindType; - return (tt.dir >> 0); - }; - rtype.prototype.ChanDir = function() { return this.$val.ChanDir(); }; - rtype.ptr.prototype.IsVariadic = function() { - var $ptr, t, tt; - t = this; - if (!((t.Kind() === 19))) { - $panic(new $String("reflect: IsVariadic of non-func type")); - } - tt = t.kindType; - return tt.dotdotdot; - }; - rtype.prototype.IsVariadic = function() { return this.$val.IsVariadic(); }; - rtype.ptr.prototype.Elem = function() { - var $ptr, _1, t, tt, tt$1, tt$2, tt$3, tt$4; - t = this; - _1 = t.Kind(); - if (_1 === (17)) { - tt = t.kindType; - return toType(tt.elem); - } else if (_1 === (18)) { - tt$1 = t.kindType; - return toType(tt$1.elem); - } else if (_1 === (21)) { - tt$2 = t.kindType; - return toType(tt$2.elem); - } else if (_1 === (22)) { - tt$3 = t.kindType; - return toType(tt$3.elem); - } else if (_1 === (23)) { - tt$4 = t.kindType; - return toType(tt$4.elem); - } - $panic(new $String("reflect: Elem of invalid type")); - }; - rtype.prototype.Elem = function() { return this.$val.Elem(); }; - rtype.ptr.prototype.Field = function(i) { - var $ptr, _r, i, t, tt, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if (!((t.Kind() === 25))) { - $panic(new $String("reflect: Field of non-struct type")); - } - tt = t.kindType; - _r = tt.Field(i); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Field }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.Field = function(i) { return this.$val.Field(i); }; - rtype.ptr.prototype.FieldByIndex = function(index) { - var $ptr, _r, index, t, tt, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; index = $f.index; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if (!((t.Kind() === 25))) { - $panic(new $String("reflect: FieldByIndex of non-struct type")); - } - tt = t.kindType; - _r = tt.FieldByIndex(index); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByIndex }; } $f.$ptr = $ptr; $f._r = _r; $f.index = index; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; - rtype.ptr.prototype.FieldByName = function(name) { - var $ptr, _r, name, t, tt, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if (!((t.Kind() === 25))) { - $panic(new $String("reflect: FieldByName of non-struct type")); - } - tt = t.kindType; - _r = tt.FieldByName(name); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByName }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.FieldByName = function(name) { return this.$val.FieldByName(name); }; - rtype.ptr.prototype.FieldByNameFunc = function(match) { - var $ptr, _r, match, t, tt, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; match = $f.match; t = $f.t; tt = $f.tt; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if (!((t.Kind() === 25))) { - $panic(new $String("reflect: FieldByNameFunc of non-struct type")); - } - tt = t.kindType; - _r = tt.FieldByNameFunc(match); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.FieldByNameFunc }; } $f.$ptr = $ptr; $f._r = _r; $f.match = match; $f.t = t; $f.tt = tt; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; - rtype.ptr.prototype.In = function(i) { - var $ptr, i, t, tt, x; - t = this; - if (!((t.Kind() === 19))) { - $panic(new $String("reflect: In of non-func type")); - } - tt = t.kindType; - return toType((x = tt.in$2, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]))); - }; - rtype.prototype.In = function(i) { return this.$val.In(i); }; - rtype.ptr.prototype.Key = function() { - var $ptr, t, tt; - t = this; - if (!((t.Kind() === 21))) { - $panic(new $String("reflect: Key of non-map type")); - } - tt = t.kindType; - return toType(tt.key); - }; - rtype.prototype.Key = function() { return this.$val.Key(); }; - rtype.ptr.prototype.Len = function() { - var $ptr, t, tt; - t = this; - if (!((t.Kind() === 17))) { - $panic(new $String("reflect: Len of non-array type")); - } - tt = t.kindType; - return (tt.len >> 0); - }; - rtype.prototype.Len = function() { return this.$val.Len(); }; - rtype.ptr.prototype.NumField = function() { - var $ptr, t, tt; - t = this; - if (!((t.Kind() === 25))) { - $panic(new $String("reflect: NumField of non-struct type")); - } - tt = t.kindType; - return tt.fields.$length; - }; - rtype.prototype.NumField = function() { return this.$val.NumField(); }; - rtype.ptr.prototype.NumIn = function() { - var $ptr, t, tt; - t = this; - if (!((t.Kind() === 19))) { - $panic(new $String("reflect: NumIn of non-func type")); - } - tt = t.kindType; - return tt.in$2.$length; - }; - rtype.prototype.NumIn = function() { return this.$val.NumIn(); }; - rtype.ptr.prototype.NumOut = function() { - var $ptr, t, tt; - t = this; - if (!((t.Kind() === 19))) { - $panic(new $String("reflect: NumOut of non-func type")); - } - tt = t.kindType; - return tt.out.$length; - }; - rtype.prototype.NumOut = function() { return this.$val.NumOut(); }; - rtype.ptr.prototype.Out = function(i) { - var $ptr, i, t, tt, x; - t = this; - if (!((t.Kind() === 19))) { - $panic(new $String("reflect: Out of non-func type")); - } - tt = t.kindType; - return toType((x = tt.out, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]))); - }; - rtype.prototype.Out = function(i) { return this.$val.Out(i); }; - ChanDir.prototype.String = function() { - var $ptr, _2, d; - d = this.$val; - _2 = d; - if (_2 === (2)) { - return "chan<-"; - } else if (_2 === (1)) { - return "<-chan"; - } else if (_2 === (3)) { - return "chan"; - } - return "ChanDir" + strconv.Itoa((d >> 0)); - }; - $ptrType(ChanDir).prototype.String = function() { return new ChanDir(this.$get()).String(); }; - interfaceType.ptr.prototype.Method = function(i) { - var $ptr, i, m, p, t, x; - m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - t = this; - if (i < 0 || i >= t.methods.$length) { - return m; - } - p = (x = t.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - m.Name = p.name.$get(); - if (!(p.pkgPath === ptrType$6.nil)) { - m.PkgPath = p.pkgPath.$get(); - } - m.Type = toType(p.typ); - m.Index = i; - return m; - }; - interfaceType.prototype.Method = function(i) { return this.$val.Method(i); }; - interfaceType.ptr.prototype.NumMethod = function() { - var $ptr, t; - t = this; - return t.methods.$length; - }; - interfaceType.prototype.NumMethod = function() { return this.$val.NumMethod(); }; - interfaceType.ptr.prototype.MethodByName = function(name) { - var $ptr, _i, _ref, _tmp, _tmp$1, i, m, name, ok, p, t, x; - m = new Method.ptr("", "", $ifaceNil, new Value.ptr(ptrType$1.nil, 0, 0), 0); - ok = false; - t = this; - if (t === ptrType$11.nil) { - return [m, ok]; - } - p = ptrType$12.nil; - _ref = t.methods; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - p = (x = t.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - if (p.name.$get() === name) { - _tmp = $clone(t.Method(i), Method); - _tmp$1 = true; - Method.copy(m, _tmp); - ok = _tmp$1; - return [m, ok]; - } - _i++; - } - return [m, ok]; - }; - interfaceType.prototype.MethodByName = function(name) { return this.$val.MethodByName(name); }; - StructTag.prototype.Get = function(key) { - var $ptr, _tuple, err, i, key, name, qvalue, tag, value; - tag = this.$val; - while (true) { - if (!(!(tag === ""))) { break; } - i = 0; - while (true) { - if (!(i < tag.length && (tag.charCodeAt(i) === 32))) { break; } - i = i + (1) >> 0; - } - tag = tag.substring(i); - if (tag === "") { - break; - } - i = 0; - while (true) { - if (!(i < tag.length && tag.charCodeAt(i) > 32 && !((tag.charCodeAt(i) === 58)) && !((tag.charCodeAt(i) === 34)) && !((tag.charCodeAt(i) === 127)))) { break; } - i = i + (1) >> 0; - } - if ((i === 0) || (i + 1 >> 0) >= tag.length || !((tag.charCodeAt(i) === 58)) || !((tag.charCodeAt((i + 1 >> 0)) === 34))) { - break; - } - name = tag.substring(0, i); - tag = tag.substring((i + 1 >> 0)); - i = 1; - while (true) { - if (!(i < tag.length && !((tag.charCodeAt(i) === 34)))) { break; } - if (tag.charCodeAt(i) === 92) { - i = i + (1) >> 0; - } - i = i + (1) >> 0; - } - if (i >= tag.length) { - break; - } - qvalue = tag.substring(0, (i + 1 >> 0)); - tag = tag.substring((i + 1 >> 0)); - if (key === name) { - _tuple = strconv.Unquote(qvalue); - value = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - break; - } - return value; - } - } - return ""; - }; - $ptrType(StructTag).prototype.Get = function(key) { return new StructTag(this.$get()).Get(key); }; - structType.ptr.prototype.Field = function(i) { - var $ptr, _r, _r$1, _r$2, f, i, p, t, t$1, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; f = $f.f; i = $f.i; p = $f.p; t = $f.t; t$1 = $f.t$1; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$11.nil, false); - t = this; - if (i < 0 || i >= t.fields.$length) { - return f; - } - p = (x = t.fields, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - f.Type = toType(p.typ); - /* */ if (!(p.name === ptrType$6.nil)) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!(p.name === ptrType$6.nil)) { */ case 1: - f.Name = p.name.$get(); - $s = 3; continue; - /* } else { */ case 2: - t$1 = f.Type; - _r = t$1.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (_r === 22) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_r === 22) { */ case 4: - _r$1 = t$1.Elem(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - t$1 = _r$1; - /* } */ case 5: - _r$2 = t$1.Name(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - f.Name = _r$2; - f.Anonymous = true; - /* } */ case 3: - if (!(p.pkgPath === ptrType$6.nil)) { - f.PkgPath = p.pkgPath.$get(); - } - if (!(p.tag === ptrType$6.nil)) { - f.Tag = p.tag.$get(); - } - f.Offset = p.offset; - f.Index = new sliceType$11([i]); - return f; - /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.Field }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.f = f; $f.i = i; $f.p = p; $f.t = t; $f.t$1 = t$1; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - structType.prototype.Field = function(i) { return this.$val.Field(i); }; - structType.ptr.prototype.FieldByIndex = function(index) { - var $ptr, _i, _r, _r$1, _r$2, _r$3, _r$4, _ref, _v, f, ft, i, index, t, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; _v = $f._v; f = $f.f; ft = $f.ft; i = $f.i; index = $f.index; t = $f.t; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$11.nil, false); - t = this; - f.Type = toType(t.rtype); - _ref = index; - _i = 0; - /* while (true) { */ case 1: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } - i = _i; - x = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - /* */ if (i > 0) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (i > 0) { */ case 3: - ft = f.Type; - _r = ft.Kind(); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - if (!(_r === 22)) { _v = false; $s = 7; continue s; } - _r$1 = ft.Elem(); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = _r$1.Kind(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _v = _r$2 === 25; case 7: - /* */ if (_v) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (_v) { */ case 5: - _r$3 = ft.Elem(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - ft = _r$3; - /* } */ case 6: - f.Type = ft; - /* } */ case 4: - _r$4 = f.Type.Field(x); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - StructField.copy(f, _r$4); - _i++; - /* } */ $s = 1; continue; case 2: - return f; - /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByIndex }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f._v = _v; $f.f = f; $f.ft = ft; $f.i = i; $f.index = index; $f.t = t; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - structType.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; - structType.ptr.prototype.FieldByNameFunc = function(match) { - var $ptr, _entry, _entry$1, _entry$2, _entry$3, _i, _i$1, _key, _key$1, _key$2, _key$3, _r, _r$1, _r$2, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, count, current, f, fname, i, index, match, next, nextCount, ntyp, ok, result, scan, styp, t, t$1, visited, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _i = $f._i; _i$1 = $f._i$1; _key = $f._key; _key$1 = $f._key$1; _key$2 = $f._key$2; _key$3 = $f._key$3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; count = $f.count; current = $f.current; f = $f.f; fname = $f.fname; i = $f.i; index = $f.index; match = $f.match; next = $f.next; nextCount = $f.nextCount; ntyp = $f.ntyp; ok = $f.ok; result = $f.result; scan = $f.scan; styp = $f.styp; t = $f.t; t$1 = $f.t$1; visited = $f.visited; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - result = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$11.nil, false); - ok = false; - t = this; - current = new sliceType$12([]); - next = new sliceType$12([new fieldScan.ptr(t, sliceType$11.nil)]); - nextCount = false; - visited = $makeMap(ptrType$13.keyFor, []); - /* while (true) { */ case 1: - /* if (!(next.$length > 0)) { break; } */ if(!(next.$length > 0)) { $s = 2; continue; } - _tmp = next; - _tmp$1 = $subslice(current, 0, 0); - current = _tmp; - next = _tmp$1; - count = nextCount; - nextCount = false; - _ref = current; - _i = 0; - /* while (true) { */ case 3: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } - scan = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), fieldScan); - t$1 = scan.typ; - /* */ if ((_entry = visited[ptrType$13.keyFor(t$1)], _entry !== undefined ? _entry.v : false)) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if ((_entry = visited[ptrType$13.keyFor(t$1)], _entry !== undefined ? _entry.v : false)) { */ case 5: - _i++; - /* continue; */ $s = 3; continue; - /* } */ case 6: - _key = t$1; (visited || $throwRuntimeError("assignment to entry in nil map"))[ptrType$13.keyFor(_key)] = { k: _key, v: true }; - _ref$1 = t$1.fields; - _i$1 = 0; - /* while (true) { */ case 7: - /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 8; continue; } - i = _i$1; - f = (x = t$1.fields, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - fname = ""; - ntyp = ptrType$1.nil; - /* */ if (!(f.name === ptrType$6.nil)) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (!(f.name === ptrType$6.nil)) { */ case 9: - fname = f.name.$get(); - $s = 11; continue; - /* } else { */ case 10: - ntyp = f.typ; - /* */ if (ntyp.Kind() === 22) { $s = 12; continue; } - /* */ $s = 13; continue; - /* if (ntyp.Kind() === 22) { */ case 12: - _r = ntyp.Elem().common(); /* */ $s = 14; case 14: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - ntyp = _r; - /* } */ case 13: - fname = ntyp.Name(); - /* } */ case 11: - _r$1 = match(fname); /* */ $s = 17; case 17: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ if (_r$1) { $s = 15; continue; } - /* */ $s = 16; continue; - /* if (_r$1) { */ case 15: - if ((_entry$1 = count[ptrType$13.keyFor(t$1)], _entry$1 !== undefined ? _entry$1.v : 0) > 1 || ok) { - _tmp$2 = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$11.nil, false); - _tmp$3 = false; - StructField.copy(result, _tmp$2); - ok = _tmp$3; - return [result, ok]; - } - _r$2 = t$1.Field(i); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - StructField.copy(result, _r$2); - result.Index = sliceType$11.nil; - result.Index = $appendSlice(result.Index, scan.index); - result.Index = $append(result.Index, i); - ok = true; - _i$1++; - /* continue; */ $s = 7; continue; - /* } */ case 16: - if (ok || ntyp === ptrType$1.nil || !((ntyp.Kind() === 25))) { - _i$1++; - /* continue; */ $s = 7; continue; - } - styp = ntyp.kindType; - if ((_entry$2 = nextCount[ptrType$13.keyFor(styp)], _entry$2 !== undefined ? _entry$2.v : 0) > 0) { - _key$1 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$13.keyFor(_key$1)] = { k: _key$1, v: 2 }; - _i$1++; - /* continue; */ $s = 7; continue; - } - if (nextCount === false) { - nextCount = $makeMap(ptrType$13.keyFor, []); - } - _key$2 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$13.keyFor(_key$2)] = { k: _key$2, v: 1 }; - if ((_entry$3 = count[ptrType$13.keyFor(t$1)], _entry$3 !== undefined ? _entry$3.v : 0) > 1) { - _key$3 = styp; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[ptrType$13.keyFor(_key$3)] = { k: _key$3, v: 2 }; - } - index = sliceType$11.nil; - index = $appendSlice(index, scan.index); - index = $append(index, i); - next = $append(next, new fieldScan.ptr(styp, index)); - _i$1++; - /* } */ $s = 7; continue; case 8: - _i++; - /* } */ $s = 3; continue; case 4: - if (ok) { - /* break; */ $s = 2; continue; - } - /* } */ $s = 1; continue; case 2: - return [result, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByNameFunc }; } $f.$ptr = $ptr; $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._i = _i; $f._i$1 = _i$1; $f._key = _key; $f._key$1 = _key$1; $f._key$2 = _key$2; $f._key$3 = _key$3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.count = count; $f.current = current; $f.f = f; $f.fname = fname; $f.i = i; $f.index = index; $f.match = match; $f.next = next; $f.nextCount = nextCount; $f.ntyp = ntyp; $f.ok = ok; $f.result = result; $f.scan = scan; $f.styp = styp; $f.t = t; $f.t$1 = t$1; $f.visited = visited; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - structType.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; - structType.ptr.prototype.FieldByName = function(name) { - var $ptr, _i, _r, _r$1, _ref, _tmp, _tmp$1, _tuple, f, hasAnon, i, name, present, t, tf, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; f = $f.f; hasAnon = $f.hasAnon; i = $f.i; name = $f.name; present = $f.present; t = $f.t; tf = $f.tf; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - name = [name]; - f = new StructField.ptr("", "", $ifaceNil, "", 0, sliceType$11.nil, false); - present = false; - t = this; - hasAnon = false; - /* */ if (!(name[0] === "")) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!(name[0] === "")) { */ case 1: - _ref = t.fields; - _i = 0; - /* while (true) { */ case 3: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } - i = _i; - tf = (x = t.fields, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - /* */ if (tf.name === ptrType$6.nil) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (tf.name === ptrType$6.nil) { */ case 5: - hasAnon = true; - _i++; - /* continue; */ $s = 3; continue; - /* } */ case 6: - /* */ if (tf.name.$get() === name[0]) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (tf.name.$get() === name[0]) { */ case 7: - _r = t.Field(i); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tmp = $clone(_r, StructField); - _tmp$1 = true; - StructField.copy(f, _tmp); - present = _tmp$1; - /* */ $s = 10; case 10: - return [f, present]; - /* } */ case 8: - _i++; - /* } */ $s = 3; continue; case 4: - /* } */ case 2: - if (!hasAnon) { - return [f, present]; - } - _r$1 = t.FieldByNameFunc((function(name) { return function(s) { - var $ptr, s; - return s === name[0]; - }; })(name)); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple = _r$1; - StructField.copy(f, _tuple[0]); - present = _tuple[1]; - /* */ $s = 12; case 12: - return [f, present]; - /* */ } return; } if ($f === undefined) { $f = { $blk: structType.ptr.prototype.FieldByName }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.f = f; $f.hasAnon = hasAnon; $f.i = i; $f.name = name; $f.present = present; $f.t = t; $f.tf = tf; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - structType.prototype.FieldByName = function(name) { return this.$val.FieldByName(name); }; - PtrTo = function(t) { - var $ptr, t; - return $assertType(t, ptrType$1).ptrTo(); - }; - $pkg.PtrTo = PtrTo; - rtype.ptr.prototype.Implements = function(u) { - var $ptr, _r, t, u, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if ($interfaceIsEqual(u, $ifaceNil)) { - $panic(new $String("reflect: nil type passed to Type.Implements")); - } - _r = u.Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!((_r === 20))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((_r === 20))) { */ case 1: - $panic(new $String("reflect: non-interface type passed to Type.Implements")); - /* } */ case 2: - return implements$1($assertType(u, ptrType$1), t); - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.Implements }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.Implements = function(u) { return this.$val.Implements(u); }; - rtype.ptr.prototype.AssignableTo = function(u) { - var $ptr, t, u, uu; - t = this; - if ($interfaceIsEqual(u, $ifaceNil)) { - $panic(new $String("reflect: nil type passed to Type.AssignableTo")); - } - uu = $assertType(u, ptrType$1); - return directlyAssignable(uu, t) || implements$1(uu, t); - }; - rtype.prototype.AssignableTo = function(u) { return this.$val.AssignableTo(u); }; - rtype.ptr.prototype.ConvertibleTo = function(u) { - var $ptr, _r, t, u, uu, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; u = $f.u; uu = $f.uu; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - if ($interfaceIsEqual(u, $ifaceNil)) { - $panic(new $String("reflect: nil type passed to Type.ConvertibleTo")); - } - uu = $assertType(u, ptrType$1); - _r = convertOp(uu, t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return !(_r === $throwNilPointerError); - /* */ } return; } if ($f === undefined) { $f = { $blk: rtype.ptr.prototype.ConvertibleTo }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.u = u; $f.uu = uu; $f.$s = $s; $f.$r = $r; return $f; - }; - rtype.prototype.ConvertibleTo = function(u) { return this.$val.ConvertibleTo(u); }; - implements$1 = function(T, V) { - var $ptr, T, V, i, i$1, j, j$1, t, tm, tm$1, v, v$1, vm, vm$1, x, x$1, x$2, x$3; - if (!((T.Kind() === 20))) { - return false; - } - t = T.kindType; - if (t.methods.$length === 0) { - return true; - } - if (V.Kind() === 20) { - v = V.kindType; - i = 0; - j = 0; - while (true) { - if (!(j < v.methods.$length)) { break; } - tm = (x = t.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - vm = (x$1 = v.methods, ((j < 0 || j >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + j])); - if (vm.name.$get() === tm.name.$get() && vm.pkgPath === tm.pkgPath && vm.typ === tm.typ) { - i = i + (1) >> 0; - if (i >= t.methods.$length) { - return true; - } - } - j = j + (1) >> 0; - } - return false; - } - v$1 = V.uncommonType.uncommon(); - if (v$1 === ptrType$7.nil) { - return false; - } - i$1 = 0; - j$1 = 0; - while (true) { - if (!(j$1 < v$1.methods.$length)) { break; } - tm$1 = (x$2 = t.methods, ((i$1 < 0 || i$1 >= x$2.$length) ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + i$1])); - vm$1 = (x$3 = v$1.methods, ((j$1 < 0 || j$1 >= x$3.$length) ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + j$1])); - if (vm$1.name.$get() === tm$1.name.$get() && vm$1.pkgPath === tm$1.pkgPath && vm$1.mtyp === tm$1.typ) { - i$1 = i$1 + (1) >> 0; - if (i$1 >= t.methods.$length) { - return true; - } - } - j$1 = j$1 + (1) >> 0; - } - return false; - }; - directlyAssignable = function(T, V) { - var $ptr, T, V; - if (T === V) { - return true; - } - if (!(T.Name() === "") && !(V.Name() === "") || !((T.Kind() === V.Kind()))) { - return false; - } - return haveIdenticalUnderlyingType(T, V); - }; - haveIdenticalUnderlyingType = function(T, V) { - var $ptr, T, V, _3, _i, _i$1, _i$2, _ref, _ref$1, _ref$2, i, i$1, i$2, kind, t, t$1, t$2, tf, typ, typ$1, v, v$1, v$2, vf, x, x$1, x$2, x$3; - if (T === V) { - return true; - } - kind = T.Kind(); - if (!((kind === V.Kind()))) { - return false; - } - if (1 <= kind && kind <= 16 || (kind === 24) || (kind === 26)) { - return true; - } - _3 = kind; - if (_3 === (17)) { - return $interfaceIsEqual(T.Elem(), V.Elem()) && (T.Len() === V.Len()); - } else if (_3 === (18)) { - if ((V.ChanDir() === 3) && $interfaceIsEqual(T.Elem(), V.Elem())) { - return true; - } - return (V.ChanDir() === T.ChanDir()) && $interfaceIsEqual(T.Elem(), V.Elem()); - } else if (_3 === (19)) { - t = T.kindType; - v = V.kindType; - if (!(t.dotdotdot === v.dotdotdot) || !((t.in$2.$length === v.in$2.$length)) || !((t.out.$length === v.out.$length))) { - return false; - } - _ref = t.in$2; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - typ = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (!(typ === (x = v.in$2, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])))) { - return false; - } - _i++; - } - _ref$1 = t.out; - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - i$1 = _i$1; - typ$1 = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); - if (!(typ$1 === (x$1 = v.out, ((i$1 < 0 || i$1 >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + i$1])))) { - return false; - } - _i$1++; - } - return true; - } else if (_3 === (20)) { - t$1 = T.kindType; - v$1 = V.kindType; - if ((t$1.methods.$length === 0) && (v$1.methods.$length === 0)) { - return true; - } - return false; - } else if (_3 === (21)) { - return $interfaceIsEqual(T.Key(), V.Key()) && $interfaceIsEqual(T.Elem(), V.Elem()); - } else if ((_3 === (22)) || (_3 === (23))) { - return $interfaceIsEqual(T.Elem(), V.Elem()); - } else if (_3 === (25)) { - t$2 = T.kindType; - v$2 = V.kindType; - if (!((t$2.fields.$length === v$2.fields.$length))) { - return false; - } - _ref$2 = t$2.fields; - _i$2 = 0; - while (true) { - if (!(_i$2 < _ref$2.$length)) { break; } - i$2 = _i$2; - tf = (x$2 = t$2.fields, ((i$2 < 0 || i$2 >= x$2.$length) ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + i$2])); - vf = (x$3 = v$2.fields, ((i$2 < 0 || i$2 >= x$3.$length) ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + i$2])); - if (!(tf.name === vf.name) && (tf.name === ptrType$6.nil || vf.name === ptrType$6.nil || !(tf.name.$get() === vf.name.$get()))) { - return false; - } - if (!(tf.pkgPath === vf.pkgPath) && (tf.pkgPath === ptrType$6.nil || vf.pkgPath === ptrType$6.nil || !(tf.pkgPath.$get() === vf.pkgPath.$get()))) { - return false; - } - if (!(tf.typ === vf.typ)) { - return false; - } - if (!(tf.tag === vf.tag) && (tf.tag === ptrType$6.nil || vf.tag === ptrType$6.nil || !(tf.tag.$get() === vf.tag.$get()))) { - return false; - } - if (!((tf.offset === vf.offset))) { - return false; - } - _i$2++; - } - return true; - } - return false; - }; - toType = function(t) { - var $ptr, t; - if (t === ptrType$1.nil) { - return $ifaceNil; - } - return t; - }; - ifaceIndir = function(t) { - var $ptr, t; - return ((t.kind & 32) >>> 0) === 0; - }; - flag.prototype.kind = function() { - var $ptr, f; - f = this.$val; - return (((f & 31) >>> 0) >>> 0); - }; - $ptrType(flag).prototype.kind = function() { return new flag(this.$get()).kind(); }; - Value.ptr.prototype.pointer = function() { - var $ptr, v; - v = this; - if (!((v.typ.size === 4)) || !v.typ.pointers()) { - $panic(new $String("can't call pointer on a non-pointer Value")); - } - if (!((((v.flag & 128) >>> 0) === 0))) { - return v.ptr.$get(); - } - return v.ptr; - }; - Value.prototype.pointer = function() { return this.$val.pointer(); }; - ValueError.ptr.prototype.Error = function() { - var $ptr, e; - e = this; - if (e.Kind === 0) { - return "reflect: call of " + e.Method + " on zero Value"; - } - return "reflect: call of " + e.Method + " on " + new Kind(e.Kind).String() + " Value"; - }; - ValueError.prototype.Error = function() { return this.$val.Error(); }; - flag.prototype.mustBe = function(expected) { - var $ptr, expected, f; - f = this.$val; - if (!((new flag(f).kind() === expected))) { - $panic(new ValueError.ptr(methodName(), new flag(f).kind())); - } - }; - $ptrType(flag).prototype.mustBe = function(expected) { return new flag(this.$get()).mustBe(expected); }; - flag.prototype.mustBeExported = function() { - var $ptr, f; - f = this.$val; - if (f === 0) { - $panic(new ValueError.ptr(methodName(), 0)); - } - if (!((((f & 96) >>> 0) === 0))) { - $panic(new $String("reflect: " + methodName() + " using value obtained using unexported field")); - } - }; - $ptrType(flag).prototype.mustBeExported = function() { return new flag(this.$get()).mustBeExported(); }; - flag.prototype.mustBeAssignable = function() { - var $ptr, f; - f = this.$val; - if (f === 0) { - $panic(new ValueError.ptr(methodName(), 0)); - } - if (!((((f & 96) >>> 0) === 0))) { - $panic(new $String("reflect: " + methodName() + " using value obtained using unexported field")); - } - if (((f & 256) >>> 0) === 0) { - $panic(new $String("reflect: " + methodName() + " using unaddressable value")); - } - }; - $ptrType(flag).prototype.mustBeAssignable = function() { return new flag(this.$get()).mustBeAssignable(); }; - Value.ptr.prototype.Addr = function() { - var $ptr, v; - v = this; - if (((v.flag & 256) >>> 0) === 0) { - $panic(new $String("reflect.Value.Addr of unaddressable value")); - } - return new Value.ptr(v.typ.ptrTo(), v.ptr, ((((v.flag & 96) >>> 0)) | 22) >>> 0); - }; - Value.prototype.Addr = function() { return this.$val.Addr(); }; - Value.ptr.prototype.Bool = function() { - var $ptr, v; - v = this; - new flag(v.flag).mustBe(1); - return v.ptr.$get(); - }; - Value.prototype.Bool = function() { return this.$val.Bool(); }; - Value.ptr.prototype.Bytes = function() { - var $ptr, _r, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - new flag(v.flag).mustBe(23); - _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!((_r === 8))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((_r === 8))) { */ case 1: - $panic(new $String("reflect.Value.Bytes of non-byte slice")); - /* } */ case 2: - return v.ptr.$get(); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Bytes }; } $f.$ptr = $ptr; $f._r = _r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Bytes = function() { return this.$val.Bytes(); }; - Value.ptr.prototype.runes = function() { - var $ptr, _r, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - new flag(v.flag).mustBe(23); - _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!((_r === 5))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((_r === 5))) { */ case 1: - $panic(new $String("reflect.Value.Bytes of non-rune slice")); - /* } */ case 2: - return v.ptr.$get(); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.runes }; } $f.$ptr = $ptr; $f._r = _r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.runes = function() { return this.$val.runes(); }; - Value.ptr.prototype.CanAddr = function() { - var $ptr, v; - v = this; - return !((((v.flag & 256) >>> 0) === 0)); - }; - Value.prototype.CanAddr = function() { return this.$val.CanAddr(); }; - Value.ptr.prototype.CanSet = function() { - var $ptr, v; - v = this; - return ((v.flag & 352) >>> 0) === 256; - }; - Value.prototype.CanSet = function() { return this.$val.CanSet(); }; - Value.ptr.prototype.Call = function(in$1) { - var $ptr, _r, in$1, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; in$1 = $f.in$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - new flag(v.flag).mustBe(19); - new flag(v.flag).mustBeExported(); - _r = v.call("Call", in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Call }; } $f.$ptr = $ptr; $f._r = _r; $f.in$1 = in$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Call = function(in$1) { return this.$val.Call(in$1); }; - Value.ptr.prototype.CallSlice = function(in$1) { - var $ptr, _r, in$1, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; in$1 = $f.in$1; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - new flag(v.flag).mustBe(19); - new flag(v.flag).mustBeExported(); - _r = v.call("CallSlice", in$1); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.CallSlice }; } $f.$ptr = $ptr; $f._r = _r; $f.in$1 = in$1; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.CallSlice = function(in$1) { return this.$val.CallSlice(in$1); }; - Value.ptr.prototype.Complex = function() { - var $ptr, _2, k, v, x; - v = this; - k = new flag(v.flag).kind(); - _2 = k; - if (_2 === (15)) { - return (x = v.ptr.$get(), new $Complex128(x.$real, x.$imag)); - } else if (_2 === (16)) { - return v.ptr.$get(); - } - $panic(new ValueError.ptr("reflect.Value.Complex", new flag(v.flag).kind())); - }; - Value.prototype.Complex = function() { return this.$val.Complex(); }; - Value.ptr.prototype.FieldByIndex = function(index) { - var $ptr, _i, _r, _r$1, _r$2, _r$3, _ref, _v, i, index, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; _v = $f._v; i = $f.i; index = $f.index; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - /* */ if (index.$length === 1) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (index.$length === 1) { */ case 1: - _r = v.Field((0 >= index.$length ? $throwRuntimeError("index out of range") : index.$array[index.$offset + 0])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return _r; - /* } */ case 2: - new flag(v.flag).mustBe(25); - _ref = index; - _i = 0; - /* while (true) { */ case 5: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 6; continue; } - i = _i; - x = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - /* */ if (i > 0) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (i > 0) { */ case 7: - if (!(v.Kind() === 22)) { _v = false; $s = 11; continue s; } - _r$1 = v.typ.Elem().Kind(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _v = _r$1 === 25; case 11: - /* */ if (_v) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (_v) { */ case 9: - if (v.IsNil()) { - $panic(new $String("reflect: indirection through nil pointer to embedded struct")); - } - _r$2 = v.Elem(); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - v = _r$2; - /* } */ case 10: - /* } */ case 8: - _r$3 = v.Field(x); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - v = _r$3; - _i++; - /* } */ $s = 5; continue; case 6: - return v; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByIndex }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f._v = _v; $f.i = i; $f.index = index; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.FieldByIndex = function(index) { return this.$val.FieldByIndex(index); }; - Value.ptr.prototype.FieldByName = function(name) { - var $ptr, _r, _r$1, _tuple, f, name, ok, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; name = $f.name; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - new flag(v.flag).mustBe(25); - _r = v.typ.FieldByName(name); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - f = $clone(_tuple[0], StructField); - ok = _tuple[1]; - /* */ if (ok) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (ok) { */ case 2: - _r$1 = v.FieldByIndex(f.Index); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 5; case 5: - return _r$1; - /* } */ case 3: - return new Value.ptr(ptrType$1.nil, 0, 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByName }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.name = name; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.FieldByName = function(name) { return this.$val.FieldByName(name); }; - Value.ptr.prototype.FieldByNameFunc = function(match) { - var $ptr, _r, _r$1, _tuple, f, match, ok, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; f = $f.f; match = $f.match; ok = $f.ok; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - _r = v.typ.FieldByNameFunc(match); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - f = $clone(_tuple[0], StructField); - ok = _tuple[1]; - /* */ if (ok) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (ok) { */ case 2: - _r$1 = v.FieldByIndex(f.Index); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 5; case 5: - return _r$1; - /* } */ case 3: - return new Value.ptr(ptrType$1.nil, 0, 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.FieldByNameFunc }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.f = f; $f.match = match; $f.ok = ok; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.FieldByNameFunc = function(match) { return this.$val.FieldByNameFunc(match); }; - Value.ptr.prototype.Float = function() { - var $ptr, _4, k, v; - v = this; - k = new flag(v.flag).kind(); - _4 = k; - if (_4 === (13)) { - return v.ptr.$get(); - } else if (_4 === (14)) { - return v.ptr.$get(); - } - $panic(new ValueError.ptr("reflect.Value.Float", new flag(v.flag).kind())); - }; - Value.prototype.Float = function() { return this.$val.Float(); }; - Value.ptr.prototype.Int = function() { - var $ptr, _6, k, p, v; - v = this; - k = new flag(v.flag).kind(); - p = v.ptr; - _6 = k; - if (_6 === (2)) { - return new $Int64(0, p.$get()); - } else if (_6 === (3)) { - return new $Int64(0, p.$get()); - } else if (_6 === (4)) { - return new $Int64(0, p.$get()); - } else if (_6 === (5)) { - return new $Int64(0, p.$get()); - } else if (_6 === (6)) { - return p.$get(); - } - $panic(new ValueError.ptr("reflect.Value.Int", new flag(v.flag).kind())); - }; - Value.prototype.Int = function() { return this.$val.Int(); }; - Value.ptr.prototype.CanInterface = function() { - var $ptr, v; - v = this; - if (v.flag === 0) { - $panic(new ValueError.ptr("reflect.Value.CanInterface", 0)); - } - return ((v.flag & 96) >>> 0) === 0; - }; - Value.prototype.CanInterface = function() { return this.$val.CanInterface(); }; - Value.ptr.prototype.Interface = function() { - var $ptr, _r, i, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - i = $ifaceNil; - v = this; - _r = valueInterface(v, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - i = _r; - /* */ $s = 2; case 2: - return i; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Interface }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Interface = function() { return this.$val.Interface(); }; - Value.ptr.prototype.IsValid = function() { - var $ptr, v; - v = this; - return !((v.flag === 0)); - }; - Value.prototype.IsValid = function() { return this.$val.IsValid(); }; - Value.ptr.prototype.Kind = function() { - var $ptr, v; - v = this; - return new flag(v.flag).kind(); - }; - Value.prototype.Kind = function() { return this.$val.Kind(); }; - Value.ptr.prototype.MapIndex = function(key) { - var $ptr, _r, c, e, fl, k, key, tt, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; c = $f.c; e = $f.e; fl = $f.fl; k = $f.k; key = $f.key; tt = $f.tt; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - key = key; - v = this; - new flag(v.flag).mustBe(21); - tt = v.typ.kindType; - _r = key.assignTo("reflect.Value.MapIndex", tt.key, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - key = _r; - k = 0; - if (!((((key.flag & 128) >>> 0) === 0))) { - k = key.ptr; - } else { - k = (key.$ptr_ptr || (key.$ptr_ptr = new ptrType$18(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key))); - } - e = mapaccess(v.typ, v.pointer(), k); - if (e === 0) { - return new Value.ptr(ptrType$1.nil, 0, 0); - } - typ = tt.elem; - fl = ((((v.flag | key.flag) >>> 0)) & 96) >>> 0; - fl = (fl | ((typ.Kind() >>> 0))) >>> 0; - if (ifaceIndir(typ)) { - c = unsafe_New(typ); - typedmemmove(typ, c, e); - return new Value.ptr(typ, c, (fl | 128) >>> 0); - } else { - return new Value.ptr(typ, e.$get(), fl); - } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapIndex }; } $f.$ptr = $ptr; $f._r = _r; $f.c = c; $f.e = e; $f.fl = fl; $f.k = k; $f.key = key; $f.tt = tt; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.MapIndex = function(key) { return this.$val.MapIndex(key); }; - Value.ptr.prototype.MapKeys = function() { - var $ptr, _r, a, c, fl, i, it, key, keyType, m, mlen, tt, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; a = $f.a; c = $f.c; fl = $f.fl; i = $f.i; it = $f.it; key = $f.key; keyType = $f.keyType; m = $f.m; mlen = $f.mlen; tt = $f.tt; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - new flag(v.flag).mustBe(21); - tt = v.typ.kindType; - keyType = tt.key; - fl = (((v.flag & 96) >>> 0) | (keyType.Kind() >>> 0)) >>> 0; - m = v.pointer(); - mlen = 0; - if (!(m === 0)) { - mlen = maplen(m); - } - it = mapiterinit(v.typ, m); - a = $makeSlice(sliceType$8, mlen); - i = 0; - i = 0; - /* while (true) { */ case 1: - /* if (!(i < a.$length)) { break; } */ if(!(i < a.$length)) { $s = 2; continue; } - _r = mapiterkey(it); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - key = _r; - if (key === 0) { - /* break; */ $s = 2; continue; - } - if (ifaceIndir(keyType)) { - c = unsafe_New(keyType); - typedmemmove(keyType, c, key); - ((i < 0 || i >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + i] = new Value.ptr(keyType, c, (fl | 128) >>> 0)); - } else { - ((i < 0 || i >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + i] = new Value.ptr(keyType, key.$get(), fl)); - } - mapiternext(it); - i = i + (1) >> 0; - /* } */ $s = 1; continue; case 2: - return $subslice(a, 0, i); - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.MapKeys }; } $f.$ptr = $ptr; $f._r = _r; $f.a = a; $f.c = c; $f.fl = fl; $f.i = i; $f.it = it; $f.key = key; $f.keyType = keyType; $f.m = m; $f.mlen = mlen; $f.tt = tt; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.MapKeys = function() { return this.$val.MapKeys(); }; - Value.ptr.prototype.Method = function(i) { - var $ptr, fl, i, v; - v = this; - if (v.typ === ptrType$1.nil) { - $panic(new ValueError.ptr("reflect.Value.Method", 0)); - } - if (!((((v.flag & 512) >>> 0) === 0)) || (i >>> 0) >= (v.typ.NumMethod() >>> 0)) { - $panic(new $String("reflect: Method index out of range")); - } - if ((v.typ.Kind() === 20) && v.IsNil()) { - $panic(new $String("reflect: Method on nil interface value")); - } - fl = (v.flag & 160) >>> 0; - fl = (fl | (19)) >>> 0; - fl = (fl | (((((i >>> 0) << 10 >>> 0) | 512) >>> 0))) >>> 0; - return new Value.ptr(v.typ, v.ptr, fl); - }; - Value.prototype.Method = function(i) { return this.$val.Method(i); }; - Value.ptr.prototype.NumMethod = function() { - var $ptr, v; - v = this; - if (v.typ === ptrType$1.nil) { - $panic(new ValueError.ptr("reflect.Value.NumMethod", 0)); - } - if (!((((v.flag & 512) >>> 0) === 0))) { - return 0; - } - return v.typ.NumMethod(); - }; - Value.prototype.NumMethod = function() { return this.$val.NumMethod(); }; - Value.ptr.prototype.MethodByName = function(name) { - var $ptr, _tuple, m, name, ok, v; - v = this; - if (v.typ === ptrType$1.nil) { - $panic(new ValueError.ptr("reflect.Value.MethodByName", 0)); - } - if (!((((v.flag & 512) >>> 0) === 0))) { - return new Value.ptr(ptrType$1.nil, 0, 0); - } - _tuple = v.typ.MethodByName(name); - m = $clone(_tuple[0], Method); - ok = _tuple[1]; - if (!ok) { - return new Value.ptr(ptrType$1.nil, 0, 0); - } - return v.Method(m.Index); - }; - Value.prototype.MethodByName = function(name) { return this.$val.MethodByName(name); }; - Value.ptr.prototype.NumField = function() { - var $ptr, tt, v; - v = this; - new flag(v.flag).mustBe(25); - tt = v.typ.kindType; - return tt.fields.$length; - }; - Value.prototype.NumField = function() { return this.$val.NumField(); }; - Value.ptr.prototype.OverflowComplex = function(x) { - var $ptr, _9, k, v, x; - v = this; - k = new flag(v.flag).kind(); - _9 = k; - if (_9 === (15)) { - return overflowFloat32(x.$real) || overflowFloat32(x.$imag); - } else if (_9 === (16)) { - return false; - } - $panic(new ValueError.ptr("reflect.Value.OverflowComplex", new flag(v.flag).kind())); - }; - Value.prototype.OverflowComplex = function(x) { return this.$val.OverflowComplex(x); }; - Value.ptr.prototype.OverflowFloat = function(x) { - var $ptr, _10, k, v, x; - v = this; - k = new flag(v.flag).kind(); - _10 = k; - if (_10 === (13)) { - return overflowFloat32(x); - } else if (_10 === (14)) { - return false; - } - $panic(new ValueError.ptr("reflect.Value.OverflowFloat", new flag(v.flag).kind())); - }; - Value.prototype.OverflowFloat = function(x) { return this.$val.OverflowFloat(x); }; - overflowFloat32 = function(x) { - var $ptr, x; - if (x < 0) { - x = -x; - } - return 3.4028234663852886e+38 < x && x <= 1.7976931348623157e+308; - }; - Value.ptr.prototype.OverflowInt = function(x) { - var $ptr, _11, bitSize, k, trunc, v, x; - v = this; - k = new flag(v.flag).kind(); - _11 = k; - if ((_11 === (2)) || (_11 === (3)) || (_11 === (4)) || (_11 === (5)) || (_11 === (6))) { - bitSize = $imul(v.typ.size, 8) >>> 0; - trunc = $shiftRightInt64(($shiftLeft64(x, ((64 - bitSize >>> 0)))), ((64 - bitSize >>> 0))); - return !((x.$high === trunc.$high && x.$low === trunc.$low)); - } - $panic(new ValueError.ptr("reflect.Value.OverflowInt", new flag(v.flag).kind())); - }; - Value.prototype.OverflowInt = function(x) { return this.$val.OverflowInt(x); }; - Value.ptr.prototype.OverflowUint = function(x) { - var $ptr, _12, bitSize, k, trunc, v, x; - v = this; - k = new flag(v.flag).kind(); - _12 = k; - if ((_12 === (7)) || (_12 === (12)) || (_12 === (8)) || (_12 === (9)) || (_12 === (10)) || (_12 === (11))) { - bitSize = $imul(v.typ.size, 8) >>> 0; - trunc = $shiftRightUint64(($shiftLeft64(x, ((64 - bitSize >>> 0)))), ((64 - bitSize >>> 0))); - return !((x.$high === trunc.$high && x.$low === trunc.$low)); - } - $panic(new ValueError.ptr("reflect.Value.OverflowUint", new flag(v.flag).kind())); - }; - Value.prototype.OverflowUint = function(x) { return this.$val.OverflowUint(x); }; - Value.ptr.prototype.Recv = function() { - var $ptr, _r, _tuple, ok, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; ok = $f.ok; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - x = new Value.ptr(ptrType$1.nil, 0, 0); - ok = false; - v = this; - new flag(v.flag).mustBe(18); - new flag(v.flag).mustBeExported(); - _r = v.recv(false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - x = _tuple[0]; - ok = _tuple[1]; - /* */ $s = 2; case 2: - return [x, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Recv }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.ok = ok; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Recv = function() { return this.$val.Recv(); }; - Value.ptr.prototype.recv = function(nb) { - var $ptr, _r, _tuple, nb, ok, p, selected, t, tt, v, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; nb = $f.nb; ok = $f.ok; p = $f.p; selected = $f.selected; t = $f.t; tt = $f.tt; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - val = new Value.ptr(ptrType$1.nil, 0, 0); - ok = false; - v = this; - tt = v.typ.kindType; - if (((tt.dir >> 0) & 1) === 0) { - $panic(new $String("reflect: recv on send-only channel")); - } - t = tt.elem; - val = new Value.ptr(t, 0, (t.Kind() >>> 0)); - p = 0; - if (ifaceIndir(t)) { - p = unsafe_New(t); - val.ptr = p; - val.flag = (val.flag | (128)) >>> 0; - } else { - p = (val.$ptr_ptr || (val.$ptr_ptr = new ptrType$18(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, val))); - } - _r = chanrecv(v.typ, v.pointer(), nb, p); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - selected = _tuple[0]; - ok = _tuple[1]; - if (!selected) { - val = new Value.ptr(ptrType$1.nil, 0, 0); - } - return [val, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.recv }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.nb = nb; $f.ok = ok; $f.p = p; $f.selected = selected; $f.t = t; $f.tt = tt; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.recv = function(nb) { return this.$val.recv(nb); }; - Value.ptr.prototype.Send = function(x) { - var $ptr, _r, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - x = x; - v = this; - new flag(v.flag).mustBe(18); - new flag(v.flag).mustBeExported(); - _r = v.send(x, false); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r; - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Send }; } $f.$ptr = $ptr; $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Send = function(x) { return this.$val.Send(x); }; - Value.ptr.prototype.send = function(x, nb) { - var $ptr, _r, _r$1, nb, p, selected, tt, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; nb = $f.nb; p = $f.p; selected = $f.selected; tt = $f.tt; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - selected = false; - x = x; - v = this; - tt = v.typ.kindType; - if (((tt.dir >> 0) & 2) === 0) { - $panic(new $String("reflect: send on recv-only channel")); - } - new flag(x.flag).mustBeExported(); - _r = x.assignTo("reflect.Value.Send", tt.elem, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - x = _r; - p = 0; - if (!((((x.flag & 128) >>> 0) === 0))) { - p = x.ptr; - } else { - p = (x.$ptr_ptr || (x.$ptr_ptr = new ptrType$18(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, x))); - } - _r$1 = chansend(v.typ, v.pointer(), p, nb); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - selected = _r$1; - /* */ $s = 3; case 3: - return selected; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.send }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.nb = nb; $f.p = p; $f.selected = selected; $f.tt = tt; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.send = function(x, nb) { return this.$val.send(x, nb); }; - Value.ptr.prototype.SetBool = function(x) { - var $ptr, v, x; - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(v.flag).mustBe(1); - v.ptr.$set(x); - }; - Value.prototype.SetBool = function(x) { return this.$val.SetBool(x); }; - Value.ptr.prototype.setRunes = function(x) { - var $ptr, _r, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(v.flag).mustBe(23); - _r = v.typ.Elem().Kind(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!((_r === 5))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((_r === 5))) { */ case 1: - $panic(new $String("reflect.Value.setRunes of non-rune slice")); - /* } */ case 2: - v.ptr.$set(x); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.setRunes }; } $f.$ptr = $ptr; $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.setRunes = function(x) { return this.$val.setRunes(x); }; - Value.ptr.prototype.SetComplex = function(x) { - var $ptr, _14, k, v, x; - v = this; - new flag(v.flag).mustBeAssignable(); - k = new flag(v.flag).kind(); - _14 = k; - if (_14 === (15)) { - v.ptr.$set(new $Complex64(x.$real, x.$imag)); - } else if (_14 === (16)) { - v.ptr.$set(x); - } else { - $panic(new ValueError.ptr("reflect.Value.SetComplex", new flag(v.flag).kind())); - } - }; - Value.prototype.SetComplex = function(x) { return this.$val.SetComplex(x); }; - Value.ptr.prototype.SetFloat = function(x) { - var $ptr, _15, k, v, x; - v = this; - new flag(v.flag).mustBeAssignable(); - k = new flag(v.flag).kind(); - _15 = k; - if (_15 === (13)) { - v.ptr.$set($fround(x)); - } else if (_15 === (14)) { - v.ptr.$set(x); - } else { - $panic(new ValueError.ptr("reflect.Value.SetFloat", new flag(v.flag).kind())); - } - }; - Value.prototype.SetFloat = function(x) { return this.$val.SetFloat(x); }; - Value.ptr.prototype.SetInt = function(x) { - var $ptr, _16, k, v, x; - v = this; - new flag(v.flag).mustBeAssignable(); - k = new flag(v.flag).kind(); - _16 = k; - if (_16 === (2)) { - v.ptr.$set(((x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); - } else if (_16 === (3)) { - v.ptr.$set(((x.$low + ((x.$high >> 31) * 4294967296)) << 24 >> 24)); - } else if (_16 === (4)) { - v.ptr.$set(((x.$low + ((x.$high >> 31) * 4294967296)) << 16 >> 16)); - } else if (_16 === (5)) { - v.ptr.$set(((x.$low + ((x.$high >> 31) * 4294967296)) >> 0)); - } else if (_16 === (6)) { - v.ptr.$set(x); - } else { - $panic(new ValueError.ptr("reflect.Value.SetInt", new flag(v.flag).kind())); - } - }; - Value.prototype.SetInt = function(x) { return this.$val.SetInt(x); }; - Value.ptr.prototype.SetMapIndex = function(key, val) { - var $ptr, _r, _r$1, e, k, key, tt, v, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; e = $f.e; k = $f.k; key = $f.key; tt = $f.tt; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - val = val; - key = key; - v = this; - new flag(v.flag).mustBe(21); - new flag(v.flag).mustBeExported(); - new flag(key.flag).mustBeExported(); - tt = v.typ.kindType; - _r = key.assignTo("reflect.Value.SetMapIndex", tt.key, 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - key = _r; - k = 0; - if (!((((key.flag & 128) >>> 0) === 0))) { - k = key.ptr; - } else { - k = (key.$ptr_ptr || (key.$ptr_ptr = new ptrType$18(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, key))); - } - if (val.typ === ptrType$1.nil) { - mapdelete(v.typ, v.pointer(), k); - return; - } - new flag(val.flag).mustBeExported(); - _r$1 = val.assignTo("reflect.Value.SetMapIndex", tt.elem, 0); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - val = _r$1; - e = 0; - if (!((((val.flag & 128) >>> 0) === 0))) { - e = val.ptr; - } else { - e = (val.$ptr_ptr || (val.$ptr_ptr = new ptrType$18(function() { return this.$target.ptr; }, function($v) { this.$target.ptr = $v; }, val))); - } - $r = mapassign(v.typ, v.pointer(), k, e); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.SetMapIndex }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.e = e; $f.k = k; $f.key = key; $f.tt = tt; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.SetMapIndex = function(key, val) { return this.$val.SetMapIndex(key, val); }; - Value.ptr.prototype.SetUint = function(x) { - var $ptr, _17, k, v, x; - v = this; - new flag(v.flag).mustBeAssignable(); - k = new flag(v.flag).kind(); - _17 = k; - if (_17 === (7)) { - v.ptr.$set((x.$low >>> 0)); - } else if (_17 === (8)) { - v.ptr.$set((x.$low << 24 >>> 24)); - } else if (_17 === (9)) { - v.ptr.$set((x.$low << 16 >>> 16)); - } else if (_17 === (10)) { - v.ptr.$set((x.$low >>> 0)); - } else if (_17 === (11)) { - v.ptr.$set(x); - } else if (_17 === (12)) { - v.ptr.$set((x.$low >>> 0)); - } else { - $panic(new ValueError.ptr("reflect.Value.SetUint", new flag(v.flag).kind())); - } - }; - Value.prototype.SetUint = function(x) { return this.$val.SetUint(x); }; - Value.ptr.prototype.SetPointer = function(x) { - var $ptr, v, x; - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(v.flag).mustBe(26); - v.ptr.$set(x); - }; - Value.prototype.SetPointer = function(x) { return this.$val.SetPointer(x); }; - Value.ptr.prototype.SetString = function(x) { - var $ptr, v, x; - v = this; - new flag(v.flag).mustBeAssignable(); - new flag(v.flag).mustBe(24); - v.ptr.$set(x); - }; - Value.prototype.SetString = function(x) { return this.$val.SetString(x); }; - Value.ptr.prototype.String = function() { - var $ptr, _20, _r, k, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _20 = $f._20; _r = $f._r; k = $f.k; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - k = new flag(v.flag).kind(); - _20 = k; - if (_20 === (0)) { - return ""; - } else if (_20 === (24)) { - return v.ptr.$get(); - } - _r = v.Type().String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return "<" + _r + " Value>"; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.String }; } $f.$ptr = $ptr; $f._20 = _20; $f._r = _r; $f.k = k; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.String = function() { return this.$val.String(); }; - Value.ptr.prototype.TryRecv = function() { - var $ptr, _r, _tuple, ok, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; ok = $f.ok; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - x = new Value.ptr(ptrType$1.nil, 0, 0); - ok = false; - v = this; - new flag(v.flag).mustBe(18); - new flag(v.flag).mustBeExported(); - _r = v.recv(true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - x = _tuple[0]; - ok = _tuple[1]; - /* */ $s = 2; case 2: - return [x, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.TryRecv }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.ok = ok; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.TryRecv = function() { return this.$val.TryRecv(); }; - Value.ptr.prototype.TrySend = function(x) { - var $ptr, _r, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - x = x; - v = this; - new flag(v.flag).mustBe(18); - new flag(v.flag).mustBeExported(); - _r = v.send(x, true); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.TrySend }; } $f.$ptr = $ptr; $f._r = _r; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.TrySend = function(x) { return this.$val.TrySend(x); }; - Value.ptr.prototype.Type = function() { - var $ptr, f, i, m, m$1, tt, ut, v, x, x$1; - v = this; - f = v.flag; - if (f === 0) { - $panic(new ValueError.ptr("reflect.Value.Type", 0)); - } - if (((f & 512) >>> 0) === 0) { - return v.typ; - } - i = (v.flag >> 0) >> 10 >> 0; - if (v.typ.Kind() === 20) { - tt = v.typ.kindType; - if ((i >>> 0) >= (tt.methods.$length >>> 0)) { - $panic(new $String("reflect: internal error: invalid method index")); - } - m = (x = tt.methods, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - return m.typ; - } - ut = v.typ.uncommonType.uncommon(); - if (ut === ptrType$7.nil || (i >>> 0) >= (ut.methods.$length >>> 0)) { - $panic(new $String("reflect: internal error: invalid method index")); - } - m$1 = (x$1 = ut.methods, ((i < 0 || i >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + i])); - return m$1.mtyp; - }; - Value.prototype.Type = function() { return this.$val.Type(); }; - Value.ptr.prototype.Uint = function() { - var $ptr, _21, k, p, v, x; - v = this; - k = new flag(v.flag).kind(); - p = v.ptr; - _21 = k; - if (_21 === (7)) { - return new $Uint64(0, p.$get()); - } else if (_21 === (8)) { - return new $Uint64(0, p.$get()); - } else if (_21 === (9)) { - return new $Uint64(0, p.$get()); - } else if (_21 === (10)) { - return new $Uint64(0, p.$get()); - } else if (_21 === (11)) { - return p.$get(); - } else if (_21 === (12)) { - return (x = p.$get(), new $Uint64(0, x.constructor === Number ? x : 1)); - } - $panic(new ValueError.ptr("reflect.Value.Uint", new flag(v.flag).kind())); - }; - Value.prototype.Uint = function() { return this.$val.Uint(); }; - Value.ptr.prototype.UnsafeAddr = function() { - var $ptr, v; - v = this; - if (v.typ === ptrType$1.nil) { - $panic(new ValueError.ptr("reflect.Value.UnsafeAddr", 0)); - } - if (((v.flag & 256) >>> 0) === 0) { - $panic(new $String("reflect.Value.UnsafeAddr of unaddressable value")); - } - return v.ptr; - }; - Value.prototype.UnsafeAddr = function() { return this.$val.UnsafeAddr(); }; - New = function(typ) { - var $ptr, _r, _r$1, fl, ptr, typ, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; fl = $f.fl; ptr = $f.ptr; typ = $f.typ; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - if ($interfaceIsEqual(typ, $ifaceNil)) { - $panic(new $String("reflect: New(nil)")); - } - ptr = unsafe_New($assertType(typ, ptrType$1)); - fl = 22; - _r = typ.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = _r.ptrTo(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 3; case 3: - return new Value.ptr(_r$1, ptr, fl); - /* */ } return; } if ($f === undefined) { $f = { $blk: New }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.fl = fl; $f.ptr = ptr; $f.typ = typ; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.New = New; - Value.ptr.prototype.assignTo = function(context, dst, target) { - var $ptr, _r, _r$1, context, dst, fl, target, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; context = $f.context; dst = $f.dst; fl = $f.fl; target = $f.target; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: - _r = makeMethodValue(context, v); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - v = _r; - /* } */ case 2: - /* */ if (directlyAssignable(dst, v.typ)) { $s = 5; continue; } - /* */ if (implements$1(dst, v.typ)) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if (directlyAssignable(dst, v.typ)) { */ case 5: - v.typ = dst; - fl = (v.flag & 480) >>> 0; - fl = (fl | ((dst.Kind() >>> 0))) >>> 0; - return new Value.ptr(dst, v.ptr, fl); - /* } else if (implements$1(dst, v.typ)) { */ case 6: - if (target === 0) { - target = unsafe_New(dst); - } - _r$1 = valueInterface(v, false); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - x = _r$1; - if (dst.NumMethod() === 0) { - target.$set(x); - } else { - ifaceE2I(dst, x, target); - } - return new Value.ptr(dst, target, 148); - /* } */ case 7: - case 4: - $panic(new $String(context + ": value of type " + v.typ.String() + " is not assignable to type " + dst.String())); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.assignTo }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.context = context; $f.dst = dst; $f.fl = fl; $f.target = target; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.assignTo = function(context, dst, target) { return this.$val.assignTo(context, dst, target); }; - Value.ptr.prototype.Convert = function(t) { - var $ptr, _r, _r$1, _r$2, _r$3, _r$4, op, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; op = $f.op; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = this; - /* */ if (!((((v.flag & 512) >>> 0) === 0))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((((v.flag & 512) >>> 0) === 0))) { */ case 1: - _r = makeMethodValue("Convert", v); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - v = _r; - /* } */ case 2: - _r$1 = t.common(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = convertOp(_r$1, v.typ); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - op = _r$2; - /* */ if (op === $throwNilPointerError) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if (op === $throwNilPointerError) { */ case 6: - _r$3 = t.String(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - $panic(new $String("reflect.Value.Convert: value of type " + v.typ.String() + " cannot be converted to type " + _r$3)); - /* } */ case 7: - _r$4 = op(v, t); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - /* */ $s = 10; case 10: - return _r$4; - /* */ } return; } if ($f === undefined) { $f = { $blk: Value.ptr.prototype.Convert }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.op = op; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Value.prototype.Convert = function(t) { return this.$val.Convert(t); }; - convertOp = function(dst, src) { - var $ptr, _23, _24, _25, _26, _27, _28, _29, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _v, _v$1, _v$2, dst, src, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _23 = $f._23; _24 = $f._24; _25 = $f._25; _26 = $f._26; _27 = $f._27; _28 = $f._28; _29 = $f._29; _arg = $f._arg; _arg$1 = $f._arg$1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; dst = $f.dst; src = $f.src; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _23 = src.Kind(); - /* */ if ((_23 === (2)) || (_23 === (3)) || (_23 === (4)) || (_23 === (5)) || (_23 === (6))) { $s = 2; continue; } - /* */ if ((_23 === (7)) || (_23 === (8)) || (_23 === (9)) || (_23 === (10)) || (_23 === (11)) || (_23 === (12))) { $s = 3; continue; } - /* */ if ((_23 === (13)) || (_23 === (14))) { $s = 4; continue; } - /* */ if ((_23 === (15)) || (_23 === (16))) { $s = 5; continue; } - /* */ if (_23 === (24)) { $s = 6; continue; } - /* */ if (_23 === (23)) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if ((_23 === (2)) || (_23 === (3)) || (_23 === (4)) || (_23 === (5)) || (_23 === (6))) { */ case 2: - _24 = dst.Kind(); - if ((_24 === (2)) || (_24 === (3)) || (_24 === (4)) || (_24 === (5)) || (_24 === (6)) || (_24 === (7)) || (_24 === (8)) || (_24 === (9)) || (_24 === (10)) || (_24 === (11)) || (_24 === (12))) { - return cvtInt; - } else if ((_24 === (13)) || (_24 === (14))) { - return cvtIntFloat; - } else if (_24 === (24)) { - return cvtIntString; - } - $s = 8; continue; - /* } else if ((_23 === (7)) || (_23 === (8)) || (_23 === (9)) || (_23 === (10)) || (_23 === (11)) || (_23 === (12))) { */ case 3: - _25 = dst.Kind(); - if ((_25 === (2)) || (_25 === (3)) || (_25 === (4)) || (_25 === (5)) || (_25 === (6)) || (_25 === (7)) || (_25 === (8)) || (_25 === (9)) || (_25 === (10)) || (_25 === (11)) || (_25 === (12))) { - return cvtUint; - } else if ((_25 === (13)) || (_25 === (14))) { - return cvtUintFloat; - } else if (_25 === (24)) { - return cvtUintString; - } - $s = 8; continue; - /* } else if ((_23 === (13)) || (_23 === (14))) { */ case 4: - _26 = dst.Kind(); - if ((_26 === (2)) || (_26 === (3)) || (_26 === (4)) || (_26 === (5)) || (_26 === (6))) { - return cvtFloatInt; - } else if ((_26 === (7)) || (_26 === (8)) || (_26 === (9)) || (_26 === (10)) || (_26 === (11)) || (_26 === (12))) { - return cvtFloatUint; - } else if ((_26 === (13)) || (_26 === (14))) { - return cvtFloat; - } - $s = 8; continue; - /* } else if ((_23 === (15)) || (_23 === (16))) { */ case 5: - _27 = dst.Kind(); - if ((_27 === (15)) || (_27 === (16))) { - return cvtComplex; - } - $s = 8; continue; - /* } else if (_23 === (24)) { */ case 6: - if (!(dst.Kind() === 23)) { _v = false; $s = 11; continue s; } - _r = dst.Elem().PkgPath(); /* */ $s = 12; case 12: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _v = _r === ""; case 11: - /* */ if (_v) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (_v) { */ case 9: - _r$1 = dst.Elem().Kind(); /* */ $s = 14; case 14: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _28 = _r$1; - if (_28 === (8)) { - return cvtStringBytes; - } else if (_28 === (5)) { - return cvtStringRunes; - } - case 13: - /* } */ case 10: - $s = 8; continue; - /* } else if (_23 === (23)) { */ case 7: - if (!(dst.Kind() === 24)) { _v$1 = false; $s = 17; continue s; } - _r$2 = src.Elem().PkgPath(); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _v$1 = _r$2 === ""; case 17: - /* */ if (_v$1) { $s = 15; continue; } - /* */ $s = 16; continue; - /* if (_v$1) { */ case 15: - _r$3 = src.Elem().Kind(); /* */ $s = 20; case 20: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _29 = _r$3; - if (_29 === (8)) { - return cvtBytesString; - } else if (_29 === (5)) { - return cvtRunesString; - } - case 19: - /* } */ case 16: - /* } */ case 8: - case 1: - if (haveIdenticalUnderlyingType(dst, src)) { - return cvtDirect; - } - if (!((dst.Kind() === 22) && dst.Name() === "" && (src.Kind() === 22) && src.Name() === "")) { _v$2 = false; $s = 23; continue s; } - _r$4 = dst.Elem().common(); /* */ $s = 24; case 24: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _arg = _r$4; - _r$5 = src.Elem().common(); /* */ $s = 25; case 25: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _arg$1 = _r$5; - _r$6 = haveIdenticalUnderlyingType(_arg, _arg$1); /* */ $s = 26; case 26: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _v$2 = _r$6; case 23: - /* */ if (_v$2) { $s = 21; continue; } - /* */ $s = 22; continue; - /* if (_v$2) { */ case 21: - return cvtDirect; - /* } */ case 22: - if (implements$1(dst, src)) { - if (src.Kind() === 20) { - return cvtI2I; - } - return cvtT2I; - } - return $throwNilPointerError; - /* */ } return; } if ($f === undefined) { $f = { $blk: convertOp }; } $f.$ptr = $ptr; $f._23 = _23; $f._24 = _24; $f._25 = _25; $f._26 = _26; $f._27 = _27; $f._28 = _28; $f._29 = _29; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f.dst = dst; $f.src = src; $f.$s = $s; $f.$r = $r; return $f; - }; - makeFloat = function(f, v, t) { - var $ptr, _31, _r, f, ptr, t, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _31 = $f._31; _r = $f._r; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - typ = _r; - ptr = unsafe_New(typ); - _31 = typ.size; - if (_31 === (4)) { - ptr.$set($fround(v)); - } else if (_31 === (8)) { - ptr.$set(v); - } - return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | (typ.Kind() >>> 0)) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: makeFloat }; } $f.$ptr = $ptr; $f._31 = _31; $f._r = _r; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - makeComplex = function(f, v, t) { - var $ptr, _32, _r, f, ptr, t, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _32 = $f._32; _r = $f._r; f = $f.f; ptr = $f.ptr; t = $f.t; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = t.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - typ = _r; - ptr = unsafe_New(typ); - _32 = typ.size; - if (_32 === (8)) { - ptr.$set(new $Complex64(v.$real, v.$imag)); - } else if (_32 === (16)) { - ptr.$set(v); - } - return new Value.ptr(typ, ptr, (((f | 128) >>> 0) | (typ.Kind() >>> 0)) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: makeComplex }; } $f.$ptr = $ptr; $f._32 = _32; $f._r = _r; $f.f = f; $f.ptr = ptr; $f.t = t; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - makeString = function(f, v, t) { - var $ptr, _r, _r$1, f, ret, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = New(t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = _r.Elem(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - ret = _r$1; - ret.SetString(v); - ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; - return ret; - /* */ } return; } if ($f === undefined) { $f = { $blk: makeString }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - makeBytes = function(f, v, t) { - var $ptr, _r, _r$1, f, ret, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = New(t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = _r.Elem(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - ret = _r$1; - $r = ret.SetBytes(v); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; - return ret; - /* */ } return; } if ($f === undefined) { $f = { $blk: makeBytes }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - makeRunes = function(f, v, t) { - var $ptr, _r, _r$1, f, ret, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; f = $f.f; ret = $f.ret; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = New(t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = _r.Elem(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - ret = _r$1; - $r = ret.setRunes(v); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - ret.flag = (((ret.flag & ~256) >>> 0) | f) >>> 0; - return ret; - /* */ } return; } if ($f === undefined) { $f = { $blk: makeRunes }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.ret = ret; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtInt = function(v, t) { - var $ptr, _r, t, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r = makeInt((v.flag & 96) >>> 0, (x = v.Int(), new $Uint64(x.$high, x.$low)), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtInt }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtUint = function(v, t) { - var $ptr, _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r = makeInt((v.flag & 96) >>> 0, v.Uint(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUint }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtFloatInt = function(v, t) { - var $ptr, _r, t, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r = makeInt((v.flag & 96) >>> 0, (x = new $Int64(0, v.Float()), new $Uint64(x.$high, x.$low)), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloatInt }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtFloatUint = function(v, t) { - var $ptr, _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r = makeInt((v.flag & 96) >>> 0, new $Uint64(0, v.Float()), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloatUint }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtIntFloat = function(v, t) { - var $ptr, _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r = makeFloat((v.flag & 96) >>> 0, $flatten64(v.Int()), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtIntFloat }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtUintFloat = function(v, t) { - var $ptr, _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r = makeFloat((v.flag & 96) >>> 0, $flatten64(v.Uint()), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUintFloat }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtFloat = function(v, t) { - var $ptr, _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r = makeFloat((v.flag & 96) >>> 0, v.Float(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtFloat }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtComplex = function(v, t) { - var $ptr, _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r = makeComplex((v.flag & 96) >>> 0, v.Complex(), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtComplex }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtIntString = function(v, t) { - var $ptr, _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r = makeString((v.flag & 96) >>> 0, $encodeRune(v.Int().$low), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtIntString }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtUintString = function(v, t) { - var $ptr, _r, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r = makeString((v.flag & 96) >>> 0, $encodeRune(v.Uint().$low), t); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtUintString }; } $f.$ptr = $ptr; $f._r = _r; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtBytesString = function(v, t) { - var $ptr, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _arg = (v.flag & 96) >>> 0; - _r = v.Bytes(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _arg$1 = $bytesToString(_r); - _arg$2 = t; - _r$1 = makeString(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 3; case 3: - return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtBytesString }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtStringBytes = function(v, t) { - var $ptr, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _arg = (v.flag & 96) >>> 0; - _r = v.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _arg$1 = new sliceType$13($stringToBytes(_r)); - _arg$2 = t; - _r$1 = makeBytes(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 3; case 3: - return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtStringBytes }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtRunesString = function(v, t) { - var $ptr, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _arg = (v.flag & 96) >>> 0; - _r = v.runes(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _arg$1 = $runesToString(_r); - _arg$2 = t; - _r$1 = makeString(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 3; case 3: - return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtRunesString }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtStringRunes = function(v, t) { - var $ptr, _arg, _arg$1, _arg$2, _r, _r$1, t, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r = $f._r; _r$1 = $f._r$1; t = $f.t; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _arg = (v.flag & 96) >>> 0; - _r = v.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _arg$1 = new sliceType$15($stringToRunes(_r)); - _arg$2 = t; - _r$1 = makeRunes(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 3; case 3: - return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtStringRunes }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r = _r; $f._r$1 = _r$1; $f.t = t; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtT2I = function(v, typ) { - var $ptr, _r, _r$1, _r$2, _r$3, _r$4, target, typ, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; target = $f.target; typ = $f.typ; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r = typ.common(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r$1 = unsafe_New(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - target = _r$1; - _r$2 = valueInterface(v, false); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - x = _r$2; - _r$3 = typ.NumMethod(); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (_r$3 === 0) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_r$3 === 0) { */ case 4: - target.$set(x); - $s = 6; continue; - /* } else { */ case 5: - ifaceE2I($assertType(typ, ptrType$1), x, target); - /* } */ case 6: - _r$4 = typ.common(); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - /* */ $s = 9; case 9: - return new Value.ptr(_r$4, target, (((((v.flag & 96) >>> 0) | 128) >>> 0) | 20) >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtT2I }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.target = target; $f.typ = typ; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - cvtI2I = function(v, typ) { - var $ptr, _r, _r$1, _r$2, ret, typ, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; ret = $f.ret; typ = $f.typ; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - /* */ if (v.IsNil()) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (v.IsNil()) { */ case 1: - _r = Zero(typ); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - ret = _r; - ret.flag = (ret.flag | (((v.flag & 96) >>> 0))) >>> 0; - return ret; - /* } */ case 2: - _r$1 = v.Elem(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = cvtT2I(_r$1, typ); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ $s = 6; case 6: - return _r$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: cvtI2I }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.ret = ret; $f.typ = typ; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Kind.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$1.methods = [{prop: "ptrTo", name: "ptrTo", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "pointers", name: "pointers", pkg: "reflect", typ: $funcType([], [$Bool], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Align", name: "Align", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "FieldAlign", name: "FieldAlign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "common", name: "common", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "ChanDir", name: "ChanDir", pkg: "", typ: $funcType([], [ChanDir], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$11], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumIn", name: "NumIn", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumOut", name: "NumOut", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Out", name: "Out", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "ConvertibleTo", name: "ConvertibleTo", pkg: "", typ: $funcType([Type], [$Bool], false)}]; - ptrType$7.methods = [{prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "uncommon", name: "uncommon", pkg: "reflect", typ: $funcType([], [ptrType$7], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}]; - ChanDir.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$11.methods = [{prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}]; - ptrType$13.methods = [{prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$11], [StructField], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}]; - StructTag.methods = [{prop: "Get", name: "Get", pkg: "", typ: $funcType([$String], [$String], false)}]; - Value.methods = [{prop: "object", name: "object", pkg: "reflect", typ: $funcType([], [ptrType$3], false)}, {prop: "call", name: "call", pkg: "reflect", typ: $funcType([$String, sliceType$8], [sliceType$8], false)}, {prop: "Cap", name: "Cap", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "Index", name: "Index", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "InterfaceData", name: "InterfaceData", pkg: "", typ: $funcType([], [arrayType$3], false)}, {prop: "IsNil", name: "IsNil", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Pointer", name: "Pointer", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([Value], [], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType$13], [], false)}, {prop: "SetCap", name: "SetCap", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "SetLen", name: "SetLen", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Slice", name: "Slice", pkg: "", typ: $funcType([$Int, $Int], [Value], false)}, {prop: "Slice3", name: "Slice3", pkg: "", typ: $funcType([$Int, $Int, $Int], [Value], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [], false)}, {prop: "pointer", name: "pointer", pkg: "reflect", typ: $funcType([], [$UnsafePointer], false)}, {prop: "Addr", name: "Addr", pkg: "", typ: $funcType([], [Value], false)}, {prop: "Bool", name: "Bool", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType$13], false)}, {prop: "runes", name: "runes", pkg: "reflect", typ: $funcType([], [sliceType$15], false)}, {prop: "CanAddr", name: "CanAddr", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "CanSet", name: "CanSet", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Call", name: "Call", pkg: "", typ: $funcType([sliceType$8], [sliceType$8], false)}, {prop: "CallSlice", name: "CallSlice", pkg: "", typ: $funcType([sliceType$8], [sliceType$8], false)}, {prop: "Complex", name: "Complex", pkg: "", typ: $funcType([], [$Complex128], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$11], [Value], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [Value], false)}, {prop: "Float", name: "Float", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "CanInterface", name: "CanInterface", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Interface", name: "Interface", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "IsValid", name: "IsValid", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "MapIndex", name: "MapIndex", pkg: "", typ: $funcType([Value], [Value], false)}, {prop: "MapKeys", name: "MapKeys", pkg: "", typ: $funcType([], [sliceType$8], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Value], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Value], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "OverflowComplex", name: "OverflowComplex", pkg: "", typ: $funcType([$Complex128], [$Bool], false)}, {prop: "OverflowFloat", name: "OverflowFloat", pkg: "", typ: $funcType([$Float64], [$Bool], false)}, {prop: "OverflowInt", name: "OverflowInt", pkg: "", typ: $funcType([$Int64], [$Bool], false)}, {prop: "OverflowUint", name: "OverflowUint", pkg: "", typ: $funcType([$Uint64], [$Bool], false)}, {prop: "Recv", name: "Recv", pkg: "", typ: $funcType([], [Value, $Bool], false)}, {prop: "recv", name: "recv", pkg: "reflect", typ: $funcType([$Bool], [Value, $Bool], false)}, {prop: "Send", name: "Send", pkg: "", typ: $funcType([Value], [], false)}, {prop: "send", name: "send", pkg: "reflect", typ: $funcType([Value, $Bool], [$Bool], false)}, {prop: "SetBool", name: "SetBool", pkg: "", typ: $funcType([$Bool], [], false)}, {prop: "setRunes", name: "setRunes", pkg: "reflect", typ: $funcType([sliceType$15], [], false)}, {prop: "SetComplex", name: "SetComplex", pkg: "", typ: $funcType([$Complex128], [], false)}, {prop: "SetFloat", name: "SetFloat", pkg: "", typ: $funcType([$Float64], [], false)}, {prop: "SetInt", name: "SetInt", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "SetMapIndex", name: "SetMapIndex", pkg: "", typ: $funcType([Value, Value], [], false)}, {prop: "SetUint", name: "SetUint", pkg: "", typ: $funcType([$Uint64], [], false)}, {prop: "SetPointer", name: "SetPointer", pkg: "", typ: $funcType([$UnsafePointer], [], false)}, {prop: "SetString", name: "SetString", pkg: "", typ: $funcType([$String], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "TryRecv", name: "TryRecv", pkg: "", typ: $funcType([], [Value, $Bool], false)}, {prop: "TrySend", name: "TrySend", pkg: "", typ: $funcType([Value], [$Bool], false)}, {prop: "Type", name: "Type", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Uint", name: "Uint", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "UnsafeAddr", name: "UnsafeAddr", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "assignTo", name: "assignTo", pkg: "reflect", typ: $funcType([$String, ptrType$1, $UnsafePointer], [Value], false)}, {prop: "Convert", name: "Convert", pkg: "", typ: $funcType([Type], [Value], false)}]; - flag.methods = [{prop: "kind", name: "kind", pkg: "reflect", typ: $funcType([], [Kind], false)}, {prop: "mustBe", name: "mustBe", pkg: "reflect", typ: $funcType([Kind], [], false)}, {prop: "mustBeExported", name: "mustBeExported", pkg: "reflect", typ: $funcType([], [], false)}, {prop: "mustBeAssignable", name: "mustBeAssignable", pkg: "reflect", typ: $funcType([], [], false)}]; - ptrType$20.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - mapIter.init([{prop: "t", name: "t", pkg: "reflect", typ: Type, tag: ""}, {prop: "m", name: "m", pkg: "reflect", typ: ptrType$3, tag: ""}, {prop: "keys", name: "keys", pkg: "reflect", typ: ptrType$3, tag: ""}, {prop: "i", name: "i", pkg: "reflect", typ: $Int, tag: ""}]); - Type.init([{prop: "Align", name: "Align", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "AssignableTo", name: "AssignableTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "ChanDir", name: "ChanDir", pkg: "", typ: $funcType([], [ChanDir], false)}, {prop: "Comparable", name: "Comparable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ConvertibleTo", name: "ConvertibleTo", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "Elem", name: "Elem", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Field", name: "Field", pkg: "", typ: $funcType([$Int], [StructField], false)}, {prop: "FieldAlign", name: "FieldAlign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "FieldByIndex", name: "FieldByIndex", pkg: "", typ: $funcType([sliceType$11], [StructField], false)}, {prop: "FieldByName", name: "FieldByName", pkg: "", typ: $funcType([$String], [StructField, $Bool], false)}, {prop: "FieldByNameFunc", name: "FieldByNameFunc", pkg: "", typ: $funcType([funcType$3], [StructField, $Bool], false)}, {prop: "Implements", name: "Implements", pkg: "", typ: $funcType([Type], [$Bool], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "IsVariadic", name: "IsVariadic", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Key", name: "Key", pkg: "", typ: $funcType([], [Type], false)}, {prop: "Kind", name: "Kind", pkg: "", typ: $funcType([], [Kind], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Method", name: "Method", pkg: "", typ: $funcType([$Int], [Method], false)}, {prop: "MethodByName", name: "MethodByName", pkg: "", typ: $funcType([$String], [Method, $Bool], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "NumField", name: "NumField", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumIn", name: "NumIn", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumMethod", name: "NumMethod", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "NumOut", name: "NumOut", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Out", name: "Out", pkg: "", typ: $funcType([$Int], [Type], false)}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "common", name: "common", pkg: "reflect", typ: $funcType([], [ptrType$1], false)}, {prop: "uncommon", name: "uncommon", pkg: "reflect", typ: $funcType([], [ptrType$7], false)}]); - rtype.init([{prop: "size", name: "size", pkg: "reflect", typ: $Uintptr, tag: ""}, {prop: "ptrdata", name: "ptrdata", pkg: "reflect", typ: $Uintptr, tag: ""}, {prop: "hash", name: "hash", pkg: "reflect", typ: $Uint32, tag: ""}, {prop: "_$3", name: "_", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "align", name: "align", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "fieldAlign", name: "fieldAlign", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "kind", name: "kind", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "alg", name: "alg", pkg: "reflect", typ: ptrType$4, tag: ""}, {prop: "gcdata", name: "gcdata", pkg: "reflect", typ: ptrType$5, tag: ""}, {prop: "string", name: "string", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "uncommonType", name: "", pkg: "reflect", typ: ptrType$7, tag: ""}, {prop: "ptrToThis", name: "ptrToThis", pkg: "reflect", typ: ptrType$1, tag: ""}]); - typeAlg.init([{prop: "hash", name: "hash", pkg: "reflect", typ: funcType$4, tag: ""}, {prop: "equal", name: "equal", pkg: "reflect", typ: funcType$5, tag: ""}]); - method.init([{prop: "name", name: "name", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "mtyp", name: "mtyp", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "ifn", name: "ifn", pkg: "reflect", typ: $UnsafePointer, tag: ""}, {prop: "tfn", name: "tfn", pkg: "reflect", typ: $UnsafePointer, tag: ""}]); - uncommonType.init([{prop: "name", name: "name", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "methods", name: "methods", pkg: "reflect", typ: sliceType$4, tag: ""}]); - arrayType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"array\""}, {prop: "elem", name: "elem", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "slice", name: "slice", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "len", name: "len", pkg: "reflect", typ: $Uintptr, tag: ""}]); - chanType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"chan\""}, {prop: "elem", name: "elem", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "dir", name: "dir", pkg: "reflect", typ: $Uintptr, tag: ""}]); - funcType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"func\""}, {prop: "dotdotdot", name: "dotdotdot", pkg: "reflect", typ: $Bool, tag: ""}, {prop: "in$2", name: "in", pkg: "reflect", typ: sliceType$1, tag: ""}, {prop: "out", name: "out", pkg: "reflect", typ: sliceType$1, tag: ""}]); - imethod.init([{prop: "name", name: "name", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$1, tag: ""}]); - interfaceType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"interface\""}, {prop: "methods", name: "methods", pkg: "reflect", typ: sliceType$5, tag: ""}]); - mapType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"map\""}, {prop: "key", name: "key", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "elem", name: "elem", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "bucket", name: "bucket", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "hmap", name: "hmap", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "keysize", name: "keysize", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "indirectkey", name: "indirectkey", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "valuesize", name: "valuesize", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "indirectvalue", name: "indirectvalue", pkg: "reflect", typ: $Uint8, tag: ""}, {prop: "bucketsize", name: "bucketsize", pkg: "reflect", typ: $Uint16, tag: ""}, {prop: "reflexivekey", name: "reflexivekey", pkg: "reflect", typ: $Bool, tag: ""}, {prop: "needkeyupdate", name: "needkeyupdate", pkg: "reflect", typ: $Bool, tag: ""}]); - ptrType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"ptr\""}, {prop: "elem", name: "elem", pkg: "reflect", typ: ptrType$1, tag: ""}]); - sliceType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"slice\""}, {prop: "elem", name: "elem", pkg: "reflect", typ: ptrType$1, tag: ""}]); - structField.init([{prop: "name", name: "name", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "pkgPath", name: "pkgPath", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "tag", name: "tag", pkg: "reflect", typ: ptrType$6, tag: ""}, {prop: "offset", name: "offset", pkg: "reflect", typ: $Uintptr, tag: ""}]); - structType.init([{prop: "rtype", name: "", pkg: "reflect", typ: rtype, tag: "reflect:\"struct\""}, {prop: "fields", name: "fields", pkg: "reflect", typ: sliceType$6, tag: ""}]); - Method.init([{prop: "Name", name: "Name", pkg: "", typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $String, tag: ""}, {prop: "Type", name: "Type", pkg: "", typ: Type, tag: ""}, {prop: "Func", name: "Func", pkg: "", typ: Value, tag: ""}, {prop: "Index", name: "Index", pkg: "", typ: $Int, tag: ""}]); - StructField.init([{prop: "Name", name: "Name", pkg: "", typ: $String, tag: ""}, {prop: "PkgPath", name: "PkgPath", pkg: "", typ: $String, tag: ""}, {prop: "Type", name: "Type", pkg: "", typ: Type, tag: ""}, {prop: "Tag", name: "Tag", pkg: "", typ: StructTag, tag: ""}, {prop: "Offset", name: "Offset", pkg: "", typ: $Uintptr, tag: ""}, {prop: "Index", name: "Index", pkg: "", typ: sliceType$11, tag: ""}, {prop: "Anonymous", name: "Anonymous", pkg: "", typ: $Bool, tag: ""}]); - fieldScan.init([{prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$13, tag: ""}, {prop: "index", name: "index", pkg: "reflect", typ: sliceType$11, tag: ""}]); - Value.init([{prop: "typ", name: "typ", pkg: "reflect", typ: ptrType$1, tag: ""}, {prop: "ptr", name: "ptr", pkg: "reflect", typ: $UnsafePointer, tag: ""}, {prop: "flag", name: "", pkg: "reflect", typ: flag, tag: ""}]); - ValueError.init([{prop: "Method", name: "Method", pkg: "", typ: $String, tag: ""}, {prop: "Kind", name: "Kind", pkg: "", typ: Kind, tag: ""}]); - nonEmptyInterface.init([{prop: "itab", name: "itab", pkg: "reflect", typ: ptrType$9, tag: ""}, {prop: "word", name: "word", pkg: "reflect", typ: $UnsafePointer, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = math.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strconv.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - initialized = false; - stringPtrMap = {}; - callHelper = $assertType($internalize($call, $emptyInterface), funcType$1); - selectHelper = $assertType($internalize($select, $emptyInterface), funcType$1); - kindNames = new sliceType$3(["invalid", "bool", "int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "uintptr", "float32", "float64", "complex64", "complex128", "array", "chan", "func", "interface", "map", "ptr", "slice", "string", "struct", "unsafe.Pointer"]); - jsObjectPtr = reflectType($jsObjectPtr); - uint8Type = $assertType(TypeOf(new $Uint8(0)), ptrType$1); - $r = init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["encoding/binary"] = (function() { - var $pkg = {}, $init, errors, io, math, reflect, overflow; - errors = $packages["errors"]; - io = $packages["io"]; - math = $packages["math"]; - reflect = $packages["reflect"]; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = math.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = reflect.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - overflow = errors.New("binary: varint overflows a 64-bit integer"); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["syscall"] = (function() { - var $pkg = {}, $init, js, race, runtime, sync, mmapper, Errno, Timespec, Stat_t, Dirent, sliceType, sliceType$1, ptrType$2, arrayType$5, arrayType$13, arrayType$14, structType, ptrType$22, ptrType$25, mapType, funcType, funcType$1, ptrType$29, arrayType$18, warningPrinted, lineBuffer, syscallModule, alreadyTriedToLoad, minusOne, envOnce, envLock, env, envs, mapper, errEAGAIN, errEINVAL, errENOENT, ioSync, ioSync$24ptr, errors, init, printWarning, printToConsole, use, indexByte, runtime_envs, syscall, Syscall, Syscall6, BytePtrFromString, copyenv, Getenv, msanRead, msanWrite, itoa, uitoa, clen, ReadDirent, ParseDirent, errnoErr, Read, Write, Close, Exit, Fchdir, Fchmod, Fsync, Getdents, read, write, munmap, Fchown, Fstat, Ftruncate, Lstat, Pread, Pwrite, Seek, mmap; - js = $packages["github.com/gopherjs/gopherjs/js"]; - race = $packages["internal/race"]; - runtime = $packages["runtime"]; - sync = $packages["sync"]; - mmapper = $pkg.mmapper = $newType(0, $kindStruct, "syscall.mmapper", "mmapper", "syscall", function(Mutex_, active_, mmap_, munmap_) { - this.$val = this; - if (arguments.length === 0) { - this.Mutex = new sync.Mutex.ptr(0, 0); - this.active = false; - this.mmap = $throwNilPointerError; - this.munmap = $throwNilPointerError; - return; - } - this.Mutex = Mutex_; - this.active = active_; - this.mmap = mmap_; - this.munmap = munmap_; - }); - Errno = $pkg.Errno = $newType(4, $kindUintptr, "syscall.Errno", "Errno", "syscall", null); - Timespec = $pkg.Timespec = $newType(0, $kindStruct, "syscall.Timespec", "Timespec", "syscall", function(Sec_, Nsec_) { - this.$val = this; - if (arguments.length === 0) { - this.Sec = new $Int64(0, 0); - this.Nsec = new $Int64(0, 0); - return; - } - this.Sec = Sec_; - this.Nsec = Nsec_; - }); - Stat_t = $pkg.Stat_t = $newType(0, $kindStruct, "syscall.Stat_t", "Stat_t", "syscall", function(Dev_, Ino_, Nlink_, Mode_, Uid_, Gid_, X__pad0_, Rdev_, Size_, Blksize_, Blocks_, Atim_, Mtim_, Ctim_, X__unused_) { - this.$val = this; - if (arguments.length === 0) { - this.Dev = new $Uint64(0, 0); - this.Ino = new $Uint64(0, 0); - this.Nlink = new $Uint64(0, 0); - this.Mode = 0; - this.Uid = 0; - this.Gid = 0; - this.X__pad0 = 0; - this.Rdev = new $Uint64(0, 0); - this.Size = new $Int64(0, 0); - this.Blksize = new $Int64(0, 0); - this.Blocks = new $Int64(0, 0); - this.Atim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); - this.Mtim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); - this.Ctim = new Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)); - this.X__unused = arrayType$18.zero(); - return; - } - this.Dev = Dev_; - this.Ino = Ino_; - this.Nlink = Nlink_; - this.Mode = Mode_; - this.Uid = Uid_; - this.Gid = Gid_; - this.X__pad0 = X__pad0_; - this.Rdev = Rdev_; - this.Size = Size_; - this.Blksize = Blksize_; - this.Blocks = Blocks_; - this.Atim = Atim_; - this.Mtim = Mtim_; - this.Ctim = Ctim_; - this.X__unused = X__unused_; - }); - Dirent = $pkg.Dirent = $newType(0, $kindStruct, "syscall.Dirent", "Dirent", "syscall", function(Ino_, Off_, Reclen_, Type_, Name_, Pad_cgo_0_) { - this.$val = this; - if (arguments.length === 0) { - this.Ino = new $Uint64(0, 0); - this.Off = new $Int64(0, 0); - this.Reclen = 0; - this.Type = 0; - this.Name = arrayType$13.zero(); - this.Pad_cgo_0 = arrayType$14.zero(); - return; - } - this.Ino = Ino_; - this.Off = Off_; - this.Reclen = Reclen_; - this.Type = Type_; - this.Name = Name_; - this.Pad_cgo_0 = Pad_cgo_0_; - }); - sliceType = $sliceType($Uint8); - sliceType$1 = $sliceType($String); - ptrType$2 = $ptrType($Uint8); - arrayType$5 = $arrayType($Uint8, 32); - arrayType$13 = $arrayType($Int8, 256); - arrayType$14 = $arrayType($Uint8, 5); - structType = $structType([{prop: "addr", name: "addr", pkg: "syscall", typ: $Uintptr, tag: ""}, {prop: "len", name: "len", pkg: "syscall", typ: $Int, tag: ""}, {prop: "cap", name: "cap", pkg: "syscall", typ: $Int, tag: ""}]); - ptrType$22 = $ptrType($Int64); - ptrType$25 = $ptrType(mmapper); - mapType = $mapType(ptrType$2, sliceType); - funcType = $funcType([$Uintptr, $Uintptr, $Int, $Int, $Int, $Int64], [$Uintptr, $error], false); - funcType$1 = $funcType([$Uintptr, $Uintptr], [$error], false); - ptrType$29 = $ptrType(Timespec); - arrayType$18 = $arrayType($Int64, 3); - init = function() { - var $ptr; - $flushConsole = (function() { - var $ptr; - if (!((lineBuffer.$length === 0))) { - $global.console.log($externalize($bytesToString(lineBuffer), $String)); - lineBuffer = sliceType.nil; - } - }); - }; - printWarning = function() { - var $ptr; - if (!warningPrinted) { - $global.console.error($externalize("warning: system calls not available, see https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md", $String)); - } - warningPrinted = true; - }; - printToConsole = function(b) { - var $ptr, b, goPrintToConsole, i; - goPrintToConsole = $global.goPrintToConsole; - if (!(goPrintToConsole === undefined)) { - goPrintToConsole(b); - return; - } - lineBuffer = $appendSlice(lineBuffer, b); - while (true) { - i = indexByte(lineBuffer, 10); - if (i === -1) { - break; - } - $global.console.log($externalize($bytesToString($subslice(lineBuffer, 0, i)), $String)); - lineBuffer = $subslice(lineBuffer, (i + 1 >> 0)); - } - }; - use = function(p) { - var $ptr, p; - }; - indexByte = function(s, c) { - var $ptr, _i, _ref, b, c, i, s; - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - b = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (b === c) { - return i; - } - _i++; - } - return -1; - }; - runtime_envs = function() { - var $ptr, envkeys, envs$1, i, jsEnv, key, process; - process = $global.process; - if (process === undefined) { - return sliceType$1.nil; - } - jsEnv = process.env; - envkeys = $global.Object.keys(jsEnv); - envs$1 = $makeSlice(sliceType$1, $parseInt(envkeys.length)); - i = 0; - while (true) { - if (!(i < $parseInt(envkeys.length))) { break; } - key = $internalize(envkeys[i], $String); - ((i < 0 || i >= envs$1.$length) ? $throwRuntimeError("index out of range") : envs$1.$array[envs$1.$offset + i] = key + "=" + $internalize(jsEnv[$externalize(key, $String)], $String)); - i = i + (1) >> 0; - } - return envs$1; - }; - syscall = function(name) { - var $ptr, name, require, $deferred; - /* */ var $err = null; try { $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - $deferred.push([(function() { - var $ptr; - $recover(); - }), []]); - if (syscallModule === null) { - if (alreadyTriedToLoad) { - return null; - } - alreadyTriedToLoad = true; - require = $global.require; - if (require === undefined) { - $panic(new $String("")); - } - syscallModule = require($externalize("syscall", $String)); - } - return syscallModule[$externalize(name, $String)]; - /* */ } catch(err) { $err = err; return null; } finally { $callDeferred($deferred, $err); } - }; - Syscall = function(trap, a1, a2, a3) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, a1, a2, a3, array, err, f, r, r1, r2, slice, trap; - r1 = 0; - r2 = 0; - err = 0; - f = syscall("Syscall"); - if (!(f === null)) { - r = f(trap, a1, a2, a3); - _tmp = (($parseInt(r[0]) >> 0) >>> 0); - _tmp$1 = (($parseInt(r[1]) >> 0) >>> 0); - _tmp$2 = (($parseInt(r[2]) >> 0) >>> 0); - r1 = _tmp; - r2 = _tmp$1; - err = _tmp$2; - return [r1, r2, err]; - } - if ((trap === 1) && ((a1 === 1) || (a1 === 2))) { - array = a2; - slice = $makeSlice(sliceType, $parseInt(array.length)); - slice.$array = array; - printToConsole(slice); - _tmp$3 = ($parseInt(array.length) >>> 0); - _tmp$4 = 0; - _tmp$5 = 0; - r1 = _tmp$3; - r2 = _tmp$4; - err = _tmp$5; - return [r1, r2, err]; - } - if (trap === 60) { - runtime.Goexit(); - } - printWarning(); - _tmp$6 = (minusOne >>> 0); - _tmp$7 = 0; - _tmp$8 = 13; - r1 = _tmp$6; - r2 = _tmp$7; - err = _tmp$8; - return [r1, r2, err]; - }; - $pkg.Syscall = Syscall; - Syscall6 = function(trap, a1, a2, a3, a4, a5, a6) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, a1, a2, a3, a4, a5, a6, err, f, r, r1, r2, trap; - r1 = 0; - r2 = 0; - err = 0; - f = syscall("Syscall6"); - if (!(f === null)) { - r = f(trap, a1, a2, a3, a4, a5, a6); - _tmp = (($parseInt(r[0]) >> 0) >>> 0); - _tmp$1 = (($parseInt(r[1]) >> 0) >>> 0); - _tmp$2 = (($parseInt(r[2]) >> 0) >>> 0); - r1 = _tmp; - r2 = _tmp$1; - err = _tmp$2; - return [r1, r2, err]; - } - if (!((trap === 202))) { - printWarning(); - } - _tmp$3 = (minusOne >>> 0); - _tmp$4 = 0; - _tmp$5 = 13; - r1 = _tmp$3; - r2 = _tmp$4; - err = _tmp$5; - return [r1, r2, err]; - }; - $pkg.Syscall6 = Syscall6; - BytePtrFromString = function(s) { - var $ptr, _i, _ref, array, b, i, s; - array = new ($global.Uint8Array)(s.length + 1 >> 0); - _ref = new sliceType($stringToBytes(s)); - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - b = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (b === 0) { - return [ptrType$2.nil, new Errno(22)]; - } - array[i] = b; - _i++; - } - array[s.length] = 0; - return [array, $ifaceNil]; - }; - $pkg.BytePtrFromString = BytePtrFromString; - copyenv = function() { - var $ptr, _entry, _i, _key, _ref, _tuple, i, j, key, ok, s; - env = {}; - _ref = envs; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - s = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - j = 0; - while (true) { - if (!(j < s.length)) { break; } - if (s.charCodeAt(j) === 61) { - key = s.substring(0, j); - _tuple = (_entry = env[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [0, false]); - ok = _tuple[1]; - if (!ok) { - _key = key; (env || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: i }; - } else { - ((i < 0 || i >= envs.$length) ? $throwRuntimeError("index out of range") : envs.$array[envs.$offset + i] = ""); - } - break; - } - j = j + (1) >> 0; - } - _i++; - } - }; - Getenv = function(key) { - var $ptr, _entry, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, found, i, i$1, key, ok, s, value, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tuple = $f._tuple; found = $f.found; i = $f.i; i$1 = $f.i$1; key = $f.key; ok = $f.ok; s = $f.s; value = $f.value; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - value = ""; - found = false; - $r = envOnce.Do(copyenv); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - if (key.length === 0) { - _tmp = ""; - _tmp$1 = false; - value = _tmp; - found = _tmp$1; - return [value, found]; - } - $r = envLock.RLock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $deferred.push([$methodVal(envLock, "RUnlock"), []]); - _tuple = (_entry = env[$String.keyFor(key)], _entry !== undefined ? [_entry.v, true] : [0, false]); - i = _tuple[0]; - ok = _tuple[1]; - if (!ok) { - _tmp$2 = ""; - _tmp$3 = false; - value = _tmp$2; - found = _tmp$3; - return [value, found]; - } - s = ((i < 0 || i >= envs.$length) ? $throwRuntimeError("index out of range") : envs.$array[envs.$offset + i]); - i$1 = 0; - while (true) { - if (!(i$1 < s.length)) { break; } - if (s.charCodeAt(i$1) === 61) { - _tmp$4 = s.substring((i$1 + 1 >> 0)); - _tmp$5 = true; - value = _tmp$4; - found = _tmp$5; - return [value, found]; - } - i$1 = i$1 + (1) >> 0; - } - _tmp$6 = ""; - _tmp$7 = false; - value = _tmp$6; - found = _tmp$7; - return [value, found]; - /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [value, found]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Getenv }; } $f.$ptr = $ptr; $f._entry = _entry; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tuple = _tuple; $f.found = found; $f.i = i; $f.i$1 = i$1; $f.key = key; $f.ok = ok; $f.s = s; $f.value = value; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - $pkg.Getenv = Getenv; - msanRead = function(addr, len) { - var $ptr, addr, len; - }; - msanWrite = function(addr, len) { - var $ptr, addr, len; - }; - itoa = function(val) { - var $ptr, val; - if (val < 0) { - return "-" + uitoa((-val >>> 0)); - } - return uitoa((val >>> 0)); - }; - uitoa = function(val) { - var $ptr, _q, _r, buf, i, val; - buf = arrayType$5.zero(); - i = 31; - while (true) { - if (!(val >= 10)) { break; } - ((i < 0 || i >= buf.length) ? $throwRuntimeError("index out of range") : buf[i] = (((_r = val % 10, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) + 48 >>> 0) << 24 >>> 24)); - i = i - (1) >> 0; - val = (_q = val / (10), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - } - ((i < 0 || i >= buf.length) ? $throwRuntimeError("index out of range") : buf[i] = ((val + 48 >>> 0) << 24 >>> 24)); - return $bytesToString($subslice(new sliceType(buf), i)); - }; - Timespec.ptr.prototype.Unix = function() { - var $ptr, _tmp, _tmp$1, nsec, sec, ts; - sec = new $Int64(0, 0); - nsec = new $Int64(0, 0); - ts = this; - _tmp = ts.Sec; - _tmp$1 = ts.Nsec; - sec = _tmp; - nsec = _tmp$1; - return [sec, nsec]; - }; - Timespec.prototype.Unix = function() { return this.$val.Unix(); }; - Timespec.ptr.prototype.Nano = function() { - var $ptr, ts, x, x$1; - ts = this; - return (x = $mul64(ts.Sec, new $Int64(0, 1000000000)), x$1 = ts.Nsec, new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); - }; - Timespec.prototype.Nano = function() { return this.$val.Nano(); }; - clen = function(n) { - var $ptr, i, n; - i = 0; - while (true) { - if (!(i < n.$length)) { break; } - if (((i < 0 || i >= n.$length) ? $throwRuntimeError("index out of range") : n.$array[n.$offset + i]) === 0) { - return i; - } - i = i + (1) >> 0; - } - return n.$length; - }; - ReadDirent = function(fd, buf) { - var $ptr, _tuple, buf, err, fd, n; - n = 0; - err = $ifaceNil; - _tuple = Getdents(fd, buf); - n = _tuple[0]; - err = _tuple[1]; - return [n, err]; - }; - $pkg.ReadDirent = ReadDirent; - ParseDirent = function(buf, max, names) { - var $ptr, _array, _struct, _tmp, _tmp$1, _tmp$2, _view, buf, bytes, consumed, count, dirent, max, name, names, newnames, origlen, x; - consumed = 0; - count = 0; - newnames = sliceType$1.nil; - origlen = buf.$length; - count = 0; - while (true) { - if (!(!((max === 0)) && buf.$length > 0)) { break; } - dirent = (_array = $sliceToArray(buf), _struct = new Dirent.ptr(new $Uint64(0, 0), new $Int64(0, 0), 0, 0, arrayType$13.zero(), arrayType$14.zero()), _view = new DataView(_array.buffer, _array.byteOffset), _struct.Ino = new $Uint64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Off = new $Int64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Reclen = _view.getUint16(16, true), _struct.Type = _view.getUint8(18, true), _struct.Name = new ($nativeArray($kindInt8))(_array.buffer, $min(_array.byteOffset + 19, _array.buffer.byteLength)), _struct.Pad_cgo_0 = new ($nativeArray($kindUint8))(_array.buffer, $min(_array.byteOffset + 275, _array.buffer.byteLength)), _struct); - buf = $subslice(buf, dirent.Reclen); - if ((x = dirent.Ino, (x.$high === 0 && x.$low === 0))) { - continue; - } - bytes = $sliceToArray(new sliceType(dirent.Name)); - name = $bytesToString($subslice(new sliceType(bytes), 0, clen(new sliceType(bytes)))); - if (name === "." || name === "..") { - continue; - } - max = max - (1) >> 0; - count = count + (1) >> 0; - names = $append(names, name); - } - _tmp = origlen - buf.$length >> 0; - _tmp$1 = count; - _tmp$2 = names; - consumed = _tmp; - count = _tmp$1; - newnames = _tmp$2; - return [consumed, count, newnames]; - }; - $pkg.ParseDirent = ParseDirent; - mmapper.ptr.prototype.Mmap = function(fd, offset, length, prot, flags) { - var $ptr, _key, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, addr, b, data, err, errno, fd, flags, length, m, offset, p, prot, sl, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _key = $f._key; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; addr = $f.addr; b = $f.b; data = $f.data; err = $f.err; errno = $f.errno; fd = $f.fd; flags = $f.flags; length = $f.length; m = $f.m; offset = $f.offset; p = $f.p; prot = $f.prot; sl = $f.sl; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - sl = [sl]; - data = sliceType.nil; - err = $ifaceNil; - m = this; - if (length <= 0) { - _tmp = sliceType.nil; - _tmp$1 = new Errno(22); - data = _tmp; - err = _tmp$1; - return [data, err]; - } - _r = m.mmap(0, (length >>> 0), prot, flags, fd, offset); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - addr = _tuple[0]; - errno = _tuple[1]; - if (!($interfaceIsEqual(errno, $ifaceNil))) { - _tmp$2 = sliceType.nil; - _tmp$3 = errno; - data = _tmp$2; - err = _tmp$3; - return [data, err]; - } - sl[0] = new structType.ptr(addr, length, length); - b = sl[0]; - p = $indexPtr(b.$array, b.$offset + (b.$capacity - 1 >> 0), ptrType$2); - $r = m.Mutex.Lock(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $deferred.push([$methodVal(m.Mutex, "Unlock"), []]); - _key = p; (m.active || $throwRuntimeError("assignment to entry in nil map"))[ptrType$2.keyFor(_key)] = { k: _key, v: b }; - _tmp$4 = b; - _tmp$5 = $ifaceNil; - data = _tmp$4; - err = _tmp$5; - return [data, err]; - /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [data, err]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: mmapper.ptr.prototype.Mmap }; } $f.$ptr = $ptr; $f._key = _key; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f.addr = addr; $f.b = b; $f.data = data; $f.err = err; $f.errno = errno; $f.fd = fd; $f.flags = flags; $f.length = length; $f.m = m; $f.offset = offset; $f.p = p; $f.prot = prot; $f.sl = sl; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - mmapper.prototype.Mmap = function(fd, offset, length, prot, flags) { return this.$val.Mmap(fd, offset, length, prot, flags); }; - mmapper.ptr.prototype.Munmap = function(data) { - var $ptr, _entry, _r, b, data, err, errno, m, p, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _r = $f._r; b = $f.b; data = $f.data; err = $f.err; errno = $f.errno; m = $f.m; p = $f.p; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - err = $ifaceNil; - m = this; - if ((data.$length === 0) || !((data.$length === data.$capacity))) { - err = new Errno(22); - return err; - } - p = $indexPtr(data.$array, data.$offset + (data.$capacity - 1 >> 0), ptrType$2); - $r = m.Mutex.Lock(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $deferred.push([$methodVal(m.Mutex, "Unlock"), []]); - b = (_entry = m.active[ptrType$2.keyFor(p)], _entry !== undefined ? _entry.v : sliceType.nil); - if (b === sliceType.nil || !($indexPtr(b.$array, b.$offset + 0, ptrType$2) === $indexPtr(data.$array, data.$offset + 0, ptrType$2))) { - err = new Errno(22); - return err; - } - _r = m.munmap($sliceToArray(b), (b.$length >>> 0)); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - errno = _r; - if (!($interfaceIsEqual(errno, $ifaceNil))) { - err = errno; - return err; - } - delete m.active[ptrType$2.keyFor(p)]; - err = $ifaceNil; - return err; - /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return err; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: mmapper.ptr.prototype.Munmap }; } $f.$ptr = $ptr; $f._entry = _entry; $f._r = _r; $f.b = b; $f.data = data; $f.err = err; $f.errno = errno; $f.m = m; $f.p = p; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - mmapper.prototype.Munmap = function(data) { return this.$val.Munmap(data); }; - Errno.prototype.Error = function() { - var $ptr, e, s; - e = this.$val; - if (0 <= (e >> 0) && (e >> 0) < 133) { - s = ((e < 0 || e >= errors.length) ? $throwRuntimeError("index out of range") : errors[e]); - if (!(s === "")) { - return s; - } - } - return "errno " + itoa((e >> 0)); - }; - $ptrType(Errno).prototype.Error = function() { return new Errno(this.$get()).Error(); }; - Errno.prototype.Temporary = function() { - var $ptr, e; - e = this.$val; - return (e === 4) || (e === 24) || (e === 104) || (e === 103) || new Errno(e).Timeout(); - }; - $ptrType(Errno).prototype.Temporary = function() { return new Errno(this.$get()).Temporary(); }; - Errno.prototype.Timeout = function() { - var $ptr, e; - e = this.$val; - return (e === 11) || (e === 11) || (e === 110); - }; - $ptrType(Errno).prototype.Timeout = function() { return new Errno(this.$get()).Timeout(); }; - errnoErr = function(e) { - var $ptr, _1, e; - _1 = e; - if (_1 === (0)) { - return $ifaceNil; - } else if (_1 === (11)) { - return errEAGAIN; - } else if (_1 === (22)) { - return errEINVAL; - } else if (_1 === (2)) { - return errENOENT; - } - return new Errno(e); - }; - Read = function(fd, p) { - var $ptr, _tuple, err, fd, n, p; - n = 0; - err = $ifaceNil; - _tuple = read(fd, p); - n = _tuple[0]; - err = _tuple[1]; - if (false) { - if (n > 0) { - race.WriteRange($sliceToArray(p), n); - } - if ($interfaceIsEqual(err, $ifaceNil)) { - race.Acquire((ioSync$24ptr || (ioSync$24ptr = new ptrType$22(function() { return ioSync; }, function($v) { ioSync = $v; })))); - } - } - if (false && n > 0) { - msanWrite($sliceToArray(p), n); - } - return [n, err]; - }; - $pkg.Read = Read; - Write = function(fd, p) { - var $ptr, _tuple, err, fd, n, p; - n = 0; - err = $ifaceNil; - if (false) { - race.ReleaseMerge((ioSync$24ptr || (ioSync$24ptr = new ptrType$22(function() { return ioSync; }, function($v) { ioSync = $v; })))); - } - _tuple = write(fd, p); - n = _tuple[0]; - err = _tuple[1]; - if (false && n > 0) { - race.ReadRange($sliceToArray(p), n); - } - if (false && n > 0) { - msanRead($sliceToArray(p), n); - } - return [n, err]; - }; - $pkg.Write = Write; - Close = function(fd) { - var $ptr, _tuple, e1, err, fd; - err = $ifaceNil; - _tuple = Syscall(3, (fd >>> 0), 0, 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Close = Close; - Exit = function(code) { - var $ptr, code; - Syscall(231, (code >>> 0), 0, 0); - return; - }; - $pkg.Exit = Exit; - Fchdir = function(fd) { - var $ptr, _tuple, e1, err, fd; - err = $ifaceNil; - _tuple = Syscall(81, (fd >>> 0), 0, 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Fchdir = Fchdir; - Fchmod = function(fd, mode) { - var $ptr, _tuple, e1, err, fd, mode; - err = $ifaceNil; - _tuple = Syscall(91, (fd >>> 0), (mode >>> 0), 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Fchmod = Fchmod; - Fsync = function(fd) { - var $ptr, _tuple, e1, err, fd; - err = $ifaceNil; - _tuple = Syscall(74, (fd >>> 0), 0, 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Fsync = Fsync; - Getdents = function(fd, buf) { - var $ptr, _p0, _tuple, buf, e1, err, fd, n, r0; - n = 0; - err = $ifaceNil; - _p0 = 0; - if (buf.$length > 0) { - _p0 = $sliceToArray(buf); - } else { - _p0 = new Uint8Array(0); - } - _tuple = Syscall(217, (fd >>> 0), _p0, (buf.$length >>> 0)); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = (r0 >> 0); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; - }; - $pkg.Getdents = Getdents; - read = function(fd, p) { - var $ptr, _p0, _tuple, e1, err, fd, n, p, r0; - n = 0; - err = $ifaceNil; - _p0 = 0; - if (p.$length > 0) { - _p0 = $sliceToArray(p); - } else { - _p0 = new Uint8Array(0); - } - _tuple = Syscall(0, (fd >>> 0), _p0, (p.$length >>> 0)); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = (r0 >> 0); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; - }; - write = function(fd, p) { - var $ptr, _p0, _tuple, e1, err, fd, n, p, r0; - n = 0; - err = $ifaceNil; - _p0 = 0; - if (p.$length > 0) { - _p0 = $sliceToArray(p); - } else { - _p0 = new Uint8Array(0); - } - _tuple = Syscall(1, (fd >>> 0), _p0, (p.$length >>> 0)); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = (r0 >> 0); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; - }; - munmap = function(addr, length) { - var $ptr, _tuple, addr, e1, err, length; - err = $ifaceNil; - _tuple = Syscall(11, addr, length, 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - Fchown = function(fd, uid, gid) { - var $ptr, _tuple, e1, err, fd, gid, uid; - err = $ifaceNil; - _tuple = Syscall(93, (fd >>> 0), (uid >>> 0), (gid >>> 0)); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Fchown = Fchown; - Fstat = function(fd, stat) { - var $ptr, _array, _struct, _tuple, _view, e1, err, fd, stat; - err = $ifaceNil; - _array = new Uint8Array(144); - _tuple = Syscall(5, (fd >>> 0), _array, 0); - _struct = stat, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Dev = new $Uint64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Ino = new $Uint64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Nlink = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Mode = _view.getUint32(24, true), _struct.Uid = _view.getUint32(28, true), _struct.Gid = _view.getUint32(32, true), _struct.X__pad0 = _view.getInt32(36, true), _struct.Rdev = new $Uint64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Size = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Blksize = new $Int64(_view.getUint32(60, true), _view.getUint32(56, true)), _struct.Blocks = new $Int64(_view.getUint32(68, true), _view.getUint32(64, true)), _struct.Atim.Sec = new $Int64(_view.getUint32(76, true), _view.getUint32(72, true)), _struct.Atim.Nsec = new $Int64(_view.getUint32(84, true), _view.getUint32(80, true)), _struct.Mtim.Sec = new $Int64(_view.getUint32(92, true), _view.getUint32(88, true)), _struct.Mtim.Nsec = new $Int64(_view.getUint32(100, true), _view.getUint32(96, true)), _struct.Ctim.Sec = new $Int64(_view.getUint32(108, true), _view.getUint32(104, true)), _struct.Ctim.Nsec = new $Int64(_view.getUint32(116, true), _view.getUint32(112, true)), _struct.X__unused = new ($nativeArray($kindInt64))(_array.buffer, $min(_array.byteOffset + 120, _array.buffer.byteLength)); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Fstat = Fstat; - Ftruncate = function(fd, length) { - var $ptr, _tuple, e1, err, fd, length; - err = $ifaceNil; - _tuple = Syscall(77, (fd >>> 0), (length.$low >>> 0), 0); - e1 = _tuple[2]; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Ftruncate = Ftruncate; - Lstat = function(path, stat) { - var $ptr, _array, _p0, _struct, _tuple, _tuple$1, _view, e1, err, path, stat; - err = $ifaceNil; - _p0 = ptrType$2.nil; - _tuple = BytePtrFromString(path); - _p0 = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return err; - } - _array = new Uint8Array(144); - _tuple$1 = Syscall(6, _p0, _array, 0); - _struct = stat, _view = new DataView(_array.buffer, _array.byteOffset), _struct.Dev = new $Uint64(_view.getUint32(4, true), _view.getUint32(0, true)), _struct.Ino = new $Uint64(_view.getUint32(12, true), _view.getUint32(8, true)), _struct.Nlink = new $Uint64(_view.getUint32(20, true), _view.getUint32(16, true)), _struct.Mode = _view.getUint32(24, true), _struct.Uid = _view.getUint32(28, true), _struct.Gid = _view.getUint32(32, true), _struct.X__pad0 = _view.getInt32(36, true), _struct.Rdev = new $Uint64(_view.getUint32(44, true), _view.getUint32(40, true)), _struct.Size = new $Int64(_view.getUint32(52, true), _view.getUint32(48, true)), _struct.Blksize = new $Int64(_view.getUint32(60, true), _view.getUint32(56, true)), _struct.Blocks = new $Int64(_view.getUint32(68, true), _view.getUint32(64, true)), _struct.Atim.Sec = new $Int64(_view.getUint32(76, true), _view.getUint32(72, true)), _struct.Atim.Nsec = new $Int64(_view.getUint32(84, true), _view.getUint32(80, true)), _struct.Mtim.Sec = new $Int64(_view.getUint32(92, true), _view.getUint32(88, true)), _struct.Mtim.Nsec = new $Int64(_view.getUint32(100, true), _view.getUint32(96, true)), _struct.Ctim.Sec = new $Int64(_view.getUint32(108, true), _view.getUint32(104, true)), _struct.Ctim.Nsec = new $Int64(_view.getUint32(116, true), _view.getUint32(112, true)), _struct.X__unused = new ($nativeArray($kindInt64))(_array.buffer, $min(_array.byteOffset + 120, _array.buffer.byteLength)); - e1 = _tuple$1[2]; - use(_p0); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return err; - }; - $pkg.Lstat = Lstat; - Pread = function(fd, p, offset) { - var $ptr, _p0, _tuple, e1, err, fd, n, offset, p, r0; - n = 0; - err = $ifaceNil; - _p0 = 0; - if (p.$length > 0) { - _p0 = $sliceToArray(p); - } else { - _p0 = new Uint8Array(0); - } - _tuple = Syscall6(17, (fd >>> 0), _p0, (p.$length >>> 0), (offset.$low >>> 0), 0, 0); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = (r0 >> 0); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; - }; - $pkg.Pread = Pread; - Pwrite = function(fd, p, offset) { - var $ptr, _p0, _tuple, e1, err, fd, n, offset, p, r0; - n = 0; - err = $ifaceNil; - _p0 = 0; - if (p.$length > 0) { - _p0 = $sliceToArray(p); - } else { - _p0 = new Uint8Array(0); - } - _tuple = Syscall6(18, (fd >>> 0), _p0, (p.$length >>> 0), (offset.$low >>> 0), 0, 0); - r0 = _tuple[0]; - e1 = _tuple[2]; - n = (r0 >> 0); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [n, err]; - }; - $pkg.Pwrite = Pwrite; - Seek = function(fd, offset, whence) { - var $ptr, _tuple, e1, err, fd, off, offset, r0, whence; - off = new $Int64(0, 0); - err = $ifaceNil; - _tuple = Syscall(8, (fd >>> 0), (offset.$low >>> 0), (whence >>> 0)); - r0 = _tuple[0]; - e1 = _tuple[2]; - off = new $Int64(0, r0.constructor === Number ? r0 : 1); - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [off, err]; - }; - $pkg.Seek = Seek; - mmap = function(addr, length, prot, flags, fd, offset) { - var $ptr, _tuple, addr, e1, err, fd, flags, length, offset, prot, r0, xaddr; - xaddr = 0; - err = $ifaceNil; - _tuple = Syscall6(9, addr, length, (prot >>> 0), (flags >>> 0), (fd >>> 0), (offset.$low >>> 0)); - r0 = _tuple[0]; - e1 = _tuple[2]; - xaddr = r0; - if (!((e1 === 0))) { - err = errnoErr(e1); - } - return [xaddr, err]; - }; - ptrType$25.methods = [{prop: "Mmap", name: "Mmap", pkg: "", typ: $funcType([$Int, $Int64, $Int, $Int, $Int], [sliceType, $error], false)}, {prop: "Munmap", name: "Munmap", pkg: "", typ: $funcType([sliceType], [$error], false)}]; - Errno.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Temporary", name: "Temporary", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Timeout", name: "Timeout", pkg: "", typ: $funcType([], [$Bool], false)}]; - ptrType$29.methods = [{prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64, $Int64], false)}, {prop: "Nano", name: "Nano", pkg: "", typ: $funcType([], [$Int64], false)}]; - mmapper.init([{prop: "Mutex", name: "", pkg: "", typ: sync.Mutex, tag: ""}, {prop: "active", name: "active", pkg: "syscall", typ: mapType, tag: ""}, {prop: "mmap", name: "mmap", pkg: "syscall", typ: funcType, tag: ""}, {prop: "munmap", name: "munmap", pkg: "syscall", typ: funcType$1, tag: ""}]); - Timespec.init([{prop: "Sec", name: "Sec", pkg: "", typ: $Int64, tag: ""}, {prop: "Nsec", name: "Nsec", pkg: "", typ: $Int64, tag: ""}]); - Stat_t.init([{prop: "Dev", name: "Dev", pkg: "", typ: $Uint64, tag: ""}, {prop: "Ino", name: "Ino", pkg: "", typ: $Uint64, tag: ""}, {prop: "Nlink", name: "Nlink", pkg: "", typ: $Uint64, tag: ""}, {prop: "Mode", name: "Mode", pkg: "", typ: $Uint32, tag: ""}, {prop: "Uid", name: "Uid", pkg: "", typ: $Uint32, tag: ""}, {prop: "Gid", name: "Gid", pkg: "", typ: $Uint32, tag: ""}, {prop: "X__pad0", name: "X__pad0", pkg: "", typ: $Int32, tag: ""}, {prop: "Rdev", name: "Rdev", pkg: "", typ: $Uint64, tag: ""}, {prop: "Size", name: "Size", pkg: "", typ: $Int64, tag: ""}, {prop: "Blksize", name: "Blksize", pkg: "", typ: $Int64, tag: ""}, {prop: "Blocks", name: "Blocks", pkg: "", typ: $Int64, tag: ""}, {prop: "Atim", name: "Atim", pkg: "", typ: Timespec, tag: ""}, {prop: "Mtim", name: "Mtim", pkg: "", typ: Timespec, tag: ""}, {prop: "Ctim", name: "Ctim", pkg: "", typ: Timespec, tag: ""}, {prop: "X__unused", name: "X__unused", pkg: "", typ: arrayType$18, tag: ""}]); - Dirent.init([{prop: "Ino", name: "Ino", pkg: "", typ: $Uint64, tag: ""}, {prop: "Off", name: "Off", pkg: "", typ: $Int64, tag: ""}, {prop: "Reclen", name: "Reclen", pkg: "", typ: $Uint16, tag: ""}, {prop: "Type", name: "Type", pkg: "", typ: $Uint8, tag: ""}, {prop: "Name", name: "Name", pkg: "", typ: arrayType$13, tag: ""}, {prop: "Pad_cgo_0", name: "Pad_cgo_0", pkg: "", typ: arrayType$14, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = race.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - lineBuffer = sliceType.nil; - syscallModule = null; - envOnce = new sync.Once.ptr(new sync.Mutex.ptr(0, 0), 0); - envLock = new sync.RWMutex.ptr(new sync.Mutex.ptr(0, 0), 0, 0, 0, 0); - env = false; - ioSync = new $Int64(0, 0); - warningPrinted = false; - alreadyTriedToLoad = false; - minusOne = -1; - envs = runtime_envs(); - $pkg.Stdin = 0; - $pkg.Stdout = 1; - $pkg.Stderr = 2; - errEAGAIN = new Errno(11); - errEINVAL = new Errno(22); - errENOENT = new Errno(2); - errors = $toNativeArray($kindString, ["", "operation not permitted", "no such file or directory", "no such process", "interrupted system call", "input/output error", "no such device or address", "argument list too long", "exec format error", "bad file descriptor", "no child processes", "resource temporarily unavailable", "cannot allocate memory", "permission denied", "bad address", "block device required", "device or resource busy", "file exists", "invalid cross-device link", "no such device", "not a directory", "is a directory", "invalid argument", "too many open files in system", "too many open files", "inappropriate ioctl for device", "text file busy", "file too large", "no space left on device", "illegal seek", "read-only file system", "too many links", "broken pipe", "numerical argument out of domain", "numerical result out of range", "resource deadlock avoided", "file name too long", "no locks available", "function not implemented", "directory not empty", "too many levels of symbolic links", "", "no message of desired type", "identifier removed", "channel number out of range", "level 2 not synchronized", "level 3 halted", "level 3 reset", "link number out of range", "protocol driver not attached", "no CSI structure available", "level 2 halted", "invalid exchange", "invalid request descriptor", "exchange full", "no anode", "invalid request code", "invalid slot", "", "bad font file format", "device not a stream", "no data available", "timer expired", "out of streams resources", "machine is not on the network", "package not installed", "object is remote", "link has been severed", "advertise error", "srmount error", "communication error on send", "protocol error", "multihop attempted", "RFS specific error", "bad message", "value too large for defined data type", "name not unique on network", "file descriptor in bad state", "remote address changed", "can not access a needed shared library", "accessing a corrupted shared library", ".lib section in a.out corrupted", "attempting to link in too many shared libraries", "cannot exec a shared library directly", "invalid or incomplete multibyte or wide character", "interrupted system call should be restarted", "streams pipe error", "too many users", "socket operation on non-socket", "destination address required", "message too long", "protocol wrong type for socket", "protocol not available", "protocol not supported", "socket type not supported", "operation not supported", "protocol family not supported", "address family not supported by protocol", "address already in use", "cannot assign requested address", "network is down", "network is unreachable", "network dropped connection on reset", "software caused connection abort", "connection reset by peer", "no buffer space available", "transport endpoint is already connected", "transport endpoint is not connected", "cannot send after transport endpoint shutdown", "too many references: cannot splice", "connection timed out", "connection refused", "host is down", "no route to host", "operation already in progress", "operation now in progress", "stale NFS file handle", "structure needs cleaning", "not a XENIX named type file", "no XENIX semaphores available", "is a named type file", "remote I/O error", "disk quota exceeded", "no medium found", "wrong medium type", "operation canceled", "required key not available", "key has expired", "key has been revoked", "key was rejected by service", "owner died", "state not recoverable", "operation not possible due to RF-kill"]); - mapper = new mmapper.ptr(new sync.Mutex.ptr(0, 0), {}, mmap, munmap); - init(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["github.com/gopherjs/gopherjs/nosync"] = (function() { - var $pkg = {}, $init, Mutex, RWMutex, WaitGroup, Once, ptrType, ptrType$1, ptrType$2, funcType, ptrType$3; - Mutex = $pkg.Mutex = $newType(0, $kindStruct, "nosync.Mutex", "Mutex", "github.com/gopherjs/gopherjs/nosync", function(locked_) { - this.$val = this; - if (arguments.length === 0) { - this.locked = false; - return; - } - this.locked = locked_; - }); - RWMutex = $pkg.RWMutex = $newType(0, $kindStruct, "nosync.RWMutex", "RWMutex", "github.com/gopherjs/gopherjs/nosync", function(writeLocked_, readLockCounter_) { - this.$val = this; - if (arguments.length === 0) { - this.writeLocked = false; - this.readLockCounter = 0; - return; - } - this.writeLocked = writeLocked_; - this.readLockCounter = readLockCounter_; - }); - WaitGroup = $pkg.WaitGroup = $newType(0, $kindStruct, "nosync.WaitGroup", "WaitGroup", "github.com/gopherjs/gopherjs/nosync", function(counter_) { - this.$val = this; - if (arguments.length === 0) { - this.counter = 0; - return; - } - this.counter = counter_; - }); - Once = $pkg.Once = $newType(0, $kindStruct, "nosync.Once", "Once", "github.com/gopherjs/gopherjs/nosync", function(doing_, done_) { - this.$val = this; - if (arguments.length === 0) { - this.doing = false; - this.done = false; - return; - } - this.doing = doing_; - this.done = done_; - }); - ptrType = $ptrType(Mutex); - ptrType$1 = $ptrType(RWMutex); - ptrType$2 = $ptrType(WaitGroup); - funcType = $funcType([], [], false); - ptrType$3 = $ptrType(Once); - Mutex.ptr.prototype.Lock = function() { - var $ptr, m; - m = this; - if (m.locked) { - $panic(new $String("nosync: mutex is already locked")); - } - m.locked = true; - }; - Mutex.prototype.Lock = function() { return this.$val.Lock(); }; - Mutex.ptr.prototype.Unlock = function() { - var $ptr, m; - m = this; - if (!m.locked) { - $panic(new $String("nosync: unlock of unlocked mutex")); - } - m.locked = false; - }; - Mutex.prototype.Unlock = function() { return this.$val.Unlock(); }; - RWMutex.ptr.prototype.Lock = function() { - var $ptr, rw; - rw = this; - if (!((rw.readLockCounter === 0)) || rw.writeLocked) { - $panic(new $String("nosync: mutex is already locked")); - } - rw.writeLocked = true; - }; - RWMutex.prototype.Lock = function() { return this.$val.Lock(); }; - RWMutex.ptr.prototype.Unlock = function() { - var $ptr, rw; - rw = this; - if (!rw.writeLocked) { - $panic(new $String("nosync: unlock of unlocked mutex")); - } - rw.writeLocked = false; - }; - RWMutex.prototype.Unlock = function() { return this.$val.Unlock(); }; - RWMutex.ptr.prototype.RLock = function() { - var $ptr, rw; - rw = this; - if (rw.writeLocked) { - $panic(new $String("nosync: mutex is already locked")); - } - rw.readLockCounter = rw.readLockCounter + (1) >> 0; - }; - RWMutex.prototype.RLock = function() { return this.$val.RLock(); }; - RWMutex.ptr.prototype.RUnlock = function() { - var $ptr, rw; - rw = this; - if (rw.readLockCounter === 0) { - $panic(new $String("nosync: unlock of unlocked mutex")); - } - rw.readLockCounter = rw.readLockCounter - (1) >> 0; - }; - RWMutex.prototype.RUnlock = function() { return this.$val.RUnlock(); }; - WaitGroup.ptr.prototype.Add = function(delta) { - var $ptr, delta, wg; - wg = this; - wg.counter = wg.counter + (delta) >> 0; - if (wg.counter < 0) { - $panic(new $String("sync: negative WaitGroup counter")); - } - }; - WaitGroup.prototype.Add = function(delta) { return this.$val.Add(delta); }; - WaitGroup.ptr.prototype.Done = function() { - var $ptr, wg; - wg = this; - wg.Add(-1); - }; - WaitGroup.prototype.Done = function() { return this.$val.Done(); }; - WaitGroup.ptr.prototype.Wait = function() { - var $ptr, wg; - wg = this; - if (!((wg.counter === 0))) { - $panic(new $String("sync: WaitGroup counter not zero")); - } - }; - WaitGroup.prototype.Wait = function() { return this.$val.Wait(); }; - Once.ptr.prototype.Do = function(f) { - var $ptr, f, o, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; o = $f.o; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - o = [o]; - o[0] = this; - if (o[0].done) { - return; - } - if (o[0].doing) { - $panic(new $String("nosync: Do called within f")); - } - o[0].doing = true; - $deferred.push([(function(o) { return function() { - var $ptr; - o[0].doing = false; - o[0].done = true; - }; })(o), []]); - $r = f(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: Once.ptr.prototype.Do }; } $f.$ptr = $ptr; $f.f = f; $f.o = o; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - Once.prototype.Do = function(f) { return this.$val.Do(f); }; - ptrType.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}]; - ptrType$1.methods = [{prop: "Lock", name: "Lock", pkg: "", typ: $funcType([], [], false)}, {prop: "Unlock", name: "Unlock", pkg: "", typ: $funcType([], [], false)}, {prop: "RLock", name: "RLock", pkg: "", typ: $funcType([], [], false)}, {prop: "RUnlock", name: "RUnlock", pkg: "", typ: $funcType([], [], false)}]; - ptrType$2.methods = [{prop: "Add", name: "Add", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Done", name: "Done", pkg: "", typ: $funcType([], [], false)}, {prop: "Wait", name: "Wait", pkg: "", typ: $funcType([], [], false)}]; - ptrType$3.methods = [{prop: "Do", name: "Do", pkg: "", typ: $funcType([funcType], [], false)}]; - Mutex.init([{prop: "locked", name: "locked", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Bool, tag: ""}]); - RWMutex.init([{prop: "writeLocked", name: "writeLocked", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Bool, tag: ""}, {prop: "readLockCounter", name: "readLockCounter", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Int, tag: ""}]); - WaitGroup.init([{prop: "counter", name: "counter", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Int, tag: ""}]); - Once.init([{prop: "doing", name: "doing", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Bool, tag: ""}, {prop: "done", name: "done", pkg: "github.com/gopherjs/gopherjs/nosync", typ: $Bool, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["strings"] = (function() { - var $pkg = {}, $init, errors, js, io, unicode, utf8, Reader, sliceType, ptrType$5, IndexByte, Index, NewReader, ContainsRune, IndexRune; - errors = $packages["errors"]; - js = $packages["github.com/gopherjs/gopherjs/js"]; - io = $packages["io"]; - unicode = $packages["unicode"]; - utf8 = $packages["unicode/utf8"]; - Reader = $pkg.Reader = $newType(0, $kindStruct, "strings.Reader", "Reader", "strings", function(s_, i_, prevRune_) { - this.$val = this; - if (arguments.length === 0) { - this.s = ""; - this.i = new $Int64(0, 0); - this.prevRune = 0; - return; - } - this.s = s_; - this.i = i_; - this.prevRune = prevRune_; - }); - sliceType = $sliceType($Uint8); - ptrType$5 = $ptrType(Reader); - IndexByte = function(s, c) { - var $ptr, c, s; - return $parseInt(s.indexOf($global.String.fromCharCode(c))) >> 0; - }; - $pkg.IndexByte = IndexByte; - Index = function(s, sep) { - var $ptr, s, sep; - return $parseInt(s.indexOf(sep)) >> 0; - }; - $pkg.Index = Index; - Reader.ptr.prototype.Len = function() { - var $ptr, r, x, x$1, x$2, x$3, x$4; - r = this; - if ((x = r.i, x$1 = new $Int64(0, r.s.length), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { - return 0; - } - return ((x$2 = (x$3 = new $Int64(0, r.s.length), x$4 = r.i, new $Int64(x$3.$high - x$4.$high, x$3.$low - x$4.$low)), x$2.$low + ((x$2.$high >> 31) * 4294967296)) >> 0); - }; - Reader.prototype.Len = function() { return this.$val.Len(); }; - Reader.ptr.prototype.Size = function() { - var $ptr, r; - r = this; - return new $Int64(0, r.s.length); - }; - Reader.prototype.Size = function() { return this.$val.Size(); }; - Reader.ptr.prototype.Read = function(b) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, b, err, n, r, x, x$1, x$2, x$3; - n = 0; - err = $ifaceNil; - r = this; - if (b.$length === 0) { - _tmp = 0; - _tmp$1 = $ifaceNil; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - if ((x = r.i, x$1 = new $Int64(0, r.s.length), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { - _tmp$2 = 0; - _tmp$3 = io.EOF; - n = _tmp$2; - err = _tmp$3; - return [n, err]; - } - r.prevRune = -1; - n = $copyString(b, r.s.substring($flatten64(r.i))); - r.i = (x$2 = r.i, x$3 = new $Int64(0, n), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); - return [n, err]; - }; - Reader.prototype.Read = function(b) { return this.$val.Read(b); }; - Reader.ptr.prototype.ReadAt = function(b, off) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, b, err, n, off, r, x; - n = 0; - err = $ifaceNil; - r = this; - if ((off.$high < 0 || (off.$high === 0 && off.$low < 0))) { - _tmp = 0; - _tmp$1 = errors.New("strings.Reader.ReadAt: negative offset"); - n = _tmp; - err = _tmp$1; - return [n, err]; - } - if ((x = new $Int64(0, r.s.length), (off.$high > x.$high || (off.$high === x.$high && off.$low >= x.$low)))) { - _tmp$2 = 0; - _tmp$3 = io.EOF; - n = _tmp$2; - err = _tmp$3; - return [n, err]; - } - n = $copyString(b, r.s.substring($flatten64(off))); - if (n < b.$length) { - err = io.EOF; - } - return [n, err]; - }; - Reader.prototype.ReadAt = function(b, off) { return this.$val.ReadAt(b, off); }; - Reader.ptr.prototype.ReadByte = function() { - var $ptr, _tmp, _tmp$1, b, err, r, x, x$1, x$2, x$3; - b = 0; - err = $ifaceNil; - r = this; - r.prevRune = -1; - if ((x = r.i, x$1 = new $Int64(0, r.s.length), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { - _tmp = 0; - _tmp$1 = io.EOF; - b = _tmp; - err = _tmp$1; - return [b, err]; - } - b = r.s.charCodeAt($flatten64(r.i)); - r.i = (x$2 = r.i, x$3 = new $Int64(0, 1), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); - return [b, err]; - }; - Reader.prototype.ReadByte = function() { return this.$val.ReadByte(); }; - Reader.ptr.prototype.UnreadByte = function() { - var $ptr, r, x, x$1, x$2; - r = this; - r.prevRune = -1; - if ((x = r.i, (x.$high < 0 || (x.$high === 0 && x.$low <= 0)))) { - return errors.New("strings.Reader.UnreadByte: at beginning of string"); - } - r.i = (x$1 = r.i, x$2 = new $Int64(0, 1), new $Int64(x$1.$high - x$2.$high, x$1.$low - x$2.$low)); - return $ifaceNil; - }; - Reader.prototype.UnreadByte = function() { return this.$val.UnreadByte(); }; - Reader.ptr.prototype.ReadRune = function() { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, c, ch, err, r, size, x, x$1, x$2, x$3, x$4, x$5, x$6; - ch = 0; - size = 0; - err = $ifaceNil; - r = this; - if ((x = r.i, x$1 = new $Int64(0, r.s.length), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { - r.prevRune = -1; - _tmp = 0; - _tmp$1 = 0; - _tmp$2 = io.EOF; - ch = _tmp; - size = _tmp$1; - err = _tmp$2; - return [ch, size, err]; - } - r.prevRune = ((x$2 = r.i, x$2.$low + ((x$2.$high >> 31) * 4294967296)) >> 0); - c = r.s.charCodeAt($flatten64(r.i)); - if (c < 128) { - r.i = (x$3 = r.i, x$4 = new $Int64(0, 1), new $Int64(x$3.$high + x$4.$high, x$3.$low + x$4.$low)); - _tmp$3 = (c >> 0); - _tmp$4 = 1; - _tmp$5 = $ifaceNil; - ch = _tmp$3; - size = _tmp$4; - err = _tmp$5; - return [ch, size, err]; - } - _tuple = utf8.DecodeRuneInString(r.s.substring($flatten64(r.i))); - ch = _tuple[0]; - size = _tuple[1]; - r.i = (x$5 = r.i, x$6 = new $Int64(0, size), new $Int64(x$5.$high + x$6.$high, x$5.$low + x$6.$low)); - return [ch, size, err]; - }; - Reader.prototype.ReadRune = function() { return this.$val.ReadRune(); }; - Reader.ptr.prototype.UnreadRune = function() { - var $ptr, r; - r = this; - if (r.prevRune < 0) { - return errors.New("strings.Reader.UnreadRune: previous operation was not ReadRune"); - } - r.i = new $Int64(0, r.prevRune); - r.prevRune = -1; - return $ifaceNil; - }; - Reader.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; - Reader.ptr.prototype.Seek = function(offset, whence) { - var $ptr, _1, abs, offset, r, whence, x, x$1; - r = this; - r.prevRune = -1; - abs = new $Int64(0, 0); - _1 = whence; - if (_1 === (0)) { - abs = offset; - } else if (_1 === (1)) { - abs = (x = r.i, new $Int64(x.$high + offset.$high, x.$low + offset.$low)); - } else if (_1 === (2)) { - abs = (x$1 = new $Int64(0, r.s.length), new $Int64(x$1.$high + offset.$high, x$1.$low + offset.$low)); - } else { - return [new $Int64(0, 0), errors.New("strings.Reader.Seek: invalid whence")]; - } - if ((abs.$high < 0 || (abs.$high === 0 && abs.$low < 0))) { - return [new $Int64(0, 0), errors.New("strings.Reader.Seek: negative position")]; - } - r.i = abs; - return [abs, $ifaceNil]; - }; - Reader.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; - Reader.ptr.prototype.WriteTo = function(w) { - var $ptr, _r, _tmp, _tmp$1, _tuple, err, m, n, r, s, w, x, x$1, x$2, x$3, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; m = $f.m; n = $f.n; r = $f.r; s = $f.s; w = $f.w; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = new $Int64(0, 0); - err = $ifaceNil; - r = this; - r.prevRune = -1; - if ((x = r.i, x$1 = new $Int64(0, r.s.length), (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low >= x$1.$low)))) { - _tmp = new $Int64(0, 0); - _tmp$1 = $ifaceNil; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - s = r.s.substring($flatten64(r.i)); - _r = io.WriteString(w, s); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - m = _tuple[0]; - err = _tuple[1]; - if (m > s.length) { - $panic(new $String("strings.Reader.WriteTo: invalid WriteString count")); - } - r.i = (x$2 = r.i, x$3 = new $Int64(0, m), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)); - n = new $Int64(0, m); - if (!((m === s.length)) && $interfaceIsEqual(err, $ifaceNil)) { - err = io.ErrShortWrite; - } - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Reader.ptr.prototype.WriteTo }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.m = m; $f.n = n; $f.r = r; $f.s = s; $f.w = w; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.$s = $s; $f.$r = $r; return $f; - }; - Reader.prototype.WriteTo = function(w) { return this.$val.WriteTo(w); }; - NewReader = function(s) { - var $ptr, s; - return new Reader.ptr(s, new $Int64(0, 0), -1); - }; - $pkg.NewReader = NewReader; - ContainsRune = function(s, r) { - var $ptr, r, s; - return IndexRune(s, r) >= 0; - }; - $pkg.ContainsRune = ContainsRune; - IndexRune = function(s, r) { - var $ptr, _i, _ref, _rune, c, i, r, s; - if (r < 128) { - return IndexByte(s, (r << 24 >>> 24)); - } else { - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.length)) { break; } - _rune = $decodeRune(_ref, _i); - i = _i; - c = _rune[0]; - if (c === r) { - return i; - } - _i += _rune[1]; - } - } - return -1; - }; - $pkg.IndexRune = IndexRune; - ptrType$5.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType, $Int64], [$Int, $error], false)}, {prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "WriteTo", name: "WriteTo", pkg: "", typ: $funcType([io.Writer], [$Int64, $error], false)}]; - Reader.init([{prop: "s", name: "s", pkg: "strings", typ: $String, tag: ""}, {prop: "i", name: "i", pkg: "strings", typ: $Int64, tag: ""}, {prop: "prevRune", name: "prevRune", pkg: "strings", typ: $Int, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = unicode.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = utf8.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["time"] = (function() { - var $pkg = {}, $init, errors, js, nosync, runtime, strings, syscall, ParseError, Time, Month, Weekday, Duration, Location, zone, zoneTrans, sliceType, sliceType$1, ptrType, sliceType$2, arrayType, sliceType$3, arrayType$1, arrayType$2, ptrType$1, arrayType$4, ptrType$3, ptrType$6, std0x, longDayNames, shortDayNames, shortMonthNames, longMonthNames, atoiError, errBad, errLeadingInt, unitMap, months, days, daysBefore, utcLoc, utcLoc$24ptr, localLoc, localLoc$24ptr, localOnce, zoneinfo, badData, zoneDirs, _tuple, _r, init, initLocal, startsWithLowerCase, nextStdChunk, match, lookup, appendInt, atoi, formatNano, quote, isDigit, getnum, cutspace, skip, Parse, parse, parseTimeZone, parseGMT, parseNanoseconds, leadingInt, ParseDuration, absWeekday, absClock, fmtFrac, fmtInt, absDate, daysIn, Unix, isLeap, norm, Date, div, FixedZone; - errors = $packages["errors"]; - js = $packages["github.com/gopherjs/gopherjs/js"]; - nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; - runtime = $packages["runtime"]; - strings = $packages["strings"]; - syscall = $packages["syscall"]; - ParseError = $pkg.ParseError = $newType(0, $kindStruct, "time.ParseError", "ParseError", "time", function(Layout_, Value_, LayoutElem_, ValueElem_, Message_) { - this.$val = this; - if (arguments.length === 0) { - this.Layout = ""; - this.Value = ""; - this.LayoutElem = ""; - this.ValueElem = ""; - this.Message = ""; - return; - } - this.Layout = Layout_; - this.Value = Value_; - this.LayoutElem = LayoutElem_; - this.ValueElem = ValueElem_; - this.Message = Message_; - }); - Time = $pkg.Time = $newType(0, $kindStruct, "time.Time", "Time", "time", function(sec_, nsec_, loc_) { - this.$val = this; - if (arguments.length === 0) { - this.sec = new $Int64(0, 0); - this.nsec = 0; - this.loc = ptrType$1.nil; - return; - } - this.sec = sec_; - this.nsec = nsec_; - this.loc = loc_; - }); - Month = $pkg.Month = $newType(4, $kindInt, "time.Month", "Month", "time", null); - Weekday = $pkg.Weekday = $newType(4, $kindInt, "time.Weekday", "Weekday", "time", null); - Duration = $pkg.Duration = $newType(8, $kindInt64, "time.Duration", "Duration", "time", null); - Location = $pkg.Location = $newType(0, $kindStruct, "time.Location", "Location", "time", function(name_, zone_, tx_, cacheStart_, cacheEnd_, cacheZone_) { - this.$val = this; - if (arguments.length === 0) { - this.name = ""; - this.zone = sliceType.nil; - this.tx = sliceType$1.nil; - this.cacheStart = new $Int64(0, 0); - this.cacheEnd = new $Int64(0, 0); - this.cacheZone = ptrType.nil; - return; - } - this.name = name_; - this.zone = zone_; - this.tx = tx_; - this.cacheStart = cacheStart_; - this.cacheEnd = cacheEnd_; - this.cacheZone = cacheZone_; - }); - zone = $pkg.zone = $newType(0, $kindStruct, "time.zone", "zone", "time", function(name_, offset_, isDST_) { - this.$val = this; - if (arguments.length === 0) { - this.name = ""; - this.offset = 0; - this.isDST = false; - return; - } - this.name = name_; - this.offset = offset_; - this.isDST = isDST_; - }); - zoneTrans = $pkg.zoneTrans = $newType(0, $kindStruct, "time.zoneTrans", "zoneTrans", "time", function(when_, index_, isstd_, isutc_) { - this.$val = this; - if (arguments.length === 0) { - this.when = new $Int64(0, 0); - this.index = 0; - this.isstd = false; - this.isutc = false; - return; - } - this.when = when_; - this.index = index_; - this.isstd = isstd_; - this.isutc = isutc_; - }); - sliceType = $sliceType(zone); - sliceType$1 = $sliceType(zoneTrans); - ptrType = $ptrType(zone); - sliceType$2 = $sliceType($String); - arrayType = $arrayType($Uint8, 20); - sliceType$3 = $sliceType($Uint8); - arrayType$1 = $arrayType($Uint8, 9); - arrayType$2 = $arrayType($Uint8, 64); - ptrType$1 = $ptrType(Location); - arrayType$4 = $arrayType($Uint8, 32); - ptrType$3 = $ptrType(ParseError); - ptrType$6 = $ptrType(Time); - init = function() { - var $ptr; - Unix(new $Int64(0, 0), new $Int64(0, 0)); - }; - initLocal = function() { - var $ptr, d, i, j, s; - d = new ($global.Date)(); - s = $internalize(d, $String); - i = strings.IndexByte(s, 40); - j = strings.IndexByte(s, 41); - if ((i === -1) || (j === -1)) { - localLoc.name = "UTC"; - return; - } - localLoc.name = s.substring((i + 1 >> 0), j); - localLoc.zone = new sliceType([new zone.ptr(localLoc.name, $imul(($parseInt(d.getTimezoneOffset()) >> 0), -60), false)]); - }; - startsWithLowerCase = function(str) { - var $ptr, c, str; - if (str.length === 0) { - return false; - } - c = str.charCodeAt(0); - return 97 <= c && c <= 122; - }; - nextStdChunk = function(layout) { - var $ptr, _1, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$44, _tmp$45, _tmp$46, _tmp$47, _tmp$48, _tmp$49, _tmp$5, _tmp$50, _tmp$51, _tmp$52, _tmp$53, _tmp$54, _tmp$55, _tmp$56, _tmp$57, _tmp$58, _tmp$59, _tmp$6, _tmp$60, _tmp$61, _tmp$62, _tmp$63, _tmp$64, _tmp$65, _tmp$66, _tmp$67, _tmp$68, _tmp$69, _tmp$7, _tmp$70, _tmp$71, _tmp$72, _tmp$73, _tmp$74, _tmp$75, _tmp$76, _tmp$77, _tmp$78, _tmp$79, _tmp$8, _tmp$80, _tmp$81, _tmp$82, _tmp$83, _tmp$84, _tmp$85, _tmp$86, _tmp$9, c, ch, i, j, layout, prefix, std, std$1, suffix, x; - prefix = ""; - std = 0; - suffix = ""; - i = 0; - while (true) { - if (!(i < layout.length)) { break; } - c = (layout.charCodeAt(i) >> 0); - _1 = c; - if (_1 === (74)) { - if (layout.length >= (i + 3 >> 0) && layout.substring(i, (i + 3 >> 0)) === "Jan") { - if (layout.length >= (i + 7 >> 0) && layout.substring(i, (i + 7 >> 0)) === "January") { - _tmp = layout.substring(0, i); - _tmp$1 = 257; - _tmp$2 = layout.substring((i + 7 >> 0)); - prefix = _tmp; - std = _tmp$1; - suffix = _tmp$2; - return [prefix, std, suffix]; - } - if (!startsWithLowerCase(layout.substring((i + 3 >> 0)))) { - _tmp$3 = layout.substring(0, i); - _tmp$4 = 258; - _tmp$5 = layout.substring((i + 3 >> 0)); - prefix = _tmp$3; - std = _tmp$4; - suffix = _tmp$5; - return [prefix, std, suffix]; - } - } - } else if (_1 === (77)) { - if (layout.length >= (i + 3 >> 0)) { - if (layout.substring(i, (i + 3 >> 0)) === "Mon") { - if (layout.length >= (i + 6 >> 0) && layout.substring(i, (i + 6 >> 0)) === "Monday") { - _tmp$6 = layout.substring(0, i); - _tmp$7 = 261; - _tmp$8 = layout.substring((i + 6 >> 0)); - prefix = _tmp$6; - std = _tmp$7; - suffix = _tmp$8; - return [prefix, std, suffix]; - } - if (!startsWithLowerCase(layout.substring((i + 3 >> 0)))) { - _tmp$9 = layout.substring(0, i); - _tmp$10 = 262; - _tmp$11 = layout.substring((i + 3 >> 0)); - prefix = _tmp$9; - std = _tmp$10; - suffix = _tmp$11; - return [prefix, std, suffix]; - } - } - if (layout.substring(i, (i + 3 >> 0)) === "MST") { - _tmp$12 = layout.substring(0, i); - _tmp$13 = 21; - _tmp$14 = layout.substring((i + 3 >> 0)); - prefix = _tmp$12; - std = _tmp$13; - suffix = _tmp$14; - return [prefix, std, suffix]; - } - } - } else if (_1 === (48)) { - if (layout.length >= (i + 2 >> 0) && 49 <= layout.charCodeAt((i + 1 >> 0)) && layout.charCodeAt((i + 1 >> 0)) <= 54) { - _tmp$15 = layout.substring(0, i); - _tmp$16 = (x = layout.charCodeAt((i + 1 >> 0)) - 49 << 24 >>> 24, ((x < 0 || x >= std0x.length) ? $throwRuntimeError("index out of range") : std0x[x])); - _tmp$17 = layout.substring((i + 2 >> 0)); - prefix = _tmp$15; - std = _tmp$16; - suffix = _tmp$17; - return [prefix, std, suffix]; - } - } else if (_1 === (49)) { - if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 53)) { - _tmp$18 = layout.substring(0, i); - _tmp$19 = 522; - _tmp$20 = layout.substring((i + 2 >> 0)); - prefix = _tmp$18; - std = _tmp$19; - suffix = _tmp$20; - return [prefix, std, suffix]; - } - _tmp$21 = layout.substring(0, i); - _tmp$22 = 259; - _tmp$23 = layout.substring((i + 1 >> 0)); - prefix = _tmp$21; - std = _tmp$22; - suffix = _tmp$23; - return [prefix, std, suffix]; - } else if (_1 === (50)) { - if (layout.length >= (i + 4 >> 0) && layout.substring(i, (i + 4 >> 0)) === "2006") { - _tmp$24 = layout.substring(0, i); - _tmp$25 = 273; - _tmp$26 = layout.substring((i + 4 >> 0)); - prefix = _tmp$24; - std = _tmp$25; - suffix = _tmp$26; - return [prefix, std, suffix]; - } - _tmp$27 = layout.substring(0, i); - _tmp$28 = 263; - _tmp$29 = layout.substring((i + 1 >> 0)); - prefix = _tmp$27; - std = _tmp$28; - suffix = _tmp$29; - return [prefix, std, suffix]; - } else if (_1 === (95)) { - if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 50)) { - if (layout.length >= (i + 5 >> 0) && layout.substring((i + 1 >> 0), (i + 5 >> 0)) === "2006") { - _tmp$30 = layout.substring(0, (i + 1 >> 0)); - _tmp$31 = 273; - _tmp$32 = layout.substring((i + 5 >> 0)); - prefix = _tmp$30; - std = _tmp$31; - suffix = _tmp$32; - return [prefix, std, suffix]; - } - _tmp$33 = layout.substring(0, i); - _tmp$34 = 264; - _tmp$35 = layout.substring((i + 2 >> 0)); - prefix = _tmp$33; - std = _tmp$34; - suffix = _tmp$35; - return [prefix, std, suffix]; - } - } else if (_1 === (51)) { - _tmp$36 = layout.substring(0, i); - _tmp$37 = 523; - _tmp$38 = layout.substring((i + 1 >> 0)); - prefix = _tmp$36; - std = _tmp$37; - suffix = _tmp$38; - return [prefix, std, suffix]; - } else if (_1 === (52)) { - _tmp$39 = layout.substring(0, i); - _tmp$40 = 525; - _tmp$41 = layout.substring((i + 1 >> 0)); - prefix = _tmp$39; - std = _tmp$40; - suffix = _tmp$41; - return [prefix, std, suffix]; - } else if (_1 === (53)) { - _tmp$42 = layout.substring(0, i); - _tmp$43 = 527; - _tmp$44 = layout.substring((i + 1 >> 0)); - prefix = _tmp$42; - std = _tmp$43; - suffix = _tmp$44; - return [prefix, std, suffix]; - } else if (_1 === (80)) { - if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 77)) { - _tmp$45 = layout.substring(0, i); - _tmp$46 = 531; - _tmp$47 = layout.substring((i + 2 >> 0)); - prefix = _tmp$45; - std = _tmp$46; - suffix = _tmp$47; - return [prefix, std, suffix]; - } - } else if (_1 === (112)) { - if (layout.length >= (i + 2 >> 0) && (layout.charCodeAt((i + 1 >> 0)) === 109)) { - _tmp$48 = layout.substring(0, i); - _tmp$49 = 532; - _tmp$50 = layout.substring((i + 2 >> 0)); - prefix = _tmp$48; - std = _tmp$49; - suffix = _tmp$50; - return [prefix, std, suffix]; - } - } else if (_1 === (45)) { - if (layout.length >= (i + 7 >> 0) && layout.substring(i, (i + 7 >> 0)) === "-070000") { - _tmp$51 = layout.substring(0, i); - _tmp$52 = 28; - _tmp$53 = layout.substring((i + 7 >> 0)); - prefix = _tmp$51; - std = _tmp$52; - suffix = _tmp$53; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 9 >> 0) && layout.substring(i, (i + 9 >> 0)) === "-07:00:00") { - _tmp$54 = layout.substring(0, i); - _tmp$55 = 31; - _tmp$56 = layout.substring((i + 9 >> 0)); - prefix = _tmp$54; - std = _tmp$55; - suffix = _tmp$56; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 5 >> 0) && layout.substring(i, (i + 5 >> 0)) === "-0700") { - _tmp$57 = layout.substring(0, i); - _tmp$58 = 27; - _tmp$59 = layout.substring((i + 5 >> 0)); - prefix = _tmp$57; - std = _tmp$58; - suffix = _tmp$59; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 6 >> 0) && layout.substring(i, (i + 6 >> 0)) === "-07:00") { - _tmp$60 = layout.substring(0, i); - _tmp$61 = 30; - _tmp$62 = layout.substring((i + 6 >> 0)); - prefix = _tmp$60; - std = _tmp$61; - suffix = _tmp$62; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 3 >> 0) && layout.substring(i, (i + 3 >> 0)) === "-07") { - _tmp$63 = layout.substring(0, i); - _tmp$64 = 29; - _tmp$65 = layout.substring((i + 3 >> 0)); - prefix = _tmp$63; - std = _tmp$64; - suffix = _tmp$65; - return [prefix, std, suffix]; - } - } else if (_1 === (90)) { - if (layout.length >= (i + 7 >> 0) && layout.substring(i, (i + 7 >> 0)) === "Z070000") { - _tmp$66 = layout.substring(0, i); - _tmp$67 = 23; - _tmp$68 = layout.substring((i + 7 >> 0)); - prefix = _tmp$66; - std = _tmp$67; - suffix = _tmp$68; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 9 >> 0) && layout.substring(i, (i + 9 >> 0)) === "Z07:00:00") { - _tmp$69 = layout.substring(0, i); - _tmp$70 = 26; - _tmp$71 = layout.substring((i + 9 >> 0)); - prefix = _tmp$69; - std = _tmp$70; - suffix = _tmp$71; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 5 >> 0) && layout.substring(i, (i + 5 >> 0)) === "Z0700") { - _tmp$72 = layout.substring(0, i); - _tmp$73 = 22; - _tmp$74 = layout.substring((i + 5 >> 0)); - prefix = _tmp$72; - std = _tmp$73; - suffix = _tmp$74; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 6 >> 0) && layout.substring(i, (i + 6 >> 0)) === "Z07:00") { - _tmp$75 = layout.substring(0, i); - _tmp$76 = 25; - _tmp$77 = layout.substring((i + 6 >> 0)); - prefix = _tmp$75; - std = _tmp$76; - suffix = _tmp$77; - return [prefix, std, suffix]; - } - if (layout.length >= (i + 3 >> 0) && layout.substring(i, (i + 3 >> 0)) === "Z07") { - _tmp$78 = layout.substring(0, i); - _tmp$79 = 24; - _tmp$80 = layout.substring((i + 3 >> 0)); - prefix = _tmp$78; - std = _tmp$79; - suffix = _tmp$80; - return [prefix, std, suffix]; - } - } else if (_1 === (46)) { - if ((i + 1 >> 0) < layout.length && ((layout.charCodeAt((i + 1 >> 0)) === 48) || (layout.charCodeAt((i + 1 >> 0)) === 57))) { - ch = layout.charCodeAt((i + 1 >> 0)); - j = i + 1 >> 0; - while (true) { - if (!(j < layout.length && (layout.charCodeAt(j) === ch))) { break; } - j = j + (1) >> 0; - } - if (!isDigit(layout, j)) { - std$1 = 32; - if (layout.charCodeAt((i + 1 >> 0)) === 57) { - std$1 = 33; - } - std$1 = std$1 | ((((j - ((i + 1 >> 0)) >> 0)) << 16 >> 0)); - _tmp$81 = layout.substring(0, i); - _tmp$82 = std$1; - _tmp$83 = layout.substring(j); - prefix = _tmp$81; - std = _tmp$82; - suffix = _tmp$83; - return [prefix, std, suffix]; - } - } - } - i = i + (1) >> 0; - } - _tmp$84 = layout; - _tmp$85 = 0; - _tmp$86 = ""; - prefix = _tmp$84; - std = _tmp$85; - suffix = _tmp$86; - return [prefix, std, suffix]; - }; - match = function(s1, s2) { - var $ptr, c1, c2, i, s1, s2; - i = 0; - while (true) { - if (!(i < s1.length)) { break; } - c1 = s1.charCodeAt(i); - c2 = s2.charCodeAt(i); - if (!((c1 === c2))) { - c1 = (c1 | (32)) >>> 0; - c2 = (c2 | (32)) >>> 0; - if (!((c1 === c2)) || c1 < 97 || c1 > 122) { - return false; - } - } - i = i + (1) >> 0; - } - return true; - }; - lookup = function(tab, val) { - var $ptr, _i, _ref, i, tab, v, val; - _ref = tab; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - v = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (val.length >= v.length && match(val.substring(0, v.length), v)) { - return [i, val.substring(v.length), $ifaceNil]; - } - _i++; - } - return [-1, val, errBad]; - }; - appendInt = function(b, x, width) { - var $ptr, _q, b, buf, i, q, u, w, width, x; - u = (x >>> 0); - if (x < 0) { - b = $append(b, 45); - u = (-x >>> 0); - } - buf = arrayType.zero(); - i = 20; - while (true) { - if (!(u >= 10)) { break; } - i = i - (1) >> 0; - q = (_q = u / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - ((i < 0 || i >= buf.length) ? $throwRuntimeError("index out of range") : buf[i] = (((48 + u >>> 0) - (q * 10 >>> 0) >>> 0) << 24 >>> 24)); - u = q; - } - i = i - (1) >> 0; - ((i < 0 || i >= buf.length) ? $throwRuntimeError("index out of range") : buf[i] = ((48 + u >>> 0) << 24 >>> 24)); - w = 20 - i >> 0; - while (true) { - if (!(w < width)) { break; } - b = $append(b, 48); - w = w + (1) >> 0; - } - return $appendSlice(b, $subslice(new sliceType$3(buf), i)); - }; - atoi = function(s) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple$1, err, neg, q, rem, s, x; - x = 0; - err = $ifaceNil; - neg = false; - if (!(s === "") && ((s.charCodeAt(0) === 45) || (s.charCodeAt(0) === 43))) { - neg = s.charCodeAt(0) === 45; - s = s.substring(1); - } - _tuple$1 = leadingInt(s); - q = _tuple$1[0]; - rem = _tuple$1[1]; - err = _tuple$1[2]; - x = ((q.$low + ((q.$high >> 31) * 4294967296)) >> 0); - if (!($interfaceIsEqual(err, $ifaceNil)) || !(rem === "")) { - _tmp = 0; - _tmp$1 = atoiError; - x = _tmp; - err = _tmp$1; - return [x, err]; - } - if (neg) { - x = -x; - } - _tmp$2 = x; - _tmp$3 = $ifaceNil; - x = _tmp$2; - err = _tmp$3; - return [x, err]; - }; - formatNano = function(b, nanosec, n, trim) { - var $ptr, _q, _r$1, b, buf, n, nanosec, start, trim, u, x; - u = nanosec; - buf = arrayType$1.zero(); - start = 9; - while (true) { - if (!(start > 0)) { break; } - start = start - (1) >> 0; - ((start < 0 || start >= buf.length) ? $throwRuntimeError("index out of range") : buf[start] = (((_r$1 = u % 10, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) + 48 >>> 0) << 24 >>> 24)); - u = (_q = u / (10), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - } - if (n > 9) { - n = 9; - } - if (trim) { - while (true) { - if (!(n > 0 && ((x = n - 1 >> 0, ((x < 0 || x >= buf.length) ? $throwRuntimeError("index out of range") : buf[x])) === 48))) { break; } - n = n - (1) >> 0; - } - if (n === 0) { - return b; - } - } - b = $append(b, 46); - return $appendSlice(b, $subslice(new sliceType$3(buf), 0, n)); - }; - Time.ptr.prototype.String = function() { - var $ptr, _r$1, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.Format("2006-01-02 15:04:05.999999999 -0700 MST"); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.String }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.String = function() { return this.$val.String(); }; - Time.ptr.prototype.Format = function(layout) { - var $ptr, _r$1, b, buf, layout, max, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; b = $f.b; buf = $f.buf; layout = $f.layout; max = $f.max; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - b = sliceType$3.nil; - max = layout.length + 10 >> 0; - if (max < 64) { - buf = arrayType$2.zero(); - b = $subslice(new sliceType$3(buf), 0, 0); - } else { - b = $makeSlice(sliceType$3, 0, max); - } - _r$1 = t.AppendFormat(b, layout); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - b = _r$1; - return $bytesToString(b); - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Format }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.b = b; $f.buf = buf; $f.layout = layout; $f.max = max; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Format = function(layout) { return this.$val.Format(layout); }; - Time.ptr.prototype.AppendFormat = function(b, layout) { - var $ptr, _2, _q, _q$1, _q$2, _q$3, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple$1, _tuple$2, _tuple$3, _tuple$4, abs, absoffset, b, day, hour, hr, hr$1, layout, m, min, month, name, offset, prefix, s, sec, std, suffix, t, y, year, zone$1, zone$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _2 = $f._2; _q = $f._q; _q$1 = $f._q$1; _q$2 = $f._q$2; _q$3 = $f._q$3; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; abs = $f.abs; absoffset = $f.absoffset; b = $f.b; day = $f.day; hour = $f.hour; hr = $f.hr; hr$1 = $f.hr$1; layout = $f.layout; m = $f.m; min = $f.min; month = $f.month; name = $f.name; offset = $f.offset; prefix = $f.prefix; s = $f.s; sec = $f.sec; std = $f.std; suffix = $f.suffix; t = $f.t; y = $f.y; year = $f.year; zone$1 = $f.zone$1; zone$2 = $f.zone$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.locabs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - name = _tuple$1[0]; - offset = _tuple$1[1]; - abs = _tuple$1[2]; - year = -1; - month = 0; - day = 0; - hour = -1; - min = 0; - sec = 0; - while (true) { - if (!(!(layout === ""))) { break; } - _tuple$2 = nextStdChunk(layout); - prefix = _tuple$2[0]; - std = _tuple$2[1]; - suffix = _tuple$2[2]; - if (!(prefix === "")) { - b = $appendSlice(b, prefix); - } - if (std === 0) { - break; - } - layout = suffix; - if (year < 0 && !(((std & 256) === 0))) { - _tuple$3 = absDate(abs, true); - year = _tuple$3[0]; - month = _tuple$3[1]; - day = _tuple$3[2]; - } - if (hour < 0 && !(((std & 512) === 0))) { - _tuple$4 = absClock(abs); - hour = _tuple$4[0]; - min = _tuple$4[1]; - sec = _tuple$4[2]; - } - switch (0) { default: - _2 = std & 65535; - if (_2 === (274)) { - y = year; - if (y < 0) { - y = -y; - } - b = appendInt(b, (_r$2 = y % 100, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")), 2); - } else if (_2 === (273)) { - b = appendInt(b, year, 4); - } else if (_2 === (258)) { - b = $appendSlice(b, new Month(month).String().substring(0, 3)); - } else if (_2 === (257)) { - m = new Month(month).String(); - b = $appendSlice(b, m); - } else if (_2 === (259)) { - b = appendInt(b, (month >> 0), 0); - } else if (_2 === (260)) { - b = appendInt(b, (month >> 0), 2); - } else if (_2 === (262)) { - b = $appendSlice(b, new Weekday(absWeekday(abs)).String().substring(0, 3)); - } else if (_2 === (261)) { - s = new Weekday(absWeekday(abs)).String(); - b = $appendSlice(b, s); - } else if (_2 === (263)) { - b = appendInt(b, day, 0); - } else if (_2 === (264)) { - if (day < 10) { - b = $append(b, 32); - } - b = appendInt(b, day, 0); - } else if (_2 === (265)) { - b = appendInt(b, day, 2); - } else if (_2 === (522)) { - b = appendInt(b, hour, 2); - } else if (_2 === (523)) { - hr = (_r$3 = hour % 12, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")); - if (hr === 0) { - hr = 12; - } - b = appendInt(b, hr, 0); - } else if (_2 === (524)) { - hr$1 = (_r$4 = hour % 12, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); - if (hr$1 === 0) { - hr$1 = 12; - } - b = appendInt(b, hr$1, 2); - } else if (_2 === (525)) { - b = appendInt(b, min, 0); - } else if (_2 === (526)) { - b = appendInt(b, min, 2); - } else if (_2 === (527)) { - b = appendInt(b, sec, 0); - } else if (_2 === (528)) { - b = appendInt(b, sec, 2); - } else if (_2 === (531)) { - if (hour >= 12) { - b = $appendSlice(b, "PM"); - } else { - b = $appendSlice(b, "AM"); - } - } else if (_2 === (532)) { - if (hour >= 12) { - b = $appendSlice(b, "pm"); - } else { - b = $appendSlice(b, "am"); - } - } else if ((_2 === (22)) || (_2 === (25)) || (_2 === (23)) || (_2 === (24)) || (_2 === (26)) || (_2 === (27)) || (_2 === (30)) || (_2 === (28)) || (_2 === (29)) || (_2 === (31))) { - if ((offset === 0) && ((std === 22) || (std === 25) || (std === 23) || (std === 24) || (std === 26))) { - b = $append(b, 90); - break; - } - zone$1 = (_q = offset / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - absoffset = offset; - if (zone$1 < 0) { - b = $append(b, 45); - zone$1 = -zone$1; - absoffset = -absoffset; - } else { - b = $append(b, 43); - } - b = appendInt(b, (_q$1 = zone$1 / 60, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), 2); - if ((std === 25) || (std === 30) || (std === 26) || (std === 31)) { - b = $append(b, 58); - } - if (!((std === 29)) && !((std === 24))) { - b = appendInt(b, (_r$5 = zone$1 % 60, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")), 2); - } - if ((std === 23) || (std === 28) || (std === 31) || (std === 26)) { - if ((std === 31) || (std === 26)) { - b = $append(b, 58); - } - b = appendInt(b, (_r$6 = absoffset % 60, _r$6 === _r$6 ? _r$6 : $throwRuntimeError("integer divide by zero")), 2); - } - } else if (_2 === (21)) { - if (!(name === "")) { - b = $appendSlice(b, name); - break; - } - zone$2 = (_q$2 = offset / 60, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero")); - if (zone$2 < 0) { - b = $append(b, 45); - zone$2 = -zone$2; - } else { - b = $append(b, 43); - } - b = appendInt(b, (_q$3 = zone$2 / 60, (_q$3 === _q$3 && _q$3 !== 1/0 && _q$3 !== -1/0) ? _q$3 >> 0 : $throwRuntimeError("integer divide by zero")), 2); - b = appendInt(b, (_r$7 = zone$2 % 60, _r$7 === _r$7 ? _r$7 : $throwRuntimeError("integer divide by zero")), 2); - } else if ((_2 === (32)) || (_2 === (33))) { - b = formatNano(b, (t.Nanosecond() >>> 0), std >> 16 >> 0, (std & 65535) === 33); - } - } - } - return b; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.AppendFormat }; } $f.$ptr = $ptr; $f._2 = _2; $f._q = _q; $f._q$1 = _q$1; $f._q$2 = _q$2; $f._q$3 = _q$3; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f.abs = abs; $f.absoffset = absoffset; $f.b = b; $f.day = day; $f.hour = hour; $f.hr = hr; $f.hr$1 = hr$1; $f.layout = layout; $f.m = m; $f.min = min; $f.month = month; $f.name = name; $f.offset = offset; $f.prefix = prefix; $f.s = s; $f.sec = sec; $f.std = std; $f.suffix = suffix; $f.t = t; $f.y = y; $f.year = year; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.AppendFormat = function(b, layout) { return this.$val.AppendFormat(b, layout); }; - quote = function(s) { - var $ptr, s; - return "\"" + s + "\""; - }; - ParseError.ptr.prototype.Error = function() { - var $ptr, e; - e = this; - if (e.Message === "") { - return "parsing time " + quote(e.Value) + " as " + quote(e.Layout) + ": cannot parse " + quote(e.ValueElem) + " as " + quote(e.LayoutElem); - } - return "parsing time " + quote(e.Value) + e.Message; - }; - ParseError.prototype.Error = function() { return this.$val.Error(); }; - isDigit = function(s, i) { - var $ptr, c, i, s; - if (s.length <= i) { - return false; - } - c = s.charCodeAt(i); - return 48 <= c && c <= 57; - }; - getnum = function(s, fixed) { - var $ptr, fixed, s; - if (!isDigit(s, 0)) { - return [0, s, errBad]; - } - if (!isDigit(s, 1)) { - if (fixed) { - return [0, s, errBad]; - } - return [((s.charCodeAt(0) - 48 << 24 >>> 24) >> 0), s.substring(1), $ifaceNil]; - } - return [($imul(((s.charCodeAt(0) - 48 << 24 >>> 24) >> 0), 10)) + ((s.charCodeAt(1) - 48 << 24 >>> 24) >> 0) >> 0, s.substring(2), $ifaceNil]; - }; - cutspace = function(s) { - var $ptr, s; - while (true) { - if (!(s.length > 0 && (s.charCodeAt(0) === 32))) { break; } - s = s.substring(1); - } - return s; - }; - skip = function(value, prefix) { - var $ptr, prefix, value; - while (true) { - if (!(prefix.length > 0)) { break; } - if (prefix.charCodeAt(0) === 32) { - if (value.length > 0 && !((value.charCodeAt(0) === 32))) { - return [value, errBad]; - } - prefix = cutspace(prefix); - value = cutspace(value); - continue; - } - if ((value.length === 0) || !((value.charCodeAt(0) === prefix.charCodeAt(0)))) { - return [value, errBad]; - } - prefix = prefix.substring(1); - value = value.substring(1); - } - return [value, $ifaceNil]; - }; - Parse = function(layout, value) { - var $ptr, _r$1, layout, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; layout = $f.layout; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$1 = parse(layout, value, $pkg.UTC, $pkg.Local); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: Parse }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.layout = layout; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Parse = Parse; - parse = function(layout, value, defaultLocation, local) { - var $ptr, _3, _4, _5, _6, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$29, _tmp$3, _tmp$30, _tmp$31, _tmp$32, _tmp$33, _tmp$34, _tmp$35, _tmp$36, _tmp$37, _tmp$38, _tmp$39, _tmp$4, _tmp$40, _tmp$41, _tmp$42, _tmp$43, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple$1, _tuple$10, _tuple$11, _tuple$12, _tuple$13, _tuple$14, _tuple$15, _tuple$16, _tuple$17, _tuple$18, _tuple$19, _tuple$2, _tuple$20, _tuple$21, _tuple$22, _tuple$23, _tuple$24, _tuple$25, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, _tuple$9, alayout, amSet, avalue, day, defaultLocation, err, hour, hour$1, hr, i, layout, local, min, min$1, mm, month, n, n$1, name, ndigit, nsec, offset, offset$1, ok, ok$1, p, pmSet, prefix, rangeErrString, sec, seconds, sign, ss, std, stdstr, suffix, t, t$1, value, x, x$1, x$2, x$3, x$4, x$5, year, z, zoneName, zoneOffset, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _3 = $f._3; _4 = $f._4; _5 = $f._5; _6 = $f._6; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$10 = $f._tmp$10; _tmp$11 = $f._tmp$11; _tmp$12 = $f._tmp$12; _tmp$13 = $f._tmp$13; _tmp$14 = $f._tmp$14; _tmp$15 = $f._tmp$15; _tmp$16 = $f._tmp$16; _tmp$17 = $f._tmp$17; _tmp$18 = $f._tmp$18; _tmp$19 = $f._tmp$19; _tmp$2 = $f._tmp$2; _tmp$20 = $f._tmp$20; _tmp$21 = $f._tmp$21; _tmp$22 = $f._tmp$22; _tmp$23 = $f._tmp$23; _tmp$24 = $f._tmp$24; _tmp$25 = $f._tmp$25; _tmp$26 = $f._tmp$26; _tmp$27 = $f._tmp$27; _tmp$28 = $f._tmp$28; _tmp$29 = $f._tmp$29; _tmp$3 = $f._tmp$3; _tmp$30 = $f._tmp$30; _tmp$31 = $f._tmp$31; _tmp$32 = $f._tmp$32; _tmp$33 = $f._tmp$33; _tmp$34 = $f._tmp$34; _tmp$35 = $f._tmp$35; _tmp$36 = $f._tmp$36; _tmp$37 = $f._tmp$37; _tmp$38 = $f._tmp$38; _tmp$39 = $f._tmp$39; _tmp$4 = $f._tmp$4; _tmp$40 = $f._tmp$40; _tmp$41 = $f._tmp$41; _tmp$42 = $f._tmp$42; _tmp$43 = $f._tmp$43; _tmp$5 = $f._tmp$5; _tmp$6 = $f._tmp$6; _tmp$7 = $f._tmp$7; _tmp$8 = $f._tmp$8; _tmp$9 = $f._tmp$9; _tuple$1 = $f._tuple$1; _tuple$10 = $f._tuple$10; _tuple$11 = $f._tuple$11; _tuple$12 = $f._tuple$12; _tuple$13 = $f._tuple$13; _tuple$14 = $f._tuple$14; _tuple$15 = $f._tuple$15; _tuple$16 = $f._tuple$16; _tuple$17 = $f._tuple$17; _tuple$18 = $f._tuple$18; _tuple$19 = $f._tuple$19; _tuple$2 = $f._tuple$2; _tuple$20 = $f._tuple$20; _tuple$21 = $f._tuple$21; _tuple$22 = $f._tuple$22; _tuple$23 = $f._tuple$23; _tuple$24 = $f._tuple$24; _tuple$25 = $f._tuple$25; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; _tuple$8 = $f._tuple$8; _tuple$9 = $f._tuple$9; alayout = $f.alayout; amSet = $f.amSet; avalue = $f.avalue; day = $f.day; defaultLocation = $f.defaultLocation; err = $f.err; hour = $f.hour; hour$1 = $f.hour$1; hr = $f.hr; i = $f.i; layout = $f.layout; local = $f.local; min = $f.min; min$1 = $f.min$1; mm = $f.mm; month = $f.month; n = $f.n; n$1 = $f.n$1; name = $f.name; ndigit = $f.ndigit; nsec = $f.nsec; offset = $f.offset; offset$1 = $f.offset$1; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; pmSet = $f.pmSet; prefix = $f.prefix; rangeErrString = $f.rangeErrString; sec = $f.sec; seconds = $f.seconds; sign = $f.sign; ss = $f.ss; std = $f.std; stdstr = $f.stdstr; suffix = $f.suffix; t = $f.t; t$1 = $f.t$1; value = $f.value; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; year = $f.year; z = $f.z; zoneName = $f.zoneName; zoneOffset = $f.zoneOffset; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _tmp = layout; - _tmp$1 = value; - alayout = _tmp; - avalue = _tmp$1; - rangeErrString = ""; - amSet = false; - pmSet = false; - year = 0; - month = 1; - day = 1; - hour = 0; - min = 0; - sec = 0; - nsec = 0; - z = ptrType$1.nil; - zoneOffset = -1; - zoneName = ""; - while (true) { - err = $ifaceNil; - _tuple$1 = nextStdChunk(layout); - prefix = _tuple$1[0]; - std = _tuple$1[1]; - suffix = _tuple$1[2]; - stdstr = layout.substring(prefix.length, (layout.length - suffix.length >> 0)); - _tuple$2 = skip(value, prefix); - value = _tuple$2[0]; - err = _tuple$2[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [new Time.ptr(new $Int64(0, 0), 0, ptrType$1.nil), new ParseError.ptr(alayout, avalue, prefix, value, "")]; - } - if (std === 0) { - if (!((value.length === 0))) { - return [new Time.ptr(new $Int64(0, 0), 0, ptrType$1.nil), new ParseError.ptr(alayout, avalue, "", value, ": extra text: " + value)]; - } - break; - } - layout = suffix; - p = ""; - switch (0) { default: - _3 = std & 65535; - if (_3 === (274)) { - if (value.length < 2) { - err = errBad; - break; - } - _tmp$2 = value.substring(0, 2); - _tmp$3 = value.substring(2); - p = _tmp$2; - value = _tmp$3; - _tuple$3 = atoi(p); - year = _tuple$3[0]; - err = _tuple$3[1]; - if (year >= 69) { - year = year + (1900) >> 0; - } else { - year = year + (2000) >> 0; - } - } else if (_3 === (273)) { - if (value.length < 4 || !isDigit(value, 0)) { - err = errBad; - break; - } - _tmp$4 = value.substring(0, 4); - _tmp$5 = value.substring(4); - p = _tmp$4; - value = _tmp$5; - _tuple$4 = atoi(p); - year = _tuple$4[0]; - err = _tuple$4[1]; - } else if (_3 === (258)) { - _tuple$5 = lookup(shortMonthNames, value); - month = _tuple$5[0]; - value = _tuple$5[1]; - err = _tuple$5[2]; - } else if (_3 === (257)) { - _tuple$6 = lookup(longMonthNames, value); - month = _tuple$6[0]; - value = _tuple$6[1]; - err = _tuple$6[2]; - } else if ((_3 === (259)) || (_3 === (260))) { - _tuple$7 = getnum(value, std === 260); - month = _tuple$7[0]; - value = _tuple$7[1]; - err = _tuple$7[2]; - if (month <= 0 || 12 < month) { - rangeErrString = "month"; - } - } else if (_3 === (262)) { - _tuple$8 = lookup(shortDayNames, value); - value = _tuple$8[1]; - err = _tuple$8[2]; - } else if (_3 === (261)) { - _tuple$9 = lookup(longDayNames, value); - value = _tuple$9[1]; - err = _tuple$9[2]; - } else if ((_3 === (263)) || (_3 === (264)) || (_3 === (265))) { - if ((std === 264) && value.length > 0 && (value.charCodeAt(0) === 32)) { - value = value.substring(1); - } - _tuple$10 = getnum(value, std === 265); - day = _tuple$10[0]; - value = _tuple$10[1]; - err = _tuple$10[2]; - if (day < 0) { - rangeErrString = "day"; - } - } else if (_3 === (522)) { - _tuple$11 = getnum(value, false); - hour = _tuple$11[0]; - value = _tuple$11[1]; - err = _tuple$11[2]; - if (hour < 0 || 24 <= hour) { - rangeErrString = "hour"; - } - } else if ((_3 === (523)) || (_3 === (524))) { - _tuple$12 = getnum(value, std === 524); - hour = _tuple$12[0]; - value = _tuple$12[1]; - err = _tuple$12[2]; - if (hour < 0 || 12 < hour) { - rangeErrString = "hour"; - } - } else if ((_3 === (525)) || (_3 === (526))) { - _tuple$13 = getnum(value, std === 526); - min = _tuple$13[0]; - value = _tuple$13[1]; - err = _tuple$13[2]; - if (min < 0 || 60 <= min) { - rangeErrString = "minute"; - } - } else if ((_3 === (527)) || (_3 === (528))) { - _tuple$14 = getnum(value, std === 528); - sec = _tuple$14[0]; - value = _tuple$14[1]; - err = _tuple$14[2]; - if (sec < 0 || 60 <= sec) { - rangeErrString = "second"; - } - if (value.length >= 2 && (value.charCodeAt(0) === 46) && isDigit(value, 1)) { - _tuple$15 = nextStdChunk(layout); - std = _tuple$15[1]; - std = std & (65535); - if ((std === 32) || (std === 33)) { - break; - } - n = 2; - while (true) { - if (!(n < value.length && isDigit(value, n))) { break; } - n = n + (1) >> 0; - } - _tuple$16 = parseNanoseconds(value, n); - nsec = _tuple$16[0]; - rangeErrString = _tuple$16[1]; - err = _tuple$16[2]; - value = value.substring(n); - } - } else if (_3 === (531)) { - if (value.length < 2) { - err = errBad; - break; - } - _tmp$6 = value.substring(0, 2); - _tmp$7 = value.substring(2); - p = _tmp$6; - value = _tmp$7; - _4 = p; - if (_4 === ("PM")) { - pmSet = true; - } else if (_4 === ("AM")) { - amSet = true; - } else { - err = errBad; - } - } else if (_3 === (532)) { - if (value.length < 2) { - err = errBad; - break; - } - _tmp$8 = value.substring(0, 2); - _tmp$9 = value.substring(2); - p = _tmp$8; - value = _tmp$9; - _5 = p; - if (_5 === ("pm")) { - pmSet = true; - } else if (_5 === ("am")) { - amSet = true; - } else { - err = errBad; - } - } else if ((_3 === (22)) || (_3 === (25)) || (_3 === (23)) || (_3 === (24)) || (_3 === (26)) || (_3 === (27)) || (_3 === (29)) || (_3 === (30)) || (_3 === (28)) || (_3 === (31))) { - if (((std === 22) || (std === 24) || (std === 25)) && value.length >= 1 && (value.charCodeAt(0) === 90)) { - value = value.substring(1); - z = $pkg.UTC; - break; - } - _tmp$10 = ""; - _tmp$11 = ""; - _tmp$12 = ""; - _tmp$13 = ""; - sign = _tmp$10; - hour$1 = _tmp$11; - min$1 = _tmp$12; - seconds = _tmp$13; - if ((std === 25) || (std === 30)) { - if (value.length < 6) { - err = errBad; - break; - } - if (!((value.charCodeAt(3) === 58))) { - err = errBad; - break; - } - _tmp$14 = value.substring(0, 1); - _tmp$15 = value.substring(1, 3); - _tmp$16 = value.substring(4, 6); - _tmp$17 = "00"; - _tmp$18 = value.substring(6); - sign = _tmp$14; - hour$1 = _tmp$15; - min$1 = _tmp$16; - seconds = _tmp$17; - value = _tmp$18; - } else if ((std === 29) || (std === 24)) { - if (value.length < 3) { - err = errBad; - break; - } - _tmp$19 = value.substring(0, 1); - _tmp$20 = value.substring(1, 3); - _tmp$21 = "00"; - _tmp$22 = "00"; - _tmp$23 = value.substring(3); - sign = _tmp$19; - hour$1 = _tmp$20; - min$1 = _tmp$21; - seconds = _tmp$22; - value = _tmp$23; - } else if ((std === 26) || (std === 31)) { - if (value.length < 9) { - err = errBad; - break; - } - if (!((value.charCodeAt(3) === 58)) || !((value.charCodeAt(6) === 58))) { - err = errBad; - break; - } - _tmp$24 = value.substring(0, 1); - _tmp$25 = value.substring(1, 3); - _tmp$26 = value.substring(4, 6); - _tmp$27 = value.substring(7, 9); - _tmp$28 = value.substring(9); - sign = _tmp$24; - hour$1 = _tmp$25; - min$1 = _tmp$26; - seconds = _tmp$27; - value = _tmp$28; - } else if ((std === 23) || (std === 28)) { - if (value.length < 7) { - err = errBad; - break; - } - _tmp$29 = value.substring(0, 1); - _tmp$30 = value.substring(1, 3); - _tmp$31 = value.substring(3, 5); - _tmp$32 = value.substring(5, 7); - _tmp$33 = value.substring(7); - sign = _tmp$29; - hour$1 = _tmp$30; - min$1 = _tmp$31; - seconds = _tmp$32; - value = _tmp$33; - } else { - if (value.length < 5) { - err = errBad; - break; - } - _tmp$34 = value.substring(0, 1); - _tmp$35 = value.substring(1, 3); - _tmp$36 = value.substring(3, 5); - _tmp$37 = "00"; - _tmp$38 = value.substring(5); - sign = _tmp$34; - hour$1 = _tmp$35; - min$1 = _tmp$36; - seconds = _tmp$37; - value = _tmp$38; - } - _tmp$39 = 0; - _tmp$40 = 0; - _tmp$41 = 0; - hr = _tmp$39; - mm = _tmp$40; - ss = _tmp$41; - _tuple$17 = atoi(hour$1); - hr = _tuple$17[0]; - err = _tuple$17[1]; - if ($interfaceIsEqual(err, $ifaceNil)) { - _tuple$18 = atoi(min$1); - mm = _tuple$18[0]; - err = _tuple$18[1]; - } - if ($interfaceIsEqual(err, $ifaceNil)) { - _tuple$19 = atoi(seconds); - ss = _tuple$19[0]; - err = _tuple$19[1]; - } - zoneOffset = ($imul(((($imul(hr, 60)) + mm >> 0)), 60)) + ss >> 0; - _6 = sign.charCodeAt(0); - if (_6 === (43)) { - } else if (_6 === (45)) { - zoneOffset = -zoneOffset; - } else { - err = errBad; - } - } else if (_3 === (21)) { - if (value.length >= 3 && value.substring(0, 3) === "UTC") { - z = $pkg.UTC; - value = value.substring(3); - break; - } - _tuple$20 = parseTimeZone(value); - n$1 = _tuple$20[0]; - ok = _tuple$20[1]; - if (!ok) { - err = errBad; - break; - } - _tmp$42 = value.substring(0, n$1); - _tmp$43 = value.substring(n$1); - zoneName = _tmp$42; - value = _tmp$43; - } else if (_3 === (32)) { - ndigit = 1 + ((std >> 16 >> 0)) >> 0; - if (value.length < ndigit) { - err = errBad; - break; - } - _tuple$21 = parseNanoseconds(value, ndigit); - nsec = _tuple$21[0]; - rangeErrString = _tuple$21[1]; - err = _tuple$21[2]; - value = value.substring(ndigit); - } else if (_3 === (33)) { - if (value.length < 2 || !((value.charCodeAt(0) === 46)) || value.charCodeAt(1) < 48 || 57 < value.charCodeAt(1)) { - break; - } - i = 0; - while (true) { - if (!(i < 9 && (i + 1 >> 0) < value.length && 48 <= value.charCodeAt((i + 1 >> 0)) && value.charCodeAt((i + 1 >> 0)) <= 57)) { break; } - i = i + (1) >> 0; - } - _tuple$22 = parseNanoseconds(value, 1 + i >> 0); - nsec = _tuple$22[0]; - rangeErrString = _tuple$22[1]; - err = _tuple$22[2]; - value = value.substring((1 + i >> 0)); - } - } - if (!(rangeErrString === "")) { - return [new Time.ptr(new $Int64(0, 0), 0, ptrType$1.nil), new ParseError.ptr(alayout, avalue, stdstr, value, ": " + rangeErrString + " out of range")]; - } - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [new Time.ptr(new $Int64(0, 0), 0, ptrType$1.nil), new ParseError.ptr(alayout, avalue, stdstr, value, "")]; - } - } - if (pmSet && hour < 12) { - hour = hour + (12) >> 0; - } else if (amSet && (hour === 12)) { - hour = 0; - } - if (day > daysIn((month >> 0), year)) { - return [new Time.ptr(new $Int64(0, 0), 0, ptrType$1.nil), new ParseError.ptr(alayout, avalue, "", value, ": day out of range")]; - } - /* */ if (!(z === ptrType$1.nil)) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!(z === ptrType$1.nil)) { */ case 1: - _r$1 = Date(year, (month >> 0), day, hour, min, sec, nsec, z); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return [_r$1, $ifaceNil]; - /* } */ case 2: - /* */ if (!((zoneOffset === -1))) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (!((zoneOffset === -1))) { */ case 5: - _r$2 = Date(year, (month >> 0), day, hour, min, sec, nsec, $pkg.UTC); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - t = $clone(_r$2, Time); - t.sec = (x = t.sec, x$1 = new $Int64(0, zoneOffset), new $Int64(x.$high - x$1.$high, x.$low - x$1.$low)); - _r$3 = local.lookup((x$2 = t.sec, new $Int64(x$2.$high + -15, x$2.$low + 2288912640))); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _tuple$23 = _r$3; - name = _tuple$23[0]; - offset = _tuple$23[1]; - if ((offset === zoneOffset) && (zoneName === "" || name === zoneName)) { - t.loc = local; - return [t, $ifaceNil]; - } - t.loc = FixedZone(zoneName, zoneOffset); - return [t, $ifaceNil]; - /* } */ case 6: - /* */ if (!(zoneName === "")) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (!(zoneName === "")) { */ case 9: - _r$4 = Date(year, (month >> 0), day, hour, min, sec, nsec, $pkg.UTC); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - t$1 = $clone(_r$4, Time); - _r$5 = local.lookupName(zoneName, (x$3 = t$1.sec, new $Int64(x$3.$high + -15, x$3.$low + 2288912640))); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _tuple$24 = _r$5; - offset$1 = _tuple$24[0]; - ok$1 = _tuple$24[2]; - if (ok$1) { - t$1.sec = (x$4 = t$1.sec, x$5 = new $Int64(0, offset$1), new $Int64(x$4.$high - x$5.$high, x$4.$low - x$5.$low)); - t$1.loc = local; - return [t$1, $ifaceNil]; - } - if (zoneName.length > 3 && zoneName.substring(0, 3) === "GMT") { - _tuple$25 = atoi(zoneName.substring(3)); - offset$1 = _tuple$25[0]; - offset$1 = $imul(offset$1, (3600)); - } - t$1.loc = FixedZone(zoneName, offset$1); - return [t$1, $ifaceNil]; - /* } */ case 10: - _r$6 = Date(year, (month >> 0), day, hour, min, sec, nsec, defaultLocation); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - /* */ $s = 14; case 14: - return [_r$6, $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: parse }; } $f.$ptr = $ptr; $f._3 = _3; $f._4 = _4; $f._5 = _5; $f._6 = _6; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$10 = _tmp$10; $f._tmp$11 = _tmp$11; $f._tmp$12 = _tmp$12; $f._tmp$13 = _tmp$13; $f._tmp$14 = _tmp$14; $f._tmp$15 = _tmp$15; $f._tmp$16 = _tmp$16; $f._tmp$17 = _tmp$17; $f._tmp$18 = _tmp$18; $f._tmp$19 = _tmp$19; $f._tmp$2 = _tmp$2; $f._tmp$20 = _tmp$20; $f._tmp$21 = _tmp$21; $f._tmp$22 = _tmp$22; $f._tmp$23 = _tmp$23; $f._tmp$24 = _tmp$24; $f._tmp$25 = _tmp$25; $f._tmp$26 = _tmp$26; $f._tmp$27 = _tmp$27; $f._tmp$28 = _tmp$28; $f._tmp$29 = _tmp$29; $f._tmp$3 = _tmp$3; $f._tmp$30 = _tmp$30; $f._tmp$31 = _tmp$31; $f._tmp$32 = _tmp$32; $f._tmp$33 = _tmp$33; $f._tmp$34 = _tmp$34; $f._tmp$35 = _tmp$35; $f._tmp$36 = _tmp$36; $f._tmp$37 = _tmp$37; $f._tmp$38 = _tmp$38; $f._tmp$39 = _tmp$39; $f._tmp$4 = _tmp$4; $f._tmp$40 = _tmp$40; $f._tmp$41 = _tmp$41; $f._tmp$42 = _tmp$42; $f._tmp$43 = _tmp$43; $f._tmp$5 = _tmp$5; $f._tmp$6 = _tmp$6; $f._tmp$7 = _tmp$7; $f._tmp$8 = _tmp$8; $f._tmp$9 = _tmp$9; $f._tuple$1 = _tuple$1; $f._tuple$10 = _tuple$10; $f._tuple$11 = _tuple$11; $f._tuple$12 = _tuple$12; $f._tuple$13 = _tuple$13; $f._tuple$14 = _tuple$14; $f._tuple$15 = _tuple$15; $f._tuple$16 = _tuple$16; $f._tuple$17 = _tuple$17; $f._tuple$18 = _tuple$18; $f._tuple$19 = _tuple$19; $f._tuple$2 = _tuple$2; $f._tuple$20 = _tuple$20; $f._tuple$21 = _tuple$21; $f._tuple$22 = _tuple$22; $f._tuple$23 = _tuple$23; $f._tuple$24 = _tuple$24; $f._tuple$25 = _tuple$25; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f._tuple$8 = _tuple$8; $f._tuple$9 = _tuple$9; $f.alayout = alayout; $f.amSet = amSet; $f.avalue = avalue; $f.day = day; $f.defaultLocation = defaultLocation; $f.err = err; $f.hour = hour; $f.hour$1 = hour$1; $f.hr = hr; $f.i = i; $f.layout = layout; $f.local = local; $f.min = min; $f.min$1 = min$1; $f.mm = mm; $f.month = month; $f.n = n; $f.n$1 = n$1; $f.name = name; $f.ndigit = ndigit; $f.nsec = nsec; $f.offset = offset; $f.offset$1 = offset$1; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.pmSet = pmSet; $f.prefix = prefix; $f.rangeErrString = rangeErrString; $f.sec = sec; $f.seconds = seconds; $f.sign = sign; $f.ss = ss; $f.std = std; $f.stdstr = stdstr; $f.suffix = suffix; $f.t = t; $f.t$1 = t$1; $f.value = value; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.year = year; $f.z = z; $f.zoneName = zoneName; $f.zoneOffset = zoneOffset; $f.$s = $s; $f.$r = $r; return $f; - }; - parseTimeZone = function(value) { - var $ptr, _7, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, c, length, nUpper, ok, value; - length = 0; - ok = false; - if (value.length < 3) { - _tmp = 0; - _tmp$1 = false; - length = _tmp; - ok = _tmp$1; - return [length, ok]; - } - if (value.length >= 4 && (value.substring(0, 4) === "ChST" || value.substring(0, 4) === "MeST")) { - _tmp$2 = 4; - _tmp$3 = true; - length = _tmp$2; - ok = _tmp$3; - return [length, ok]; - } - if (value.substring(0, 3) === "GMT") { - length = parseGMT(value); - _tmp$4 = length; - _tmp$5 = true; - length = _tmp$4; - ok = _tmp$5; - return [length, ok]; - } - nUpper = 0; - nUpper = 0; - while (true) { - if (!(nUpper < 6)) { break; } - if (nUpper >= value.length) { - break; - } - c = value.charCodeAt(nUpper); - if (c < 65 || 90 < c) { - break; - } - nUpper = nUpper + (1) >> 0; - } - _7 = nUpper; - if ((_7 === (0)) || (_7 === (1)) || (_7 === (2)) || (_7 === (6))) { - _tmp$6 = 0; - _tmp$7 = false; - length = _tmp$6; - ok = _tmp$7; - return [length, ok]; - } else if (_7 === (5)) { - if (value.charCodeAt(4) === 84) { - _tmp$8 = 5; - _tmp$9 = true; - length = _tmp$8; - ok = _tmp$9; - return [length, ok]; - } - } else if (_7 === (4)) { - if (value.charCodeAt(3) === 84) { - _tmp$10 = 4; - _tmp$11 = true; - length = _tmp$10; - ok = _tmp$11; - return [length, ok]; - } - } else if (_7 === (3)) { - _tmp$12 = 3; - _tmp$13 = true; - length = _tmp$12; - ok = _tmp$13; - return [length, ok]; - } - _tmp$14 = 0; - _tmp$15 = false; - length = _tmp$14; - ok = _tmp$15; - return [length, ok]; - }; - parseGMT = function(value) { - var $ptr, _tuple$1, err, rem, sign, value, x; - value = value.substring(3); - if (value.length === 0) { - return 3; - } - sign = value.charCodeAt(0); - if (!((sign === 45)) && !((sign === 43))) { - return 3; - } - _tuple$1 = leadingInt(value.substring(1)); - x = _tuple$1[0]; - rem = _tuple$1[1]; - err = _tuple$1[2]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return 3; - } - if (sign === 45) { - x = new $Int64(-x.$high, -x.$low); - } - if ((x.$high === 0 && x.$low === 0) || (x.$high < -1 || (x.$high === -1 && x.$low < 4294967282)) || (0 < x.$high || (0 === x.$high && 12 < x.$low))) { - return 3; - } - return (3 + value.length >> 0) - rem.length >> 0; - }; - parseNanoseconds = function(value, nbytes) { - var $ptr, _tuple$1, err, i, nbytes, ns, rangeErrString, scaleDigits, value; - ns = 0; - rangeErrString = ""; - err = $ifaceNil; - if (!((value.charCodeAt(0) === 46))) { - err = errBad; - return [ns, rangeErrString, err]; - } - _tuple$1 = atoi(value.substring(1, nbytes)); - ns = _tuple$1[0]; - err = _tuple$1[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [ns, rangeErrString, err]; - } - if (ns < 0 || 1000000000 <= ns) { - rangeErrString = "fractional second"; - return [ns, rangeErrString, err]; - } - scaleDigits = 10 - nbytes >> 0; - i = 0; - while (true) { - if (!(i < scaleDigits)) { break; } - ns = $imul(ns, (10)); - i = i + (1) >> 0; - } - return [ns, rangeErrString, err]; - }; - leadingInt = function(s) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, c, err, i, rem, s, x, x$1, x$2, x$3; - x = new $Int64(0, 0); - rem = ""; - err = $ifaceNil; - i = 0; - while (true) { - if (!(i < s.length)) { break; } - c = s.charCodeAt(i); - if (c < 48 || c > 57) { - break; - } - if ((x.$high > 214748364 || (x.$high === 214748364 && x.$low > 3435973836))) { - _tmp = new $Int64(0, 0); - _tmp$1 = ""; - _tmp$2 = errLeadingInt; - x = _tmp; - rem = _tmp$1; - err = _tmp$2; - return [x, rem, err]; - } - x = (x$1 = (x$2 = $mul64(x, new $Int64(0, 10)), x$3 = new $Int64(0, c), new $Int64(x$2.$high + x$3.$high, x$2.$low + x$3.$low)), new $Int64(x$1.$high - 0, x$1.$low - 48)); - if ((x.$high < 0 || (x.$high === 0 && x.$low < 0))) { - _tmp$3 = new $Int64(0, 0); - _tmp$4 = ""; - _tmp$5 = errLeadingInt; - x = _tmp$3; - rem = _tmp$4; - err = _tmp$5; - return [x, rem, err]; - } - i = i + (1) >> 0; - } - _tmp$6 = x; - _tmp$7 = s.substring(i); - _tmp$8 = $ifaceNil; - x = _tmp$6; - rem = _tmp$7; - err = _tmp$8; - return [x, rem, err]; - }; - ParseDuration = function(s) { - var $ptr, _entry, _tmp, _tmp$1, _tuple$1, _tuple$2, _tuple$3, c, c$1, d, err, f, i, n, neg, ok, orig, pl, pl$1, post, pre, s, scale, u, unit, v, x, x$1, x$2; - orig = s; - d = new $Int64(0, 0); - neg = false; - if (!(s === "")) { - c = s.charCodeAt(0); - if ((c === 45) || (c === 43)) { - neg = c === 45; - s = s.substring(1); - } - } - if (s === "0") { - return [new Duration(0, 0), $ifaceNil]; - } - if (s === "") { - return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; - } - while (true) { - if (!(!(s === ""))) { break; } - _tmp = new $Int64(0, 0); - _tmp$1 = new $Int64(0, 0); - v = _tmp; - f = _tmp$1; - scale = 1; - err = $ifaceNil; - if (!((s.charCodeAt(0) === 46) || 48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57)) { - return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; - } - pl = s.length; - _tuple$1 = leadingInt(s); - v = _tuple$1[0]; - s = _tuple$1[1]; - err = _tuple$1[2]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; - } - pre = !((pl === s.length)); - post = false; - if (!(s === "") && (s.charCodeAt(0) === 46)) { - s = s.substring(1); - pl$1 = s.length; - _tuple$2 = leadingInt(s); - f = _tuple$2[0]; - s = _tuple$2[1]; - err = _tuple$2[2]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; - } - n = pl$1 - s.length >> 0; - while (true) { - if (!(n > 0)) { break; } - scale = scale * (10); - n = n - (1) >> 0; - } - post = !((pl$1 === s.length)); - } - if (!pre && !post) { - return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; - } - i = 0; - while (true) { - if (!(i < s.length)) { break; } - c$1 = s.charCodeAt(i); - if ((c$1 === 46) || 48 <= c$1 && c$1 <= 57) { - break; - } - i = i + (1) >> 0; - } - if (i === 0) { - return [new Duration(0, 0), errors.New("time: missing unit in duration " + orig)]; - } - u = s.substring(0, i); - s = s.substring(i); - _tuple$3 = (_entry = unitMap[$String.keyFor(u)], _entry !== undefined ? [_entry.v, true] : [new $Int64(0, 0), false]); - unit = _tuple$3[0]; - ok = _tuple$3[1]; - if (!ok) { - return [new Duration(0, 0), errors.New("time: unknown unit " + u + " in duration " + orig)]; - } - if ((x = $div64(new $Int64(2147483647, 4294967295), unit, false), (v.$high > x.$high || (v.$high === x.$high && v.$low > x.$low)))) { - return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; - } - v = $mul64(v, (unit)); - if ((f.$high > 0 || (f.$high === 0 && f.$low > 0))) { - v = (x$1 = new $Int64(0, $flatten64(f) * ($flatten64(unit) / scale)), new $Int64(v.$high + x$1.$high, v.$low + x$1.$low)); - if ((v.$high < 0 || (v.$high === 0 && v.$low < 0))) { - return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; - } - } - d = (x$2 = v, new $Int64(d.$high + x$2.$high, d.$low + x$2.$low)); - if ((d.$high < 0 || (d.$high === 0 && d.$low < 0))) { - return [new Duration(0, 0), errors.New("time: invalid duration " + orig)]; - } - } - if (neg) { - d = new $Int64(-d.$high, -d.$low); - } - return [new Duration(d.$high, d.$low), $ifaceNil]; - }; - $pkg.ParseDuration = ParseDuration; - Time.ptr.prototype.After = function(u) { - var $ptr, t, u, x, x$1, x$2, x$3; - u = $clone(u, Time); - t = $clone(this, Time); - return (x = t.sec, x$1 = u.sec, (x.$high > x$1.$high || (x.$high === x$1.$high && x.$low > x$1.$low))) || (x$2 = t.sec, x$3 = u.sec, (x$2.$high === x$3.$high && x$2.$low === x$3.$low)) && t.nsec > u.nsec; - }; - Time.prototype.After = function(u) { return this.$val.After(u); }; - Time.ptr.prototype.Before = function(u) { - var $ptr, t, u, x, x$1, x$2, x$3; - u = $clone(u, Time); - t = $clone(this, Time); - return (x = t.sec, x$1 = u.sec, (x.$high < x$1.$high || (x.$high === x$1.$high && x.$low < x$1.$low))) || (x$2 = t.sec, x$3 = u.sec, (x$2.$high === x$3.$high && x$2.$low === x$3.$low)) && t.nsec < u.nsec; - }; - Time.prototype.Before = function(u) { return this.$val.Before(u); }; - Time.ptr.prototype.Equal = function(u) { - var $ptr, t, u, x, x$1; - u = $clone(u, Time); - t = $clone(this, Time); - return (x = t.sec, x$1 = u.sec, (x.$high === x$1.$high && x.$low === x$1.$low)) && (t.nsec === u.nsec); - }; - Time.prototype.Equal = function(u) { return this.$val.Equal(u); }; - Month.prototype.String = function() { - var $ptr, m, x; - m = this.$val; - return (x = m - 1 >> 0, ((x < 0 || x >= months.length) ? $throwRuntimeError("index out of range") : months[x])); - }; - $ptrType(Month).prototype.String = function() { return new Month(this.$get()).String(); }; - Weekday.prototype.String = function() { - var $ptr, d; - d = this.$val; - return ((d < 0 || d >= days.length) ? $throwRuntimeError("index out of range") : days[d]); - }; - $ptrType(Weekday).prototype.String = function() { return new Weekday(this.$get()).String(); }; - Time.ptr.prototype.IsZero = function() { - var $ptr, t, x; - t = $clone(this, Time); - return (x = t.sec, (x.$high === 0 && x.$low === 0)) && (t.nsec === 0); - }; - Time.prototype.IsZero = function() { return this.$val.IsZero(); }; - Time.ptr.prototype.abs = function() { - var $ptr, _r$1, _r$2, _tuple$1, l, offset, sec, t, x, x$1, x$2, x$3, x$4, x$5, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple$1 = $f._tuple$1; l = $f.l; offset = $f.offset; sec = $f.sec; t = $f.t; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - l = t.loc; - /* */ if (l === ptrType$1.nil || l === localLoc) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (l === ptrType$1.nil || l === localLoc) { */ case 1: - _r$1 = l.get(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - l = _r$1; - /* } */ case 2: - sec = (x = t.sec, new $Int64(x.$high + -15, x.$low + 2288912640)); - /* */ if (!(l === utcLoc)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (!(l === utcLoc)) { */ case 4: - /* */ if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { */ case 6: - sec = (x$3 = new $Int64(0, l.cacheZone.offset), new $Int64(sec.$high + x$3.$high, sec.$low + x$3.$low)); - $s = 8; continue; - /* } else { */ case 7: - _r$2 = l.lookup(sec); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$1 = _r$2; - offset = _tuple$1[1]; - sec = (x$4 = new $Int64(0, offset), new $Int64(sec.$high + x$4.$high, sec.$low + x$4.$low)); - /* } */ case 8: - /* } */ case 5: - return (x$5 = new $Int64(sec.$high + 2147483646, sec.$low + 450480384), new $Uint64(x$5.$high, x$5.$low)); - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.abs }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple$1 = _tuple$1; $f.l = l; $f.offset = offset; $f.sec = sec; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.abs = function() { return this.$val.abs(); }; - Time.ptr.prototype.locabs = function() { - var $ptr, _r$1, _r$2, _tuple$1, abs, l, name, offset, sec, t, x, x$1, x$2, x$3, x$4, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple$1 = $f._tuple$1; abs = $f.abs; l = $f.l; name = $f.name; offset = $f.offset; sec = $f.sec; t = $f.t; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - name = ""; - offset = 0; - abs = new $Uint64(0, 0); - t = $clone(this, Time); - l = t.loc; - /* */ if (l === ptrType$1.nil || l === localLoc) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (l === ptrType$1.nil || l === localLoc) { */ case 1: - _r$1 = l.get(); /* */ $s = 3; case 3: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - l = _r$1; - /* } */ case 2: - sec = (x = t.sec, new $Int64(x.$high + -15, x.$low + 2288912640)); - /* */ if (!(l === utcLoc)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (!(l === utcLoc)) { */ case 4: - /* */ if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (!(l.cacheZone === ptrType.nil) && (x$1 = l.cacheStart, (x$1.$high < sec.$high || (x$1.$high === sec.$high && x$1.$low <= sec.$low))) && (x$2 = l.cacheEnd, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { */ case 7: - name = l.cacheZone.name; - offset = l.cacheZone.offset; - $s = 9; continue; - /* } else { */ case 8: - _r$2 = l.lookup(sec); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$1 = _r$2; - name = _tuple$1[0]; - offset = _tuple$1[1]; - /* } */ case 9: - sec = (x$3 = new $Int64(0, offset), new $Int64(sec.$high + x$3.$high, sec.$low + x$3.$low)); - $s = 6; continue; - /* } else { */ case 5: - name = "UTC"; - /* } */ case 6: - abs = (x$4 = new $Int64(sec.$high + 2147483646, sec.$low + 450480384), new $Uint64(x$4.$high, x$4.$low)); - return [name, offset, abs]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.locabs }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple$1 = _tuple$1; $f.abs = abs; $f.l = l; $f.name = name; $f.offset = offset; $f.sec = sec; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.locabs = function() { return this.$val.locabs(); }; - Time.ptr.prototype.Date = function() { - var $ptr, _r$1, _tuple$1, day, month, t, year, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; day = $f.day; month = $f.month; t = $f.t; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - year = 0; - month = 0; - day = 0; - t = $clone(this, Time); - _r$1 = t.date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - year = _tuple$1[0]; - month = _tuple$1[1]; - day = _tuple$1[2]; - return [year, month, day]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Date }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.day = day; $f.month = month; $f.t = t; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Date = function() { return this.$val.Date(); }; - Time.ptr.prototype.Year = function() { - var $ptr, _r$1, _tuple$1, t, year, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; t = $f.t; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.date(false); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - year = _tuple$1[0]; - return year; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Year }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.t = t; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Year = function() { return this.$val.Year(); }; - Time.ptr.prototype.Month = function() { - var $ptr, _r$1, _tuple$1, month, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; month = $f.month; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - month = _tuple$1[1]; - return month; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Month }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.month = month; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Month = function() { return this.$val.Month(); }; - Time.ptr.prototype.Day = function() { - var $ptr, _r$1, _tuple$1, day, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; day = $f.day; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - day = _tuple$1[2]; - return day; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Day }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.day = day; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Day = function() { return this.$val.Day(); }; - Time.ptr.prototype.Weekday = function() { - var $ptr, _r$1, _r$2, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = absWeekday(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ $s = 3; case 3: - return _r$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Weekday }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Weekday = function() { return this.$val.Weekday(); }; - absWeekday = function(abs) { - var $ptr, _q, abs, sec; - sec = $div64((new $Uint64(abs.$high + 0, abs.$low + 86400)), new $Uint64(0, 604800), true); - return ((_q = (sec.$low >> 0) / 86400, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0); - }; - Time.ptr.prototype.ISOWeek = function() { - var $ptr, _q, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple$1, day, dec31wday, jan1wday, month, t, wday, week, yday, year, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _tuple$1 = $f._tuple$1; day = $f.day; dec31wday = $f.dec31wday; jan1wday = $f.jan1wday; month = $f.month; t = $f.t; wday = $f.wday; week = $f.week; yday = $f.yday; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - year = 0; - week = 0; - t = $clone(this, Time); - _r$1 = t.date(true); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - year = _tuple$1[0]; - month = _tuple$1[1]; - day = _tuple$1[2]; - yday = _tuple$1[3]; - _r$3 = t.Weekday(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - wday = (_r$2 = ((_r$3 + 6 >> 0) >> 0) % 7, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")); - week = (_q = (((yday - wday >> 0) + 7 >> 0)) / 7, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - jan1wday = (_r$4 = (((wday - yday >> 0) + 371 >> 0)) % 7, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); - if (1 <= jan1wday && jan1wday <= 3) { - week = week + (1) >> 0; - } - if (week === 0) { - year = year - (1) >> 0; - week = 52; - if ((jan1wday === 4) || ((jan1wday === 5) && isLeap(year))) { - week = week + (1) >> 0; - } - } - if ((month === 12) && day >= 29 && wday < 3) { - dec31wday = (_r$5 = (((wday + 31 >> 0) - day >> 0)) % 7, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")); - if (0 <= dec31wday && dec31wday <= 2) { - year = year + (1) >> 0; - week = 1; - } - } - return [year, week]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.ISOWeek }; } $f.$ptr = $ptr; $f._q = _q; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._tuple$1 = _tuple$1; $f.day = day; $f.dec31wday = dec31wday; $f.jan1wday = jan1wday; $f.month = month; $f.t = t; $f.wday = wday; $f.week = week; $f.yday = yday; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.ISOWeek = function() { return this.$val.ISOWeek(); }; - Time.ptr.prototype.Clock = function() { - var $ptr, _r$1, _r$2, _tuple$1, hour, min, sec, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple$1 = $f._tuple$1; hour = $f.hour; min = $f.min; sec = $f.sec; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - hour = 0; - min = 0; - sec = 0; - t = $clone(this, Time); - _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = absClock(_r$1); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$1 = _r$2; - hour = _tuple$1[0]; - min = _tuple$1[1]; - sec = _tuple$1[2]; - /* */ $s = 3; case 3: - return [hour, min, sec]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Clock }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple$1 = _tuple$1; $f.hour = hour; $f.min = min; $f.sec = sec; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Clock = function() { return this.$val.Clock(); }; - absClock = function(abs) { - var $ptr, _q, _q$1, abs, hour, min, sec; - hour = 0; - min = 0; - sec = 0; - sec = ($div64(abs, new $Uint64(0, 86400), true).$low >> 0); - hour = (_q = sec / 3600, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - sec = sec - (($imul(hour, 3600))) >> 0; - min = (_q$1 = sec / 60, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); - sec = sec - (($imul(min, 60))) >> 0; - return [hour, min, sec]; - }; - Time.ptr.prototype.Hour = function() { - var $ptr, _q, _r$1, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return (_q = ($div64(_r$1, new $Uint64(0, 86400), true).$low >> 0) / 3600, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Hour }; } $f.$ptr = $ptr; $f._q = _q; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Hour = function() { return this.$val.Hour(); }; - Time.ptr.prototype.Minute = function() { - var $ptr, _q, _r$1, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return (_q = ($div64(_r$1, new $Uint64(0, 3600), true).$low >> 0) / 60, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Minute }; } $f.$ptr = $ptr; $f._q = _q; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Minute = function() { return this.$val.Minute(); }; - Time.ptr.prototype.Second = function() { - var $ptr, _r$1, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return ($div64(_r$1, new $Uint64(0, 60), true).$low >> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Second }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Second = function() { return this.$val.Second(); }; - Time.ptr.prototype.Nanosecond = function() { - var $ptr, t; - t = $clone(this, Time); - return (t.nsec >> 0); - }; - Time.prototype.Nanosecond = function() { return this.$val.Nanosecond(); }; - Time.ptr.prototype.YearDay = function() { - var $ptr, _r$1, _tuple$1, t, yday, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; t = $f.t; yday = $f.yday; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.date(false); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - yday = _tuple$1[3]; - return yday + 1 >> 0; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.YearDay }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.t = t; $f.yday = yday; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.YearDay = function() { return this.$val.YearDay(); }; - Duration.prototype.String = function() { - var $ptr, _tuple$1, _tuple$2, buf, d, neg, prec, u, w; - d = this; - buf = arrayType$4.zero(); - w = 32; - u = new $Uint64(d.$high, d.$low); - neg = (d.$high < 0 || (d.$high === 0 && d.$low < 0)); - if (neg) { - u = new $Uint64(-u.$high, -u.$low); - } - if ((u.$high < 0 || (u.$high === 0 && u.$low < 1000000000))) { - prec = 0; - w = w - (1) >> 0; - ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 115); - w = w - (1) >> 0; - if ((u.$high === 0 && u.$low === 0)) { - return "0"; - } else if ((u.$high < 0 || (u.$high === 0 && u.$low < 1000))) { - prec = 0; - ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 110); - } else if ((u.$high < 0 || (u.$high === 0 && u.$low < 1000000))) { - prec = 3; - w = w - (1) >> 0; - $copyString($subslice(new sliceType$3(buf), w), "\xC2\xB5"); - } else { - prec = 6; - ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 109); - } - _tuple$1 = fmtFrac($subslice(new sliceType$3(buf), 0, w), u, prec); - w = _tuple$1[0]; - u = _tuple$1[1]; - w = fmtInt($subslice(new sliceType$3(buf), 0, w), u); - } else { - w = w - (1) >> 0; - ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 115); - _tuple$2 = fmtFrac($subslice(new sliceType$3(buf), 0, w), u, 9); - w = _tuple$2[0]; - u = _tuple$2[1]; - w = fmtInt($subslice(new sliceType$3(buf), 0, w), $div64(u, new $Uint64(0, 60), true)); - u = $div64(u, (new $Uint64(0, 60)), false); - if ((u.$high > 0 || (u.$high === 0 && u.$low > 0))) { - w = w - (1) >> 0; - ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 109); - w = fmtInt($subslice(new sliceType$3(buf), 0, w), $div64(u, new $Uint64(0, 60), true)); - u = $div64(u, (new $Uint64(0, 60)), false); - if ((u.$high > 0 || (u.$high === 0 && u.$low > 0))) { - w = w - (1) >> 0; - ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 104); - w = fmtInt($subslice(new sliceType$3(buf), 0, w), u); - } - } - } - if (neg) { - w = w - (1) >> 0; - ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 45); - } - return $bytesToString($subslice(new sliceType$3(buf), w)); - }; - $ptrType(Duration).prototype.String = function() { return this.$get().String(); }; - fmtFrac = function(buf, v, prec) { - var $ptr, _tmp, _tmp$1, buf, digit, i, nv, nw, prec, print, v, w; - nw = 0; - nv = new $Uint64(0, 0); - w = buf.$length; - print = false; - i = 0; - while (true) { - if (!(i < prec)) { break; } - digit = $div64(v, new $Uint64(0, 10), true); - print = print || !((digit.$high === 0 && digit.$low === 0)); - if (print) { - w = w - (1) >> 0; - ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = ((digit.$low << 24 >>> 24) + 48 << 24 >>> 24)); - } - v = $div64(v, (new $Uint64(0, 10)), false); - i = i + (1) >> 0; - } - if (print) { - w = w - (1) >> 0; - ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = 46); - } - _tmp = w; - _tmp$1 = v; - nw = _tmp; - nv = _tmp$1; - return [nw, nv]; - }; - fmtInt = function(buf, v) { - var $ptr, buf, v, w; - w = buf.$length; - if ((v.$high === 0 && v.$low === 0)) { - w = w - (1) >> 0; - ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = 48); - } else { - while (true) { - if (!((v.$high > 0 || (v.$high === 0 && v.$low > 0)))) { break; } - w = w - (1) >> 0; - ((w < 0 || w >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + w] = (($div64(v, new $Uint64(0, 10), true).$low << 24 >>> 24) + 48 << 24 >>> 24)); - v = $div64(v, (new $Uint64(0, 10)), false); - } - } - return w; - }; - Duration.prototype.Nanoseconds = function() { - var $ptr, d; - d = this; - return new $Int64(d.$high, d.$low); - }; - $ptrType(Duration).prototype.Nanoseconds = function() { return this.$get().Nanoseconds(); }; - Duration.prototype.Seconds = function() { - var $ptr, d, nsec, sec; - d = this; - sec = $div64(d, new Duration(0, 1000000000), false); - nsec = $div64(d, new Duration(0, 1000000000), true); - return $flatten64(sec) + $flatten64(nsec) * 1e-09; - }; - $ptrType(Duration).prototype.Seconds = function() { return this.$get().Seconds(); }; - Duration.prototype.Minutes = function() { - var $ptr, d, min, nsec; - d = this; - min = $div64(d, new Duration(13, 4165425152), false); - nsec = $div64(d, new Duration(13, 4165425152), true); - return $flatten64(min) + $flatten64(nsec) * 1.6666666666666667e-11; - }; - $ptrType(Duration).prototype.Minutes = function() { return this.$get().Minutes(); }; - Duration.prototype.Hours = function() { - var $ptr, d, hour, nsec; - d = this; - hour = $div64(d, new Duration(838, 817405952), false); - nsec = $div64(d, new Duration(838, 817405952), true); - return $flatten64(hour) + $flatten64(nsec) * 2.777777777777778e-13; - }; - $ptrType(Duration).prototype.Hours = function() { return this.$get().Hours(); }; - Time.ptr.prototype.Add = function(d) { - var $ptr, d, nsec, t, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7; - t = $clone(this, Time); - t.sec = (x = t.sec, x$1 = (x$2 = $div64(d, new Duration(0, 1000000000), false), new $Int64(x$2.$high, x$2.$low)), new $Int64(x.$high + x$1.$high, x.$low + x$1.$low)); - nsec = t.nsec + ((x$3 = $div64(d, new Duration(0, 1000000000), true), x$3.$low + ((x$3.$high >> 31) * 4294967296)) >> 0) >> 0; - if (nsec >= 1000000000) { - t.sec = (x$4 = t.sec, x$5 = new $Int64(0, 1), new $Int64(x$4.$high + x$5.$high, x$4.$low + x$5.$low)); - nsec = nsec - (1000000000) >> 0; - } else if (nsec < 0) { - t.sec = (x$6 = t.sec, x$7 = new $Int64(0, 1), new $Int64(x$6.$high - x$7.$high, x$6.$low - x$7.$low)); - nsec = nsec + (1000000000) >> 0; - } - t.nsec = nsec; - return t; - }; - Time.prototype.Add = function(d) { return this.$val.Add(d); }; - Time.ptr.prototype.Sub = function(u) { - var $ptr, d, t, u, x, x$1, x$2, x$3, x$4; - u = $clone(u, Time); - t = $clone(this, Time); - d = (x = $mul64((x$1 = (x$2 = t.sec, x$3 = u.sec, new $Int64(x$2.$high - x$3.$high, x$2.$low - x$3.$low)), new Duration(x$1.$high, x$1.$low)), new Duration(0, 1000000000)), x$4 = new Duration(0, (t.nsec - u.nsec >> 0)), new Duration(x.$high + x$4.$high, x.$low + x$4.$low)); - if (u.Add(d).Equal(t)) { - return d; - } else if (t.Before(u)) { - return new Duration(-2147483648, 0); - } else { - return new Duration(2147483647, 4294967295); - } - }; - Time.prototype.Sub = function(u) { return this.$val.Sub(u); }; - Time.ptr.prototype.AddDate = function(years, months$1, days$1) { - var $ptr, _r$1, _r$2, _r$3, _tuple$1, _tuple$2, day, days$1, hour, min, month, months$1, sec, t, year, years, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; day = $f.day; days$1 = $f.days$1; hour = $f.hour; min = $f.min; month = $f.month; months$1 = $f.months$1; sec = $f.sec; t = $f.t; year = $f.year; years = $f.years; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.Date(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - year = _tuple$1[0]; - month = _tuple$1[1]; - day = _tuple$1[2]; - _r$2 = t.Clock(); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$2 = _r$2; - hour = _tuple$2[0]; - min = _tuple$2[1]; - sec = _tuple$2[2]; - _r$3 = Date(year + years >> 0, month + (months$1 >> 0) >> 0, day + days$1 >> 0, hour, min, sec, (t.nsec >> 0), t.loc); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return _r$3; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.AddDate }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.day = day; $f.days$1 = days$1; $f.hour = hour; $f.min = min; $f.month = month; $f.months$1 = months$1; $f.sec = sec; $f.t = t; $f.year = year; $f.years = years; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.AddDate = function(years, months$1, days$1) { return this.$val.AddDate(years, months$1, days$1); }; - Time.ptr.prototype.date = function(full) { - var $ptr, _r$1, _r$2, _tuple$1, day, full, month, t, yday, year, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple$1 = $f._tuple$1; day = $f.day; full = $f.full; month = $f.month; t = $f.t; yday = $f.yday; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - year = 0; - month = 0; - day = 0; - yday = 0; - t = $clone(this, Time); - _r$1 = t.abs(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = absDate(_r$1, full); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$1 = _r$2; - year = _tuple$1[0]; - month = _tuple$1[1]; - day = _tuple$1[2]; - yday = _tuple$1[3]; - /* */ $s = 3; case 3: - return [year, month, day, yday]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.date }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple$1 = _tuple$1; $f.day = day; $f.full = full; $f.month = month; $f.t = t; $f.yday = yday; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.date = function(full) { return this.$val.date(full); }; - absDate = function(abs, full) { - var $ptr, _q, abs, begin, d, day, end, full, month, n, x, x$1, x$10, x$11, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, yday, year; - year = 0; - month = 0; - day = 0; - yday = 0; - d = $div64(abs, new $Uint64(0, 86400), false); - n = $div64(d, new $Uint64(0, 146097), false); - y = $mul64(new $Uint64(0, 400), n); - d = (x = $mul64(new $Uint64(0, 146097), n), new $Uint64(d.$high - x.$high, d.$low - x.$low)); - n = $div64(d, new $Uint64(0, 36524), false); - n = (x$1 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$1.$high, n.$low - x$1.$low)); - y = (x$2 = $mul64(new $Uint64(0, 100), n), new $Uint64(y.$high + x$2.$high, y.$low + x$2.$low)); - d = (x$3 = $mul64(new $Uint64(0, 36524), n), new $Uint64(d.$high - x$3.$high, d.$low - x$3.$low)); - n = $div64(d, new $Uint64(0, 1461), false); - y = (x$4 = $mul64(new $Uint64(0, 4), n), new $Uint64(y.$high + x$4.$high, y.$low + x$4.$low)); - d = (x$5 = $mul64(new $Uint64(0, 1461), n), new $Uint64(d.$high - x$5.$high, d.$low - x$5.$low)); - n = $div64(d, new $Uint64(0, 365), false); - n = (x$6 = $shiftRightUint64(n, 2), new $Uint64(n.$high - x$6.$high, n.$low - x$6.$low)); - y = (x$7 = n, new $Uint64(y.$high + x$7.$high, y.$low + x$7.$low)); - d = (x$8 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high - x$8.$high, d.$low - x$8.$low)); - year = ((x$9 = (x$10 = new $Int64(y.$high, y.$low), new $Int64(x$10.$high + -69, x$10.$low + 4075721025)), x$9.$low + ((x$9.$high >> 31) * 4294967296)) >> 0); - yday = (d.$low >> 0); - if (!full) { - return [year, month, day, yday]; - } - day = yday; - if (isLeap(year)) { - if (day > 59) { - day = day - (1) >> 0; - } else if ((day === 59)) { - month = 2; - day = 29; - return [year, month, day, yday]; - } - } - month = ((_q = day / 31, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0); - end = ((x$11 = month + 1 >> 0, ((x$11 < 0 || x$11 >= daysBefore.length) ? $throwRuntimeError("index out of range") : daysBefore[x$11])) >> 0); - begin = 0; - if (day >= end) { - month = month + (1) >> 0; - begin = end; - } else { - begin = (((month < 0 || month >= daysBefore.length) ? $throwRuntimeError("index out of range") : daysBefore[month]) >> 0); - } - month = month + (1) >> 0; - day = (day - begin >> 0) + 1 >> 0; - return [year, month, day, yday]; - }; - daysIn = function(m, year) { - var $ptr, m, x, year; - if ((m === 2) && isLeap(year)) { - return 29; - } - return ((((m < 0 || m >= daysBefore.length) ? $throwRuntimeError("index out of range") : daysBefore[m]) - (x = m - 1 >> 0, ((x < 0 || x >= daysBefore.length) ? $throwRuntimeError("index out of range") : daysBefore[x])) >> 0) >> 0); - }; - Time.ptr.prototype.UTC = function() { - var $ptr, t; - t = $clone(this, Time); - t.loc = $pkg.UTC; - return t; - }; - Time.prototype.UTC = function() { return this.$val.UTC(); }; - Time.ptr.prototype.Local = function() { - var $ptr, t; - t = $clone(this, Time); - t.loc = $pkg.Local; - return t; - }; - Time.prototype.Local = function() { return this.$val.Local(); }; - Time.ptr.prototype.In = function(loc) { - var $ptr, loc, t; - t = $clone(this, Time); - if (loc === ptrType$1.nil) { - $panic(new $String("time: missing Location in call to Time.In")); - } - t.loc = loc; - return t; - }; - Time.prototype.In = function(loc) { return this.$val.In(loc); }; - Time.ptr.prototype.Location = function() { - var $ptr, l, t; - t = $clone(this, Time); - l = t.loc; - if (l === ptrType$1.nil) { - l = $pkg.UTC; - } - return l; - }; - Time.prototype.Location = function() { return this.$val.Location(); }; - Time.ptr.prototype.Zone = function() { - var $ptr, _r$1, _tuple$1, name, offset, t, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; name = $f.name; offset = $f.offset; t = $f.t; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - name = ""; - offset = 0; - t = $clone(this, Time); - _r$1 = t.loc.lookup((x = t.sec, new $Int64(x.$high + -15, x.$low + 2288912640))); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - name = _tuple$1[0]; - offset = _tuple$1[1]; - return [name, offset]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.Zone }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.name = name; $f.offset = offset; $f.t = t; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.Zone = function() { return this.$val.Zone(); }; - Time.ptr.prototype.Unix = function() { - var $ptr, t, x; - t = $clone(this, Time); - return (x = t.sec, new $Int64(x.$high + -15, x.$low + 2288912640)); - }; - Time.prototype.Unix = function() { return this.$val.Unix(); }; - Time.ptr.prototype.UnixNano = function() { - var $ptr, t, x, x$1, x$2; - t = $clone(this, Time); - return (x = $mul64(((x$1 = t.sec, new $Int64(x$1.$high + -15, x$1.$low + 2288912640))), new $Int64(0, 1000000000)), x$2 = new $Int64(0, t.nsec), new $Int64(x.$high + x$2.$high, x.$low + x$2.$low)); - }; - Time.prototype.UnixNano = function() { return this.$val.UnixNano(); }; - Time.ptr.prototype.MarshalBinary = function() { - var $ptr, _q, _r$1, _r$2, _tuple$1, enc, offset, offsetMin, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r$1 = $f._r$1; _r$2 = $f._r$2; _tuple$1 = $f._tuple$1; enc = $f.enc; offset = $f.offset; offsetMin = $f.offsetMin; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - offsetMin = 0; - /* */ if (t.Location() === utcLoc) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (t.Location() === utcLoc) { */ case 1: - offsetMin = -1; - $s = 3; continue; - /* } else { */ case 2: - _r$1 = t.Zone(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - offset = _tuple$1[1]; - if (!(((_r$2 = offset % 60, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0))) { - return [sliceType$3.nil, errors.New("Time.MarshalBinary: zone offset has fractional minute")]; - } - offset = (_q = offset / (60), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - if (offset < -32768 || (offset === -1) || offset > 32767) { - return [sliceType$3.nil, errors.New("Time.MarshalBinary: unexpected zone offset")]; - } - offsetMin = (offset << 16 >> 16); - /* } */ case 3: - enc = new sliceType$3([1, ($shiftRightInt64(t.sec, 56).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 48).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 40).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 32).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 24).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 16).$low << 24 >>> 24), ($shiftRightInt64(t.sec, 8).$low << 24 >>> 24), (t.sec.$low << 24 >>> 24), ((t.nsec >> 24 >> 0) << 24 >>> 24), ((t.nsec >> 16 >> 0) << 24 >>> 24), ((t.nsec >> 8 >> 0) << 24 >>> 24), (t.nsec << 24 >>> 24), ((offsetMin >> 8 << 16 >> 16) << 24 >>> 24), (offsetMin << 24 >>> 24)]); - return [enc, $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalBinary }; } $f.$ptr = $ptr; $f._q = _q; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tuple$1 = _tuple$1; $f.enc = enc; $f.offset = offset; $f.offsetMin = offsetMin; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.MarshalBinary = function() { return this.$val.MarshalBinary(); }; - Time.ptr.prototype.UnmarshalBinary = function(data$1) { - var $ptr, _r$1, _tuple$1, buf, data$1, localoff, offset, t, x, x$1, x$10, x$11, x$12, x$13, x$14, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; buf = $f.buf; data$1 = $f.data$1; localoff = $f.localoff; offset = $f.offset; t = $f.t; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$14 = $f.x$14; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - buf = data$1; - if (buf.$length === 0) { - return errors.New("Time.UnmarshalBinary: no data"); - } - if (!(((0 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 0]) === 1))) { - return errors.New("Time.UnmarshalBinary: unsupported version"); - } - if (!((buf.$length === 15))) { - return errors.New("Time.UnmarshalBinary: invalid length"); - } - buf = $subslice(buf, 1); - t.sec = (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = new $Int64(0, (7 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 7])), x$7 = $shiftLeft64(new $Int64(0, (6 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 6])), 8), new $Int64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$8 = $shiftLeft64(new $Int64(0, (5 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 5])), 16), new $Int64(x$5.$high | x$8.$high, (x$5.$low | x$8.$low) >>> 0)), x$9 = $shiftLeft64(new $Int64(0, (4 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 4])), 24), new $Int64(x$4.$high | x$9.$high, (x$4.$low | x$9.$low) >>> 0)), x$10 = $shiftLeft64(new $Int64(0, (3 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 3])), 32), new $Int64(x$3.$high | x$10.$high, (x$3.$low | x$10.$low) >>> 0)), x$11 = $shiftLeft64(new $Int64(0, (2 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 2])), 40), new $Int64(x$2.$high | x$11.$high, (x$2.$low | x$11.$low) >>> 0)), x$12 = $shiftLeft64(new $Int64(0, (1 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 1])), 48), new $Int64(x$1.$high | x$12.$high, (x$1.$low | x$12.$low) >>> 0)), x$13 = $shiftLeft64(new $Int64(0, (0 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 0])), 56), new $Int64(x.$high | x$13.$high, (x.$low | x$13.$low) >>> 0)); - buf = $subslice(buf, 8); - t.nsec = ((((3 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 3]) >> 0) | (((2 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 2]) >> 0) << 8 >> 0)) | (((1 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 1]) >> 0) << 16 >> 0)) | (((0 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 0]) >> 0) << 24 >> 0); - buf = $subslice(buf, 4); - offset = $imul(((((1 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 1]) << 16 >> 16) | (((0 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 0]) << 16 >> 16) << 8 << 16 >> 16)) >> 0), 60); - /* */ if (offset === -60) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (offset === -60) { */ case 1: - t.loc = utcLoc; - $s = 3; continue; - /* } else { */ case 2: - _r$1 = $pkg.Local.lookup((x$14 = t.sec, new $Int64(x$14.$high + -15, x$14.$low + 2288912640))); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - localoff = _tuple$1[1]; - if (offset === localoff) { - t.loc = $pkg.Local; - } else { - t.loc = FixedZone("", offset); - } - /* } */ case 3: - return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalBinary }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.buf = buf; $f.data$1 = data$1; $f.localoff = localoff; $f.offset = offset; $f.t = t; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$14 = x$14; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.UnmarshalBinary = function(data$1) { return this.$val.UnmarshalBinary(data$1); }; - Time.ptr.prototype.GobEncode = function() { - var $ptr, _r$1, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.MarshalBinary(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.GobEncode }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.GobEncode = function() { return this.$val.GobEncode(); }; - Time.ptr.prototype.GobDecode = function(data$1) { - var $ptr, _r$1, data$1, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; data$1 = $f.data$1; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = this; - _r$1 = t.UnmarshalBinary(data$1); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r$1; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.GobDecode }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.data$1 = data$1; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.GobDecode = function(data$1) { return this.$val.GobDecode(data$1); }; - Time.ptr.prototype.MarshalJSON = function() { - var $ptr, _r$1, _r$2, b, t, y, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; b = $f.b; t = $f.t; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - y = _r$1; - if (y < 0 || y >= 10000) { - return [sliceType$3.nil, errors.New("Time.MarshalJSON: year outside of range [0,9999]")]; - } - b = $makeSlice(sliceType$3, 0, 37); - b = $append(b, 34); - _r$2 = t.AppendFormat(b, "2006-01-02T15:04:05.999999999Z07:00"); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - b = _r$2; - b = $append(b, 34); - return [b, $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalJSON }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.b = b; $f.t = t; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.MarshalJSON = function() { return this.$val.MarshalJSON(); }; - Time.ptr.prototype.UnmarshalJSON = function(data$1) { - var $ptr, _r$1, _tuple$1, data$1, err, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; data$1 = $f.data$1; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - err = $ifaceNil; - t = this; - _r$1 = Parse("\"2006-01-02T15:04:05Z07:00\"", $bytesToString(data$1)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - Time.copy(t, _tuple$1[0]); - err = _tuple$1[1]; - return err; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalJSON }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.data$1 = data$1; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.UnmarshalJSON = function(data$1) { return this.$val.UnmarshalJSON(data$1); }; - Time.ptr.prototype.MarshalText = function() { - var $ptr, _r$1, _r$2, b, t, y, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; b = $f.b; t = $f.t; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - t = $clone(this, Time); - _r$1 = t.Year(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - y = _r$1; - if (y < 0 || y >= 10000) { - return [sliceType$3.nil, errors.New("Time.MarshalText: year outside of range [0,9999]")]; - } - b = $makeSlice(sliceType$3, 0, 35); - _r$2 = t.AppendFormat(b, "2006-01-02T15:04:05.999999999Z07:00"); /* */ $s = 2; case 2: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ $s = 3; case 3: - return [_r$2, $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.MarshalText }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.b = b; $f.t = t; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.MarshalText = function() { return this.$val.MarshalText(); }; - Time.ptr.prototype.UnmarshalText = function(data$1) { - var $ptr, _r$1, _tuple$1, data$1, err, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _tuple$1 = $f._tuple$1; data$1 = $f.data$1; err = $f.err; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - err = $ifaceNil; - t = this; - _r$1 = Parse("2006-01-02T15:04:05Z07:00", $bytesToString(data$1)); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - Time.copy(t, _tuple$1[0]); - err = _tuple$1[1]; - return err; - /* */ } return; } if ($f === undefined) { $f = { $blk: Time.ptr.prototype.UnmarshalText }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._tuple$1 = _tuple$1; $f.data$1 = data$1; $f.err = err; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - Time.prototype.UnmarshalText = function(data$1) { return this.$val.UnmarshalText(data$1); }; - Unix = function(sec, nsec) { - var $ptr, n, nsec, sec, x, x$1, x$2, x$3; - if ((nsec.$high < 0 || (nsec.$high === 0 && nsec.$low < 0)) || (nsec.$high > 0 || (nsec.$high === 0 && nsec.$low >= 1000000000))) { - n = $div64(nsec, new $Int64(0, 1000000000), false); - sec = (x = n, new $Int64(sec.$high + x.$high, sec.$low + x.$low)); - nsec = (x$1 = $mul64(n, new $Int64(0, 1000000000)), new $Int64(nsec.$high - x$1.$high, nsec.$low - x$1.$low)); - if ((nsec.$high < 0 || (nsec.$high === 0 && nsec.$low < 0))) { - nsec = (x$2 = new $Int64(0, 1000000000), new $Int64(nsec.$high + x$2.$high, nsec.$low + x$2.$low)); - sec = (x$3 = new $Int64(0, 1), new $Int64(sec.$high - x$3.$high, sec.$low - x$3.$low)); - } - } - return new Time.ptr(new $Int64(sec.$high + 14, sec.$low + 2006054656), ((nsec.$low + ((nsec.$high >> 31) * 4294967296)) >> 0), $pkg.Local); - }; - $pkg.Unix = Unix; - isLeap = function(year) { - var $ptr, _r$1, _r$2, _r$3, year; - return ((_r$1 = year % 4, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0) && (!(((_r$2 = year % 100, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0)) || ((_r$3 = year % 400, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")) === 0)); - }; - norm = function(hi, lo, base) { - var $ptr, _q, _q$1, _tmp, _tmp$1, base, hi, lo, n, n$1, nhi, nlo; - nhi = 0; - nlo = 0; - if (lo < 0) { - n = (_q = ((-lo - 1 >> 0)) / base, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) + 1 >> 0; - hi = hi - (n) >> 0; - lo = lo + (($imul(n, base))) >> 0; - } - if (lo >= base) { - n$1 = (_q$1 = lo / base, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); - hi = hi + (n$1) >> 0; - lo = lo - (($imul(n$1, base))) >> 0; - } - _tmp = hi; - _tmp$1 = lo; - nhi = _tmp; - nlo = _tmp$1; - return [nhi, nlo]; - }; - Date = function(year, month, day, hour, min, sec, nsec, loc) { - var $ptr, _r$1, _r$2, _r$3, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, _tuple$8, abs, d, day, end, hour, loc, m, min, month, n, nsec, offset, sec, start, unix, utc, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, year, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; _tuple$8 = $f._tuple$8; abs = $f.abs; d = $f.d; day = $f.day; end = $f.end; hour = $f.hour; loc = $f.loc; m = $f.m; min = $f.min; month = $f.month; n = $f.n; nsec = $f.nsec; offset = $f.offset; sec = $f.sec; start = $f.start; unix = $f.unix; utc = $f.utc; x = $f.x; x$1 = $f.x$1; x$10 = $f.x$10; x$11 = $f.x$11; x$12 = $f.x$12; x$13 = $f.x$13; x$14 = $f.x$14; x$15 = $f.x$15; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; x$9 = $f.x$9; y = $f.y; year = $f.year; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - if (loc === ptrType$1.nil) { - $panic(new $String("time: missing Location in call to Date")); - } - m = (month >> 0) - 1 >> 0; - _tuple$1 = norm(year, m, 12); - year = _tuple$1[0]; - m = _tuple$1[1]; - month = (m >> 0) + 1 >> 0; - _tuple$2 = norm(sec, nsec, 1000000000); - sec = _tuple$2[0]; - nsec = _tuple$2[1]; - _tuple$3 = norm(min, sec, 60); - min = _tuple$3[0]; - sec = _tuple$3[1]; - _tuple$4 = norm(hour, min, 60); - hour = _tuple$4[0]; - min = _tuple$4[1]; - _tuple$5 = norm(day, hour, 24); - day = _tuple$5[0]; - hour = _tuple$5[1]; - y = (x = (x$1 = new $Int64(0, year), new $Int64(x$1.$high - -69, x$1.$low - 4075721025)), new $Uint64(x.$high, x.$low)); - n = $div64(y, new $Uint64(0, 400), false); - y = (x$2 = $mul64(new $Uint64(0, 400), n), new $Uint64(y.$high - x$2.$high, y.$low - x$2.$low)); - d = $mul64(new $Uint64(0, 146097), n); - n = $div64(y, new $Uint64(0, 100), false); - y = (x$3 = $mul64(new $Uint64(0, 100), n), new $Uint64(y.$high - x$3.$high, y.$low - x$3.$low)); - d = (x$4 = $mul64(new $Uint64(0, 36524), n), new $Uint64(d.$high + x$4.$high, d.$low + x$4.$low)); - n = $div64(y, new $Uint64(0, 4), false); - y = (x$5 = $mul64(new $Uint64(0, 4), n), new $Uint64(y.$high - x$5.$high, y.$low - x$5.$low)); - d = (x$6 = $mul64(new $Uint64(0, 1461), n), new $Uint64(d.$high + x$6.$high, d.$low + x$6.$low)); - n = y; - d = (x$7 = $mul64(new $Uint64(0, 365), n), new $Uint64(d.$high + x$7.$high, d.$low + x$7.$low)); - d = (x$8 = new $Uint64(0, (x$9 = month - 1 >> 0, ((x$9 < 0 || x$9 >= daysBefore.length) ? $throwRuntimeError("index out of range") : daysBefore[x$9]))), new $Uint64(d.$high + x$8.$high, d.$low + x$8.$low)); - if (isLeap(year) && month >= 3) { - d = (x$10 = new $Uint64(0, 1), new $Uint64(d.$high + x$10.$high, d.$low + x$10.$low)); - } - d = (x$11 = new $Uint64(0, (day - 1 >> 0)), new $Uint64(d.$high + x$11.$high, d.$low + x$11.$low)); - abs = $mul64(d, new $Uint64(0, 86400)); - abs = (x$12 = new $Uint64(0, ((($imul(hour, 3600)) + ($imul(min, 60)) >> 0) + sec >> 0)), new $Uint64(abs.$high + x$12.$high, abs.$low + x$12.$low)); - unix = (x$13 = new $Int64(abs.$high, abs.$low), new $Int64(x$13.$high + -2147483647, x$13.$low + 3844486912)); - _r$1 = loc.lookup(unix); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$6 = _r$1; - offset = _tuple$6[1]; - start = _tuple$6[3]; - end = _tuple$6[4]; - /* */ if (!((offset === 0))) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (!((offset === 0))) { */ case 2: - utc = (x$14 = new $Int64(0, offset), new $Int64(unix.$high - x$14.$high, unix.$low - x$14.$low)); - /* */ if ((utc.$high < start.$high || (utc.$high === start.$high && utc.$low < start.$low))) { $s = 5; continue; } - /* */ if ((utc.$high > end.$high || (utc.$high === end.$high && utc.$low >= end.$low))) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if ((utc.$high < start.$high || (utc.$high === start.$high && utc.$low < start.$low))) { */ case 5: - _r$2 = loc.lookup(new $Int64(start.$high - 0, start.$low - 1)); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$7 = _r$2; - offset = _tuple$7[1]; - $s = 7; continue; - /* } else if ((utc.$high > end.$high || (utc.$high === end.$high && utc.$low >= end.$low))) { */ case 6: - _r$3 = loc.lookup(end); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _tuple$8 = _r$3; - offset = _tuple$8[1]; - /* } */ case 7: - case 4: - unix = (x$15 = new $Int64(0, offset), new $Int64(unix.$high - x$15.$high, unix.$low - x$15.$low)); - /* } */ case 3: - return new Time.ptr(new $Int64(unix.$high + 14, unix.$low + 2006054656), (nsec >> 0), loc); - /* */ } return; } if ($f === undefined) { $f = { $blk: Date }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f._tuple$8 = _tuple$8; $f.abs = abs; $f.d = d; $f.day = day; $f.end = end; $f.hour = hour; $f.loc = loc; $f.m = m; $f.min = min; $f.month = month; $f.n = n; $f.nsec = nsec; $f.offset = offset; $f.sec = sec; $f.start = start; $f.unix = unix; $f.utc = utc; $f.x = x; $f.x$1 = x$1; $f.x$10 = x$10; $f.x$11 = x$11; $f.x$12 = x$12; $f.x$13 = x$13; $f.x$14 = x$14; $f.x$15 = x$15; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.x$9 = x$9; $f.y = y; $f.year = year; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Date = Date; - Time.ptr.prototype.Truncate = function(d) { - var $ptr, _tuple$1, d, r, t; - t = $clone(this, Time); - if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { - return t; - } - _tuple$1 = div(t, d); - r = _tuple$1[1]; - return t.Add(new Duration(-r.$high, -r.$low)); - }; - Time.prototype.Truncate = function(d) { return this.$val.Truncate(d); }; - Time.ptr.prototype.Round = function(d) { - var $ptr, _tuple$1, d, r, t, x; - t = $clone(this, Time); - if ((d.$high < 0 || (d.$high === 0 && d.$low <= 0))) { - return t; - } - _tuple$1 = div(t, d); - r = _tuple$1[1]; - if ((x = new Duration(r.$high + r.$high, r.$low + r.$low), (x.$high < d.$high || (x.$high === d.$high && x.$low < d.$low)))) { - return t.Add(new Duration(-r.$high, -r.$low)); - } - return t.Add(new Duration(d.$high - r.$high, d.$low - r.$low)); - }; - Time.prototype.Round = function(d) { return this.$val.Round(d); }; - div = function(t, d) { - var $ptr, _q, _r$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, d, d0, d1, d1$1, neg, nsec, qmod2, r, sec, t, tmp, u0, u0x, u1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - qmod2 = 0; - r = new Duration(0, 0); - t = $clone(t, Time); - neg = false; - nsec = t.nsec; - if ((x = t.sec, (x.$high < 0 || (x.$high === 0 && x.$low < 0)))) { - neg = true; - t.sec = (x$1 = t.sec, new $Int64(-x$1.$high, -x$1.$low)); - nsec = -nsec; - if (nsec < 0) { - nsec = nsec + (1000000000) >> 0; - t.sec = (x$2 = t.sec, x$3 = new $Int64(0, 1), new $Int64(x$2.$high - x$3.$high, x$2.$low - x$3.$low)); - } - } - if ((d.$high < 0 || (d.$high === 0 && d.$low < 1000000000)) && (x$4 = $div64(new Duration(0, 1000000000), (new Duration(d.$high + d.$high, d.$low + d.$low)), true), (x$4.$high === 0 && x$4.$low === 0))) { - qmod2 = ((_q = nsec / ((d.$low + ((d.$high >> 31) * 4294967296)) >> 0), (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) & 1; - r = new Duration(0, (_r$1 = nsec % ((d.$low + ((d.$high >> 31) * 4294967296)) >> 0), _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero"))); - } else if ((x$5 = $div64(d, new Duration(0, 1000000000), true), (x$5.$high === 0 && x$5.$low === 0))) { - d1 = (x$6 = $div64(d, new Duration(0, 1000000000), false), new $Int64(x$6.$high, x$6.$low)); - qmod2 = ((x$7 = $div64(t.sec, d1, false), x$7.$low + ((x$7.$high >> 31) * 4294967296)) >> 0) & 1; - r = (x$8 = $mul64((x$9 = $div64(t.sec, d1, true), new Duration(x$9.$high, x$9.$low)), new Duration(0, 1000000000)), x$10 = new Duration(0, nsec), new Duration(x$8.$high + x$10.$high, x$8.$low + x$10.$low)); - } else { - sec = (x$11 = t.sec, new $Uint64(x$11.$high, x$11.$low)); - tmp = $mul64(($shiftRightUint64(sec, 32)), new $Uint64(0, 1000000000)); - u1 = $shiftRightUint64(tmp, 32); - u0 = $shiftLeft64(tmp, 32); - tmp = $mul64(new $Uint64(sec.$high & 0, (sec.$low & 4294967295) >>> 0), new $Uint64(0, 1000000000)); - _tmp = u0; - _tmp$1 = new $Uint64(u0.$high + tmp.$high, u0.$low + tmp.$low); - u0x = _tmp; - u0 = _tmp$1; - if ((u0.$high < u0x.$high || (u0.$high === u0x.$high && u0.$low < u0x.$low))) { - u1 = (x$12 = new $Uint64(0, 1), new $Uint64(u1.$high + x$12.$high, u1.$low + x$12.$low)); - } - _tmp$2 = u0; - _tmp$3 = (x$13 = new $Uint64(0, nsec), new $Uint64(u0.$high + x$13.$high, u0.$low + x$13.$low)); - u0x = _tmp$2; - u0 = _tmp$3; - if ((u0.$high < u0x.$high || (u0.$high === u0x.$high && u0.$low < u0x.$low))) { - u1 = (x$14 = new $Uint64(0, 1), new $Uint64(u1.$high + x$14.$high, u1.$low + x$14.$low)); - } - d1$1 = new $Uint64(d.$high, d.$low); - while (true) { - if (!(!((x$15 = $shiftRightUint64(d1$1, 63), (x$15.$high === 0 && x$15.$low === 1))))) { break; } - d1$1 = $shiftLeft64(d1$1, (1)); - } - d0 = new $Uint64(0, 0); - while (true) { - qmod2 = 0; - if ((u1.$high > d1$1.$high || (u1.$high === d1$1.$high && u1.$low > d1$1.$low)) || (u1.$high === d1$1.$high && u1.$low === d1$1.$low) && (u0.$high > d0.$high || (u0.$high === d0.$high && u0.$low >= d0.$low))) { - qmod2 = 1; - _tmp$4 = u0; - _tmp$5 = new $Uint64(u0.$high - d0.$high, u0.$low - d0.$low); - u0x = _tmp$4; - u0 = _tmp$5; - if ((u0.$high > u0x.$high || (u0.$high === u0x.$high && u0.$low > u0x.$low))) { - u1 = (x$16 = new $Uint64(0, 1), new $Uint64(u1.$high - x$16.$high, u1.$low - x$16.$low)); - } - u1 = (x$17 = d1$1, new $Uint64(u1.$high - x$17.$high, u1.$low - x$17.$low)); - } - if ((d1$1.$high === 0 && d1$1.$low === 0) && (x$18 = new $Uint64(d.$high, d.$low), (d0.$high === x$18.$high && d0.$low === x$18.$low))) { - break; - } - d0 = $shiftRightUint64(d0, (1)); - d0 = (x$19 = $shiftLeft64((new $Uint64(d1$1.$high & 0, (d1$1.$low & 1) >>> 0)), 63), new $Uint64(d0.$high | x$19.$high, (d0.$low | x$19.$low) >>> 0)); - d1$1 = $shiftRightUint64(d1$1, (1)); - } - r = new Duration(u0.$high, u0.$low); - } - if (neg && !((r.$high === 0 && r.$low === 0))) { - qmod2 = (qmod2 ^ (1)) >> 0; - r = new Duration(d.$high - r.$high, d.$low - r.$low); - } - return [qmod2, r]; - }; - Location.ptr.prototype.get = function() { - var $ptr, l, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; l = $f.l; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - l = this; - if (l === ptrType$1.nil) { - return utcLoc; - } - /* */ if (l === localLoc) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (l === localLoc) { */ case 1: - $r = localOnce.Do(initLocal); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 2: - return l; - /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.get }; } $f.$ptr = $ptr; $f.l = l; $f.$s = $s; $f.$r = $r; return $f; - }; - Location.prototype.get = function() { return this.$val.get(); }; - Location.ptr.prototype.String = function() { - var $ptr, _r$1, l, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$1 = $f._r$1; l = $f.l; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - l = this; - _r$1 = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r$1.name; - /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.String }; } $f.$ptr = $ptr; $f._r$1 = _r$1; $f.l = l; $f.$s = $s; $f.$r = $r; return $f; - }; - Location.prototype.String = function() { return this.$val.String(); }; - FixedZone = function(name, offset) { - var $ptr, l, name, offset, x; - l = new Location.ptr(name, new sliceType([new zone.ptr(name, offset, false)]), new sliceType$1([new zoneTrans.ptr(new $Int64(-2147483648, 0), 0, false, false)]), new $Int64(-2147483648, 0), new $Int64(2147483647, 4294967295), ptrType.nil); - l.cacheZone = (x = l.zone, (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0])); - return l; - }; - $pkg.FixedZone = FixedZone; - Location.ptr.prototype.lookup = function(sec) { - var $ptr, _q, _r$1, end, hi, isDST, l, lim, lo, m, name, offset, sec, start, tx, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, zone$1, zone$2, zone$3, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r$1 = $f._r$1; end = $f.end; hi = $f.hi; isDST = $f.isDST; l = $f.l; lim = $f.lim; lo = $f.lo; m = $f.m; name = $f.name; offset = $f.offset; sec = $f.sec; start = $f.start; tx = $f.tx; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; x$6 = $f.x$6; x$7 = $f.x$7; x$8 = $f.x$8; zone$1 = $f.zone$1; zone$2 = $f.zone$2; zone$3 = $f.zone$3; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - name = ""; - offset = 0; - isDST = false; - start = new $Int64(0, 0); - end = new $Int64(0, 0); - l = this; - _r$1 = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - l = _r$1; - if (l.zone.$length === 0) { - name = "UTC"; - offset = 0; - isDST = false; - start = new $Int64(-2147483648, 0); - end = new $Int64(2147483647, 4294967295); - return [name, offset, isDST, start, end]; - } - zone$1 = l.cacheZone; - if (!(zone$1 === ptrType.nil) && (x = l.cacheStart, (x.$high < sec.$high || (x.$high === sec.$high && x.$low <= sec.$low))) && (x$1 = l.cacheEnd, (sec.$high < x$1.$high || (sec.$high === x$1.$high && sec.$low < x$1.$low)))) { - name = zone$1.name; - offset = zone$1.offset; - isDST = zone$1.isDST; - start = l.cacheStart; - end = l.cacheEnd; - return [name, offset, isDST, start, end]; - } - if ((l.tx.$length === 0) || (x$2 = (x$3 = l.tx, (0 >= x$3.$length ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + 0])).when, (sec.$high < x$2.$high || (sec.$high === x$2.$high && sec.$low < x$2.$low)))) { - zone$2 = (x$4 = l.zone, x$5 = l.lookupFirstZone(), ((x$5 < 0 || x$5 >= x$4.$length) ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + x$5])); - name = zone$2.name; - offset = zone$2.offset; - isDST = zone$2.isDST; - start = new $Int64(-2147483648, 0); - if (l.tx.$length > 0) { - end = (x$6 = l.tx, (0 >= x$6.$length ? $throwRuntimeError("index out of range") : x$6.$array[x$6.$offset + 0])).when; - } else { - end = new $Int64(2147483647, 4294967295); - } - return [name, offset, isDST, start, end]; - } - tx = l.tx; - end = new $Int64(2147483647, 4294967295); - lo = 0; - hi = tx.$length; - while (true) { - if (!((hi - lo >> 0) > 1)) { break; } - m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - lim = ((m < 0 || m >= tx.$length) ? $throwRuntimeError("index out of range") : tx.$array[tx.$offset + m]).when; - if ((sec.$high < lim.$high || (sec.$high === lim.$high && sec.$low < lim.$low))) { - end = lim; - hi = m; - } else { - lo = m; - } - } - zone$3 = (x$7 = l.zone, x$8 = ((lo < 0 || lo >= tx.$length) ? $throwRuntimeError("index out of range") : tx.$array[tx.$offset + lo]).index, ((x$8 < 0 || x$8 >= x$7.$length) ? $throwRuntimeError("index out of range") : x$7.$array[x$7.$offset + x$8])); - name = zone$3.name; - offset = zone$3.offset; - isDST = zone$3.isDST; - start = ((lo < 0 || lo >= tx.$length) ? $throwRuntimeError("index out of range") : tx.$array[tx.$offset + lo]).when; - return [name, offset, isDST, start, end]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.lookup }; } $f.$ptr = $ptr; $f._q = _q; $f._r$1 = _r$1; $f.end = end; $f.hi = hi; $f.isDST = isDST; $f.l = l; $f.lim = lim; $f.lo = lo; $f.m = m; $f.name = name; $f.offset = offset; $f.sec = sec; $f.start = start; $f.tx = tx; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.x$6 = x$6; $f.x$7 = x$7; $f.x$8 = x$8; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.zone$3 = zone$3; $f.$s = $s; $f.$r = $r; return $f; - }; - Location.prototype.lookup = function(sec) { return this.$val.lookup(sec); }; - Location.ptr.prototype.lookupFirstZone = function() { - var $ptr, _i, _ref, l, x, x$1, x$2, x$3, x$4, x$5, zi, zi$1; - l = this; - if (!l.firstZoneUsed()) { - return 0; - } - if (l.tx.$length > 0 && (x = l.zone, x$1 = (x$2 = l.tx, (0 >= x$2.$length ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + 0])).index, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])).isDST) { - zi = ((x$3 = l.tx, (0 >= x$3.$length ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + 0])).index >> 0) - 1 >> 0; - while (true) { - if (!(zi >= 0)) { break; } - if (!(x$4 = l.zone, ((zi < 0 || zi >= x$4.$length) ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + zi])).isDST) { - return zi; - } - zi = zi - (1) >> 0; - } - } - _ref = l.zone; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - zi$1 = _i; - if (!(x$5 = l.zone, ((zi$1 < 0 || zi$1 >= x$5.$length) ? $throwRuntimeError("index out of range") : x$5.$array[x$5.$offset + zi$1])).isDST) { - return zi$1; - } - _i++; - } - return 0; - }; - Location.prototype.lookupFirstZone = function() { return this.$val.lookupFirstZone(); }; - Location.ptr.prototype.firstZoneUsed = function() { - var $ptr, _i, _ref, l, tx; - l = this; - _ref = l.tx; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - tx = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), zoneTrans); - if (tx.index === 0) { - return true; - } - _i++; - } - return false; - }; - Location.prototype.firstZoneUsed = function() { return this.$val.firstZoneUsed(); }; - Location.ptr.prototype.lookupName = function(name, unix) { - var $ptr, _i, _i$1, _r$1, _r$2, _ref, _ref$1, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple$1, i, i$1, isDST, isDST$1, l, nam, name, offset, offset$1, ok, unix, x, x$1, x$2, zone$1, zone$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _i$1 = $f._i$1; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _ref$1 = $f._ref$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple$1 = $f._tuple$1; i = $f.i; i$1 = $f.i$1; isDST = $f.isDST; isDST$1 = $f.isDST$1; l = $f.l; nam = $f.nam; name = $f.name; offset = $f.offset; offset$1 = $f.offset$1; ok = $f.ok; unix = $f.unix; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; zone$1 = $f.zone$1; zone$2 = $f.zone$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - offset = 0; - isDST = false; - ok = false; - l = this; - _r$1 = l.get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - l = _r$1; - _ref = l.zone; - _i = 0; - /* while (true) { */ case 2: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } - i = _i; - zone$1 = (x = l.zone, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])); - /* */ if (zone$1.name === name) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (zone$1.name === name) { */ case 4: - _r$2 = l.lookup((x$1 = new $Int64(0, zone$1.offset), new $Int64(unix.$high - x$1.$high, unix.$low - x$1.$low))); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$1 = _r$2; - nam = _tuple$1[0]; - offset$1 = _tuple$1[1]; - isDST$1 = _tuple$1[2]; - if (nam === zone$1.name) { - _tmp = offset$1; - _tmp$1 = isDST$1; - _tmp$2 = true; - offset = _tmp; - isDST = _tmp$1; - ok = _tmp$2; - return [offset, isDST, ok]; - } - /* } */ case 5: - _i++; - /* } */ $s = 2; continue; case 3: - _ref$1 = l.zone; - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - i$1 = _i$1; - zone$2 = (x$2 = l.zone, ((i$1 < 0 || i$1 >= x$2.$length) ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + i$1])); - if (zone$2.name === name) { - _tmp$3 = zone$2.offset; - _tmp$4 = zone$2.isDST; - _tmp$5 = true; - offset = _tmp$3; - isDST = _tmp$4; - ok = _tmp$5; - return [offset, isDST, ok]; - } - _i$1++; - } - return [offset, isDST, ok]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Location.ptr.prototype.lookupName }; } $f.$ptr = $ptr; $f._i = _i; $f._i$1 = _i$1; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._ref$1 = _ref$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple$1 = _tuple$1; $f.i = i; $f.i$1 = i$1; $f.isDST = isDST; $f.isDST$1 = isDST$1; $f.l = l; $f.nam = nam; $f.name = name; $f.offset = offset; $f.offset$1 = offset$1; $f.ok = ok; $f.unix = unix; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.zone$1 = zone$1; $f.zone$2 = zone$2; $f.$s = $s; $f.$r = $r; return $f; - }; - Location.prototype.lookupName = function(name, unix) { return this.$val.lookupName(name, unix); }; - ptrType$3.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - Time.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Format", name: "Format", pkg: "", typ: $funcType([$String], [$String], false)}, {prop: "AppendFormat", name: "AppendFormat", pkg: "", typ: $funcType([sliceType$3, $String], [sliceType$3], false)}, {prop: "After", name: "After", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "Before", name: "Before", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "Equal", name: "Equal", pkg: "", typ: $funcType([Time], [$Bool], false)}, {prop: "IsZero", name: "IsZero", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "abs", name: "abs", pkg: "time", typ: $funcType([], [$Uint64], false)}, {prop: "locabs", name: "locabs", pkg: "time", typ: $funcType([], [$String, $Int, $Uint64], false)}, {prop: "Date", name: "Date", pkg: "", typ: $funcType([], [$Int, Month, $Int], false)}, {prop: "Year", name: "Year", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Month", name: "Month", pkg: "", typ: $funcType([], [Month], false)}, {prop: "Day", name: "Day", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Weekday", name: "Weekday", pkg: "", typ: $funcType([], [Weekday], false)}, {prop: "ISOWeek", name: "ISOWeek", pkg: "", typ: $funcType([], [$Int, $Int], false)}, {prop: "Clock", name: "Clock", pkg: "", typ: $funcType([], [$Int, $Int, $Int], false)}, {prop: "Hour", name: "Hour", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Minute", name: "Minute", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Second", name: "Second", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Nanosecond", name: "Nanosecond", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "YearDay", name: "YearDay", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "Sub", name: "Sub", pkg: "", typ: $funcType([Time], [Duration], false)}, {prop: "AddDate", name: "AddDate", pkg: "", typ: $funcType([$Int, $Int, $Int], [Time], false)}, {prop: "date", name: "date", pkg: "time", typ: $funcType([$Bool], [$Int, Month, $Int, $Int], false)}, {prop: "UTC", name: "UTC", pkg: "", typ: $funcType([], [Time], false)}, {prop: "Local", name: "Local", pkg: "", typ: $funcType([], [Time], false)}, {prop: "In", name: "In", pkg: "", typ: $funcType([ptrType$1], [Time], false)}, {prop: "Location", name: "Location", pkg: "", typ: $funcType([], [ptrType$1], false)}, {prop: "Zone", name: "Zone", pkg: "", typ: $funcType([], [$String, $Int], false)}, {prop: "Unix", name: "Unix", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "UnixNano", name: "UnixNano", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "MarshalBinary", name: "MarshalBinary", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "GobEncode", name: "GobEncode", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "MarshalJSON", name: "MarshalJSON", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType$3, $error], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([Duration], [Time], false)}, {prop: "Round", name: "Round", pkg: "", typ: $funcType([Duration], [Time], false)}]; - ptrType$6.methods = [{prop: "UnmarshalBinary", name: "UnmarshalBinary", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "GobDecode", name: "GobDecode", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "UnmarshalJSON", name: "UnmarshalJSON", pkg: "", typ: $funcType([sliceType$3], [$error], false)}, {prop: "UnmarshalText", name: "UnmarshalText", pkg: "", typ: $funcType([sliceType$3], [$error], false)}]; - Month.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - Weekday.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - Duration.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Nanoseconds", name: "Nanoseconds", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seconds", name: "Seconds", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Minutes", name: "Minutes", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Hours", name: "Hours", pkg: "", typ: $funcType([], [$Float64], false)}]; - ptrType$1.methods = [{prop: "get", name: "get", pkg: "time", typ: $funcType([], [ptrType$1], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "lookup", name: "lookup", pkg: "time", typ: $funcType([$Int64], [$String, $Int, $Bool, $Int64, $Int64], false)}, {prop: "lookupFirstZone", name: "lookupFirstZone", pkg: "time", typ: $funcType([], [$Int], false)}, {prop: "firstZoneUsed", name: "firstZoneUsed", pkg: "time", typ: $funcType([], [$Bool], false)}, {prop: "lookupName", name: "lookupName", pkg: "time", typ: $funcType([$String, $Int64], [$Int, $Bool, $Bool], false)}]; - ParseError.init([{prop: "Layout", name: "Layout", pkg: "", typ: $String, tag: ""}, {prop: "Value", name: "Value", pkg: "", typ: $String, tag: ""}, {prop: "LayoutElem", name: "LayoutElem", pkg: "", typ: $String, tag: ""}, {prop: "ValueElem", name: "ValueElem", pkg: "", typ: $String, tag: ""}, {prop: "Message", name: "Message", pkg: "", typ: $String, tag: ""}]); - Time.init([{prop: "sec", name: "sec", pkg: "time", typ: $Int64, tag: ""}, {prop: "nsec", name: "nsec", pkg: "time", typ: $Int32, tag: ""}, {prop: "loc", name: "loc", pkg: "time", typ: ptrType$1, tag: ""}]); - Location.init([{prop: "name", name: "name", pkg: "time", typ: $String, tag: ""}, {prop: "zone", name: "zone", pkg: "time", typ: sliceType, tag: ""}, {prop: "tx", name: "tx", pkg: "time", typ: sliceType$1, tag: ""}, {prop: "cacheStart", name: "cacheStart", pkg: "time", typ: $Int64, tag: ""}, {prop: "cacheEnd", name: "cacheEnd", pkg: "time", typ: $Int64, tag: ""}, {prop: "cacheZone", name: "cacheZone", pkg: "time", typ: ptrType, tag: ""}]); - zone.init([{prop: "name", name: "name", pkg: "time", typ: $String, tag: ""}, {prop: "offset", name: "offset", pkg: "time", typ: $Int, tag: ""}, {prop: "isDST", name: "isDST", pkg: "time", typ: $Bool, tag: ""}]); - zoneTrans.init([{prop: "when", name: "when", pkg: "time", typ: $Int64, tag: ""}, {prop: "index", name: "index", pkg: "time", typ: $Uint8, tag: ""}, {prop: "isstd", name: "isstd", pkg: "time", typ: $Bool, tag: ""}, {prop: "isutc", name: "isutc", pkg: "time", typ: $Bool, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = nosync.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strings.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = syscall.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - localLoc = new Location.ptr("", sliceType.nil, sliceType$1.nil, new $Int64(0, 0), new $Int64(0, 0), ptrType.nil); - localOnce = new nosync.Once.ptr(false, false); - std0x = $toNativeArray($kindInt, [260, 265, 524, 526, 528, 274]); - longDayNames = new sliceType$2(["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]); - shortDayNames = new sliceType$2(["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]); - shortMonthNames = new sliceType$2(["---", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]); - longMonthNames = new sliceType$2(["---", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]); - atoiError = errors.New("time: invalid number"); - errBad = errors.New("bad value for field"); - errLeadingInt = errors.New("time: bad [0-9]*"); - months = $toNativeArray($kindString, ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]); - days = $toNativeArray($kindString, ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]); - unitMap = $makeMap($String.keyFor, [{ k: "ns", v: new $Int64(0, 1) }, { k: "us", v: new $Int64(0, 1000) }, { k: "\xC2\xB5s", v: new $Int64(0, 1000) }, { k: "\xCE\xBCs", v: new $Int64(0, 1000) }, { k: "ms", v: new $Int64(0, 1000000) }, { k: "s", v: new $Int64(0, 1000000000) }, { k: "m", v: new $Int64(13, 4165425152) }, { k: "h", v: new $Int64(838, 817405952) }]); - daysBefore = $toNativeArray($kindInt32, [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]); - utcLoc = new Location.ptr("UTC", sliceType.nil, sliceType$1.nil, new $Int64(0, 0), new $Int64(0, 0), ptrType.nil); - $pkg.UTC = utcLoc; - $pkg.Local = localLoc; - _r = syscall.Getenv("ZONEINFO"); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - zoneinfo = _tuple[0]; - badData = errors.New("malformed time zone information"); - zoneDirs = new sliceType$2(["/usr/share/zoneinfo/", "/usr/share/lib/zoneinfo/", "/usr/lib/locale/TZ/", runtime.GOROOT() + "/lib/time/zoneinfo.zip"]); - init(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["os"] = (function() { - var $pkg = {}, $init, errors, js, io, runtime, sync, atomic, syscall, time, PathError, SyscallError, LinkError, File, file, dirInfo, FileInfo, FileMode, fileStat, sliceType, ptrType, sliceType$1, sliceType$2, ptrType$1, ptrType$2, ptrType$3, ptrType$4, ptrType$12, funcType$1, ptrType$13, arrayType$1, arrayType$5, ptrType$15, errFinished, lstat, runtime_args, init, runtime_beforeExit, NewSyscallError, IsNotExist, isNotExist, fixCount, sigpipe, syscallMode, NewFile, epipecheck, Lstat, basename, init$1, Exit, fillFileStatFromSys, timespecToTime; - errors = $packages["errors"]; - js = $packages["github.com/gopherjs/gopherjs/js"]; - io = $packages["io"]; - runtime = $packages["runtime"]; - sync = $packages["sync"]; - atomic = $packages["sync/atomic"]; - syscall = $packages["syscall"]; - time = $packages["time"]; - PathError = $pkg.PathError = $newType(0, $kindStruct, "os.PathError", "PathError", "os", function(Op_, Path_, Err_) { - this.$val = this; - if (arguments.length === 0) { - this.Op = ""; - this.Path = ""; - this.Err = $ifaceNil; - return; - } - this.Op = Op_; - this.Path = Path_; - this.Err = Err_; - }); - SyscallError = $pkg.SyscallError = $newType(0, $kindStruct, "os.SyscallError", "SyscallError", "os", function(Syscall_, Err_) { - this.$val = this; - if (arguments.length === 0) { - this.Syscall = ""; - this.Err = $ifaceNil; - return; - } - this.Syscall = Syscall_; - this.Err = Err_; - }); - LinkError = $pkg.LinkError = $newType(0, $kindStruct, "os.LinkError", "LinkError", "os", function(Op_, Old_, New_, Err_) { - this.$val = this; - if (arguments.length === 0) { - this.Op = ""; - this.Old = ""; - this.New = ""; - this.Err = $ifaceNil; - return; - } - this.Op = Op_; - this.Old = Old_; - this.New = New_; - this.Err = Err_; - }); - File = $pkg.File = $newType(0, $kindStruct, "os.File", "File", "os", function(file_) { - this.$val = this; - if (arguments.length === 0) { - this.file = ptrType$12.nil; - return; - } - this.file = file_; - }); - file = $pkg.file = $newType(0, $kindStruct, "os.file", "file", "os", function(fd_, name_, dirinfo_) { - this.$val = this; - if (arguments.length === 0) { - this.fd = 0; - this.name = ""; - this.dirinfo = ptrType.nil; - return; - } - this.fd = fd_; - this.name = name_; - this.dirinfo = dirinfo_; - }); - dirInfo = $pkg.dirInfo = $newType(0, $kindStruct, "os.dirInfo", "dirInfo", "os", function(buf_, nbuf_, bufp_) { - this.$val = this; - if (arguments.length === 0) { - this.buf = sliceType$1.nil; - this.nbuf = 0; - this.bufp = 0; - return; - } - this.buf = buf_; - this.nbuf = nbuf_; - this.bufp = bufp_; - }); - FileInfo = $pkg.FileInfo = $newType(8, $kindInterface, "os.FileInfo", "FileInfo", "os", null); - FileMode = $pkg.FileMode = $newType(4, $kindUint32, "os.FileMode", "FileMode", "os", null); - fileStat = $pkg.fileStat = $newType(0, $kindStruct, "os.fileStat", "fileStat", "os", function(name_, size_, mode_, modTime_, sys_) { - this.$val = this; - if (arguments.length === 0) { - this.name = ""; - this.size = new $Int64(0, 0); - this.mode = 0; - this.modTime = new time.Time.ptr(new $Int64(0, 0), 0, ptrType$13.nil); - this.sys = new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero()); - return; - } - this.name = name_; - this.size = size_; - this.mode = mode_; - this.modTime = modTime_; - this.sys = sys_; - }); - sliceType = $sliceType($String); - ptrType = $ptrType(dirInfo); - sliceType$1 = $sliceType($Uint8); - sliceType$2 = $sliceType(FileInfo); - ptrType$1 = $ptrType(File); - ptrType$2 = $ptrType(PathError); - ptrType$3 = $ptrType(LinkError); - ptrType$4 = $ptrType(SyscallError); - ptrType$12 = $ptrType(file); - funcType$1 = $funcType([ptrType$12], [$error], false); - ptrType$13 = $ptrType(time.Location); - arrayType$1 = $arrayType($Int64, 3); - arrayType$5 = $arrayType($Uint8, 32); - ptrType$15 = $ptrType(fileStat); - runtime_args = function() { - var $ptr; - return $pkg.Args; - }; - init = function() { - var $ptr, argv, i, process; - process = $global.process; - if (!(process === undefined)) { - argv = process.argv; - $pkg.Args = $makeSlice(sliceType, ($parseInt(argv.length) - 1 >> 0)); - i = 0; - while (true) { - if (!(i < ($parseInt(argv.length) - 1 >> 0))) { break; } - ((i < 0 || i >= $pkg.Args.$length) ? $throwRuntimeError("index out of range") : $pkg.Args.$array[$pkg.Args.$offset + i] = $internalize(argv[(i + 1 >> 0)], $String)); - i = i + (1) >> 0; - } - } - if ($pkg.Args.$length === 0) { - $pkg.Args = new sliceType(["?"]); - } - }; - runtime_beforeExit = function() { - var $ptr; - }; - File.ptr.prototype.readdirnames = function(n) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tuple, _tuple$1, _tuple$2, d, err, errno, f, n, names, nb, nc, size; - names = sliceType.nil; - err = $ifaceNil; - f = this; - if (f.file.dirinfo === ptrType.nil) { - f.file.dirinfo = new dirInfo.ptr(sliceType$1.nil, 0, 0); - f.file.dirinfo.buf = $makeSlice(sliceType$1, 4096); - } - d = f.file.dirinfo; - size = n; - if (size <= 0) { - size = 100; - n = -1; - } - names = $makeSlice(sliceType, 0, size); - while (true) { - if (!(!((n === 0)))) { break; } - if (d.bufp >= d.nbuf) { - d.bufp = 0; - errno = $ifaceNil; - _tuple$1 = syscall.ReadDirent(f.file.fd, d.buf); - _tuple = fixCount(_tuple$1[0], _tuple$1[1]); - d.nbuf = _tuple[0]; - errno = _tuple[1]; - if (!($interfaceIsEqual(errno, $ifaceNil))) { - _tmp = names; - _tmp$1 = NewSyscallError("readdirent", errno); - names = _tmp; - err = _tmp$1; - return [names, err]; - } - if (d.nbuf <= 0) { - break; - } - } - _tmp$2 = 0; - _tmp$3 = 0; - nb = _tmp$2; - nc = _tmp$3; - _tuple$2 = syscall.ParseDirent($subslice(d.buf, d.bufp, d.nbuf), n, names); - nb = _tuple$2[0]; - nc = _tuple$2[1]; - names = _tuple$2[2]; - d.bufp = d.bufp + (nb) >> 0; - n = n - (nc) >> 0; - } - if (n >= 0 && (names.$length === 0)) { - _tmp$4 = names; - _tmp$5 = io.EOF; - names = _tmp$4; - err = _tmp$5; - return [names, err]; - } - _tmp$6 = names; - _tmp$7 = $ifaceNil; - names = _tmp$6; - err = _tmp$7; - return [names, err]; - }; - File.prototype.readdirnames = function(n) { return this.$val.readdirnames(n); }; - File.ptr.prototype.Readdir = function(n) { - var $ptr, _r, _tmp, _tmp$1, _tuple, err, f, fi, n, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; err = $f.err; f = $f.f; fi = $f.fi; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fi = sliceType$2.nil; - err = $ifaceNil; - f = this; - if (f === ptrType$1.nil) { - _tmp = sliceType$2.nil; - _tmp$1 = $pkg.ErrInvalid; - fi = _tmp; - err = _tmp$1; - return [fi, err]; - } - _r = f.readdir(n); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - fi = _tuple[0]; - err = _tuple[1]; - /* */ $s = 2; case 2: - return [fi, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.Readdir }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.fi = fi; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.Readdir = function(n) { return this.$val.Readdir(n); }; - File.ptr.prototype.Readdirnames = function(n) { - var $ptr, _tmp, _tmp$1, _tuple, err, f, n, names; - names = sliceType.nil; - err = $ifaceNil; - f = this; - if (f === ptrType$1.nil) { - _tmp = sliceType.nil; - _tmp$1 = $pkg.ErrInvalid; - names = _tmp; - err = _tmp$1; - return [names, err]; - } - _tuple = f.readdirnames(n); - names = _tuple[0]; - err = _tuple[1]; - return [names, err]; - }; - File.prototype.Readdirnames = function(n) { return this.$val.Readdirnames(n); }; - PathError.ptr.prototype.Error = function() { - var $ptr, _r, e, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return e.Op + " " + e.Path + ": " + _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: PathError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; - }; - PathError.prototype.Error = function() { return this.$val.Error(); }; - SyscallError.ptr.prototype.Error = function() { - var $ptr, _r, e, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return e.Syscall + ": " + _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: SyscallError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; - }; - SyscallError.prototype.Error = function() { return this.$val.Error(); }; - NewSyscallError = function(syscall$1, err) { - var $ptr, err, syscall$1; - if ($interfaceIsEqual(err, $ifaceNil)) { - return $ifaceNil; - } - return new SyscallError.ptr(syscall$1, err); - }; - $pkg.NewSyscallError = NewSyscallError; - IsNotExist = function(err) { - var $ptr, err; - return isNotExist(err); - }; - $pkg.IsNotExist = IsNotExist; - isNotExist = function(err) { - var $ptr, _ref, err, pe, pe$1, pe$2, pe$3; - _ref = err; - if (_ref === $ifaceNil) { - pe = _ref; - return false; - } else if ($assertType(_ref, ptrType$2, true)[1]) { - pe$1 = _ref.$val; - err = pe$1.Err; - } else if ($assertType(_ref, ptrType$3, true)[1]) { - pe$2 = _ref.$val; - err = pe$2.Err; - } else if ($assertType(_ref, ptrType$4, true)[1]) { - pe$3 = _ref.$val; - err = pe$3.Err; - } - return $interfaceIsEqual(err, new syscall.Errno(2)) || $interfaceIsEqual(err, $pkg.ErrNotExist); - }; - File.ptr.prototype.Name = function() { - var $ptr, f; - f = this; - return f.file.name; - }; - File.prototype.Name = function() { return this.$val.Name(); }; - LinkError.ptr.prototype.Error = function() { - var $ptr, _r, e, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _r = e.Err.Error(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return e.Op + " " + e.Old + " " + e.New + ": " + _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: LinkError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r = _r; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; - }; - LinkError.prototype.Error = function() { return this.$val.Error(); }; - File.ptr.prototype.Read = function(b) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, b, e, err, f, n; - n = 0; - err = $ifaceNil; - f = this; - if (f === ptrType$1.nil) { - _tmp = 0; - _tmp$1 = $pkg.ErrInvalid; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - _tuple = f.read(b); - n = _tuple[0]; - e = _tuple[1]; - if ((n === 0) && b.$length > 0 && $interfaceIsEqual(e, $ifaceNil)) { - _tmp$2 = 0; - _tmp$3 = io.EOF; - n = _tmp$2; - err = _tmp$3; - return [n, err]; - } - if (!($interfaceIsEqual(e, $ifaceNil))) { - err = new PathError.ptr("read", f.file.name, e); - } - _tmp$4 = n; - _tmp$5 = err; - n = _tmp$4; - err = _tmp$5; - return [n, err]; - }; - File.prototype.Read = function(b) { return this.$val.Read(b); }; - File.ptr.prototype.ReadAt = function(b, off) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, f, m, n, off, x; - n = 0; - err = $ifaceNil; - f = this; - if (f === ptrType$1.nil) { - _tmp = 0; - _tmp$1 = $pkg.ErrInvalid; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - while (true) { - if (!(b.$length > 0)) { break; } - _tuple = f.pread(b, off); - m = _tuple[0]; - e = _tuple[1]; - if ((m === 0) && $interfaceIsEqual(e, $ifaceNil)) { - _tmp$2 = n; - _tmp$3 = io.EOF; - n = _tmp$2; - err = _tmp$3; - return [n, err]; - } - if (!($interfaceIsEqual(e, $ifaceNil))) { - err = new PathError.ptr("read", f.file.name, e); - break; - } - n = n + (m) >> 0; - b = $subslice(b, m); - off = (x = new $Int64(0, m), new $Int64(off.$high + x.$high, off.$low + x.$low)); - } - return [n, err]; - }; - File.prototype.ReadAt = function(b, off) { return this.$val.ReadAt(b, off); }; - File.ptr.prototype.Write = function(b) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, b, e, err, f, n; - n = 0; - err = $ifaceNil; - f = this; - if (f === ptrType$1.nil) { - _tmp = 0; - _tmp$1 = $pkg.ErrInvalid; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - _tuple = f.write(b); - n = _tuple[0]; - e = _tuple[1]; - if (n < 0) { - n = 0; - } - if (!((n === b.$length))) { - err = io.ErrShortWrite; - } - epipecheck(f, e); - if (!($interfaceIsEqual(e, $ifaceNil))) { - err = new PathError.ptr("write", f.file.name, e); - } - _tmp$2 = n; - _tmp$3 = err; - n = _tmp$2; - err = _tmp$3; - return [n, err]; - }; - File.prototype.Write = function(b) { return this.$val.Write(b); }; - File.ptr.prototype.WriteAt = function(b, off) { - var $ptr, _tmp, _tmp$1, _tuple, b, e, err, f, m, n, off, x; - n = 0; - err = $ifaceNil; - f = this; - if (f === ptrType$1.nil) { - _tmp = 0; - _tmp$1 = $pkg.ErrInvalid; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - while (true) { - if (!(b.$length > 0)) { break; } - _tuple = f.pwrite(b, off); - m = _tuple[0]; - e = _tuple[1]; - if (!($interfaceIsEqual(e, $ifaceNil))) { - err = new PathError.ptr("write", f.file.name, e); - break; - } - n = n + (m) >> 0; - b = $subslice(b, m); - off = (x = new $Int64(0, m), new $Int64(off.$high + x.$high, off.$low + x.$low)); - } - return [n, err]; - }; - File.prototype.WriteAt = function(b, off) { return this.$val.WriteAt(b, off); }; - File.ptr.prototype.Seek = function(offset, whence) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, e, err, f, offset, r, ret, whence; - ret = new $Int64(0, 0); - err = $ifaceNil; - f = this; - if (f === ptrType$1.nil) { - _tmp = new $Int64(0, 0); - _tmp$1 = $pkg.ErrInvalid; - ret = _tmp; - err = _tmp$1; - return [ret, err]; - } - _tuple = f.seek(offset, whence); - r = _tuple[0]; - e = _tuple[1]; - if ($interfaceIsEqual(e, $ifaceNil) && !(f.file.dirinfo === ptrType.nil) && !((r.$high === 0 && r.$low === 0))) { - e = new syscall.Errno(21); - } - if (!($interfaceIsEqual(e, $ifaceNil))) { - _tmp$2 = new $Int64(0, 0); - _tmp$3 = new PathError.ptr("seek", f.file.name, e); - ret = _tmp$2; - err = _tmp$3; - return [ret, err]; - } - _tmp$4 = r; - _tmp$5 = $ifaceNil; - ret = _tmp$4; - err = _tmp$5; - return [ret, err]; - }; - File.prototype.Seek = function(offset, whence) { return this.$val.Seek(offset, whence); }; - File.ptr.prototype.WriteString = function(s) { - var $ptr, _tmp, _tmp$1, _tuple, err, f, n, s; - n = 0; - err = $ifaceNil; - f = this; - if (f === ptrType$1.nil) { - _tmp = 0; - _tmp$1 = $pkg.ErrInvalid; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - _tuple = f.Write(new sliceType$1($stringToBytes(s))); - n = _tuple[0]; - err = _tuple[1]; - return [n, err]; - }; - File.prototype.WriteString = function(s) { return this.$val.WriteString(s); }; - File.ptr.prototype.Chdir = function() { - var $ptr, e, f; - f = this; - if (f === ptrType$1.nil) { - return $pkg.ErrInvalid; - } - e = syscall.Fchdir(f.file.fd); - if (!($interfaceIsEqual(e, $ifaceNil))) { - return new PathError.ptr("chdir", f.file.name, e); - } - return $ifaceNil; - }; - File.prototype.Chdir = function() { return this.$val.Chdir(); }; - fixCount = function(n, err) { - var $ptr, err, n; - if (n < 0) { - n = 0; - } - return [n, err]; - }; - sigpipe = function() { - $throwRuntimeError("native function not implemented: os.sigpipe"); - }; - syscallMode = function(i) { - var $ptr, i, o; - o = 0; - o = (o | ((new FileMode(i).Perm() >>> 0))) >>> 0; - if (!((((i & 8388608) >>> 0) === 0))) { - o = (o | (2048)) >>> 0; - } - if (!((((i & 4194304) >>> 0) === 0))) { - o = (o | (1024)) >>> 0; - } - if (!((((i & 1048576) >>> 0) === 0))) { - o = (o | (512)) >>> 0; - } - return o; - }; - File.ptr.prototype.Chmod = function(mode) { - var $ptr, e, f, mode; - f = this; - if (f === ptrType$1.nil) { - return $pkg.ErrInvalid; - } - e = syscall.Fchmod(f.file.fd, syscallMode(mode)); - if (!($interfaceIsEqual(e, $ifaceNil))) { - return new PathError.ptr("chmod", f.file.name, e); - } - return $ifaceNil; - }; - File.prototype.Chmod = function(mode) { return this.$val.Chmod(mode); }; - File.ptr.prototype.Chown = function(uid, gid) { - var $ptr, e, f, gid, uid; - f = this; - if (f === ptrType$1.nil) { - return $pkg.ErrInvalid; - } - e = syscall.Fchown(f.file.fd, uid, gid); - if (!($interfaceIsEqual(e, $ifaceNil))) { - return new PathError.ptr("chown", f.file.name, e); - } - return $ifaceNil; - }; - File.prototype.Chown = function(uid, gid) { return this.$val.Chown(uid, gid); }; - File.ptr.prototype.Truncate = function(size) { - var $ptr, e, f, size; - f = this; - if (f === ptrType$1.nil) { - return $pkg.ErrInvalid; - } - e = syscall.Ftruncate(f.file.fd, size); - if (!($interfaceIsEqual(e, $ifaceNil))) { - return new PathError.ptr("truncate", f.file.name, e); - } - return $ifaceNil; - }; - File.prototype.Truncate = function(size) { return this.$val.Truncate(size); }; - File.ptr.prototype.Sync = function() { - var $ptr, e, f; - f = this; - if (f === ptrType$1.nil) { - return $pkg.ErrInvalid; - } - e = syscall.Fsync(f.file.fd); - if (!($interfaceIsEqual(e, $ifaceNil))) { - return NewSyscallError("fsync", e); - } - return $ifaceNil; - }; - File.prototype.Sync = function() { return this.$val.Sync(); }; - File.ptr.prototype.Fd = function() { - var $ptr, f; - f = this; - if (f === ptrType$1.nil) { - return 4294967295; - } - return (f.file.fd >>> 0); - }; - File.prototype.Fd = function() { return this.$val.Fd(); }; - NewFile = function(fd, name) { - var $ptr, f, fd, fdi, name; - fdi = (fd >> 0); - if (fdi < 0) { - return ptrType$1.nil; - } - f = new File.ptr(new file.ptr(fdi, name, ptrType.nil)); - runtime.SetFinalizer(f.file, new funcType$1($methodExpr(ptrType$12, "close"))); - return f; - }; - $pkg.NewFile = NewFile; - epipecheck = function(file$1, e) { - var $ptr, e, file$1; - if ($interfaceIsEqual(e, new syscall.Errno(32)) && ((file$1.file.fd === 1) || (file$1.file.fd === 2))) { - sigpipe(); - } - }; - File.ptr.prototype.Close = function() { - var $ptr, f; - f = this; - if (f === ptrType$1.nil) { - return $pkg.ErrInvalid; - } - return f.file.close(); - }; - File.prototype.Close = function() { return this.$val.Close(); }; - file.ptr.prototype.close = function() { - var $ptr, e, err, file$1; - file$1 = this; - if (file$1 === ptrType$12.nil || file$1.fd < 0) { - return new syscall.Errno(22); - } - err = $ifaceNil; - e = syscall.Close(file$1.fd); - if (!($interfaceIsEqual(e, $ifaceNil))) { - err = new PathError.ptr("close", file$1.name, e); - } - file$1.fd = -1; - runtime.SetFinalizer(file$1, $ifaceNil); - return err; - }; - file.prototype.close = function() { return this.$val.close(); }; - File.ptr.prototype.Stat = function() { - var $ptr, err, f, fs; - f = this; - if (f === ptrType$1.nil) { - return [$ifaceNil, $pkg.ErrInvalid]; - } - fs = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Int64(0, 0), 0, ptrType$13.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero())); - err = syscall.Fstat(f.file.fd, fs.sys); - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [$ifaceNil, new PathError.ptr("stat", f.file.name, err)]; - } - fillFileStatFromSys(fs, f.file.name); - return [fs, $ifaceNil]; - }; - File.prototype.Stat = function() { return this.$val.Stat(); }; - Lstat = function(name) { - var $ptr, err, fs, name; - fs = new fileStat.ptr("", new $Int64(0, 0), 0, new time.Time.ptr(new $Int64(0, 0), 0, ptrType$13.nil), new syscall.Stat_t.ptr(new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, new $Uint64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new $Int64(0, 0), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), new syscall.Timespec.ptr(new $Int64(0, 0), new $Int64(0, 0)), arrayType$1.zero())); - err = syscall.Lstat(name, fs.sys); - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [$ifaceNil, new PathError.ptr("lstat", name, err)]; - } - fillFileStatFromSys(fs, name); - return [fs, $ifaceNil]; - }; - $pkg.Lstat = Lstat; - File.ptr.prototype.readdir = function(n) { - var $ptr, _i, _r, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tuple, _tuple$1, dirname, err, f, fi, filename, fip, lerr, n, names, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; dirname = $f.dirname; err = $f.err; f = $f.f; fi = $f.fi; filename = $f.filename; fip = $f.fip; lerr = $f.lerr; n = $f.n; names = $f.names; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fi = sliceType$2.nil; - err = $ifaceNil; - f = this; - dirname = f.file.name; - if (dirname === "") { - dirname = "."; - } - _tuple = f.Readdirnames(n); - names = _tuple[0]; - err = _tuple[1]; - fi = $makeSlice(sliceType$2, 0, names.$length); - _ref = names; - _i = 0; - /* while (true) { */ case 1: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } - filename = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - _r = lstat(dirname + "/" + filename); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple$1 = _r; - fip = _tuple$1[0]; - lerr = _tuple$1[1]; - if (IsNotExist(lerr)) { - _i++; - /* continue; */ $s = 1; continue; - } - if (!($interfaceIsEqual(lerr, $ifaceNil))) { - _tmp = fi; - _tmp$1 = lerr; - fi = _tmp; - err = _tmp$1; - return [fi, err]; - } - fi = $append(fi, fip); - _i++; - /* } */ $s = 1; continue; case 2: - _tmp$2 = fi; - _tmp$3 = err; - fi = _tmp$2; - err = _tmp$3; - return [fi, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: File.ptr.prototype.readdir }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.dirname = dirname; $f.err = err; $f.f = f; $f.fi = fi; $f.filename = filename; $f.fip = fip; $f.lerr = lerr; $f.n = n; $f.names = names; $f.$s = $s; $f.$r = $r; return $f; - }; - File.prototype.readdir = function(n) { return this.$val.readdir(n); }; - File.ptr.prototype.read = function(b) { - var $ptr, _tuple, _tuple$1, b, err, f, n; - n = 0; - err = $ifaceNil; - f = this; - if (false && b.$length > 1073741824) { - b = $subslice(b, 0, 1073741824); - } - _tuple$1 = syscall.Read(f.file.fd, b); - _tuple = fixCount(_tuple$1[0], _tuple$1[1]); - n = _tuple[0]; - err = _tuple[1]; - return [n, err]; - }; - File.prototype.read = function(b) { return this.$val.read(b); }; - File.ptr.prototype.pread = function(b, off) { - var $ptr, _tuple, _tuple$1, b, err, f, n, off; - n = 0; - err = $ifaceNil; - f = this; - if (false && b.$length > 1073741824) { - b = $subslice(b, 0, 1073741824); - } - _tuple$1 = syscall.Pread(f.file.fd, b, off); - _tuple = fixCount(_tuple$1[0], _tuple$1[1]); - n = _tuple[0]; - err = _tuple[1]; - return [n, err]; - }; - File.prototype.pread = function(b, off) { return this.$val.pread(b, off); }; - File.ptr.prototype.write = function(b) { - var $ptr, _tmp, _tmp$1, _tuple, _tuple$1, b, bcap, err, err$1, f, m, n; - n = 0; - err = $ifaceNil; - f = this; - while (true) { - bcap = b; - if (false && bcap.$length > 1073741824) { - bcap = $subslice(bcap, 0, 1073741824); - } - _tuple$1 = syscall.Write(f.file.fd, bcap); - _tuple = fixCount(_tuple$1[0], _tuple$1[1]); - m = _tuple[0]; - err$1 = _tuple[1]; - n = n + (m) >> 0; - if (0 < m && m < bcap.$length || $interfaceIsEqual(err$1, new syscall.Errno(4))) { - b = $subslice(b, m); - continue; - } - if (false && !((bcap.$length === b.$length)) && $interfaceIsEqual(err$1, $ifaceNil)) { - b = $subslice(b, m); - continue; - } - _tmp = n; - _tmp$1 = err$1; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - }; - File.prototype.write = function(b) { return this.$val.write(b); }; - File.ptr.prototype.pwrite = function(b, off) { - var $ptr, _tuple, _tuple$1, b, err, f, n, off; - n = 0; - err = $ifaceNil; - f = this; - if (false && b.$length > 1073741824) { - b = $subslice(b, 0, 1073741824); - } - _tuple$1 = syscall.Pwrite(f.file.fd, b, off); - _tuple = fixCount(_tuple$1[0], _tuple$1[1]); - n = _tuple[0]; - err = _tuple[1]; - return [n, err]; - }; - File.prototype.pwrite = function(b, off) { return this.$val.pwrite(b, off); }; - File.ptr.prototype.seek = function(offset, whence) { - var $ptr, _tuple, err, f, offset, ret, whence; - ret = new $Int64(0, 0); - err = $ifaceNil; - f = this; - _tuple = syscall.Seek(f.file.fd, offset, whence); - ret = _tuple[0]; - err = _tuple[1]; - return [ret, err]; - }; - File.prototype.seek = function(offset, whence) { return this.$val.seek(offset, whence); }; - basename = function(name) { - var $ptr, i, name; - i = name.length - 1 >> 0; - while (true) { - if (!(i > 0 && (name.charCodeAt(i) === 47))) { break; } - name = name.substring(0, i); - i = i - (1) >> 0; - } - i = i - (1) >> 0; - while (true) { - if (!(i >= 0)) { break; } - if (name.charCodeAt(i) === 47) { - name = name.substring((i + 1 >> 0)); - break; - } - i = i - (1) >> 0; - } - return name; - }; - init$1 = function() { - var $ptr; - if (false) { - return; - } - $pkg.Args = runtime_args(); - }; - Exit = function(code) { - var $ptr, code; - if (code === 0) { - runtime_beforeExit(); - } - syscall.Exit(code); - }; - $pkg.Exit = Exit; - fillFileStatFromSys = function(fs, name) { - var $ptr, _1, fs, name; - fs.name = basename(name); - fs.size = fs.sys.Size; - time.Time.copy(fs.modTime, timespecToTime(fs.sys.Mtim)); - fs.mode = (((fs.sys.Mode & 511) >>> 0) >>> 0); - _1 = (fs.sys.Mode & 61440) >>> 0; - if (_1 === (24576)) { - fs.mode = (fs.mode | (67108864)) >>> 0; - } else if (_1 === (8192)) { - fs.mode = (fs.mode | (69206016)) >>> 0; - } else if (_1 === (16384)) { - fs.mode = (fs.mode | (2147483648)) >>> 0; - } else if (_1 === (4096)) { - fs.mode = (fs.mode | (33554432)) >>> 0; - } else if (_1 === (40960)) { - fs.mode = (fs.mode | (134217728)) >>> 0; - } else if (_1 === (32768)) { - } else if (_1 === (49152)) { - fs.mode = (fs.mode | (16777216)) >>> 0; - } - if (!((((fs.sys.Mode & 1024) >>> 0) === 0))) { - fs.mode = (fs.mode | (4194304)) >>> 0; - } - if (!((((fs.sys.Mode & 2048) >>> 0) === 0))) { - fs.mode = (fs.mode | (8388608)) >>> 0; - } - if (!((((fs.sys.Mode & 512) >>> 0) === 0))) { - fs.mode = (fs.mode | (1048576)) >>> 0; - } - }; - timespecToTime = function(ts) { - var $ptr, ts; - ts = $clone(ts, syscall.Timespec); - return time.Unix(ts.Sec, ts.Nsec); - }; - FileMode.prototype.String = function() { - var $ptr, _i, _i$1, _ref, _ref$1, _rune, _rune$1, buf, c, c$1, i, i$1, m, w, y, y$1; - m = this.$val; - buf = arrayType$5.zero(); - w = 0; - _ref = "dalTLDpSugct"; - _i = 0; - while (true) { - if (!(_i < _ref.length)) { break; } - _rune = $decodeRune(_ref, _i); - i = _i; - c = _rune[0]; - if (!((((m & (((y = ((31 - i >> 0) >>> 0), y < 32 ? (1 << y) : 0) >>> 0))) >>> 0) === 0))) { - ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = (c << 24 >>> 24)); - w = w + (1) >> 0; - } - _i += _rune[1]; - } - if (w === 0) { - ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 45); - w = w + (1) >> 0; - } - _ref$1 = "rwxrwxrwx"; - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.length)) { break; } - _rune$1 = $decodeRune(_ref$1, _i$1); - i$1 = _i$1; - c$1 = _rune$1[0]; - if (!((((m & (((y$1 = ((8 - i$1 >> 0) >>> 0), y$1 < 32 ? (1 << y$1) : 0) >>> 0))) >>> 0) === 0))) { - ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = (c$1 << 24 >>> 24)); - } else { - ((w < 0 || w >= buf.length) ? $throwRuntimeError("index out of range") : buf[w] = 45); - } - w = w + (1) >> 0; - _i$1 += _rune$1[1]; - } - return $bytesToString($subslice(new sliceType$1(buf), 0, w)); - }; - $ptrType(FileMode).prototype.String = function() { return new FileMode(this.$get()).String(); }; - FileMode.prototype.IsDir = function() { - var $ptr, m; - m = this.$val; - return !((((m & 2147483648) >>> 0) === 0)); - }; - $ptrType(FileMode).prototype.IsDir = function() { return new FileMode(this.$get()).IsDir(); }; - FileMode.prototype.IsRegular = function() { - var $ptr, m; - m = this.$val; - return ((m & 2399141888) >>> 0) === 0; - }; - $ptrType(FileMode).prototype.IsRegular = function() { return new FileMode(this.$get()).IsRegular(); }; - FileMode.prototype.Perm = function() { - var $ptr, m; - m = this.$val; - return (m & 511) >>> 0; - }; - $ptrType(FileMode).prototype.Perm = function() { return new FileMode(this.$get()).Perm(); }; - fileStat.ptr.prototype.Name = function() { - var $ptr, fs; - fs = this; - return fs.name; - }; - fileStat.prototype.Name = function() { return this.$val.Name(); }; - fileStat.ptr.prototype.IsDir = function() { - var $ptr, fs; - fs = this; - return new FileMode(fs.Mode()).IsDir(); - }; - fileStat.prototype.IsDir = function() { return this.$val.IsDir(); }; - fileStat.ptr.prototype.Size = function() { - var $ptr, fs; - fs = this; - return fs.size; - }; - fileStat.prototype.Size = function() { return this.$val.Size(); }; - fileStat.ptr.prototype.Mode = function() { - var $ptr, fs; - fs = this; - return fs.mode; - }; - fileStat.prototype.Mode = function() { return this.$val.Mode(); }; - fileStat.ptr.prototype.ModTime = function() { - var $ptr, fs; - fs = this; - return fs.modTime; - }; - fileStat.prototype.ModTime = function() { return this.$val.ModTime(); }; - fileStat.ptr.prototype.Sys = function() { - var $ptr, fs; - fs = this; - return fs.sys; - }; - fileStat.prototype.Sys = function() { return this.$val.Sys(); }; - ptrType$2.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$4.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$3.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$1.methods = [{prop: "readdirnames", name: "readdirnames", pkg: "os", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "Readdir", name: "Readdir", pkg: "", typ: $funcType([$Int], [sliceType$2, $error], false)}, {prop: "Readdirnames", name: "Readdirnames", pkg: "", typ: $funcType([$Int], [sliceType, $error], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "ReadAt", name: "ReadAt", pkg: "", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "WriteAt", name: "WriteAt", pkg: "", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}, {prop: "Seek", name: "Seek", pkg: "", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "Chdir", name: "Chdir", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Chmod", name: "Chmod", pkg: "", typ: $funcType([FileMode], [$error], false)}, {prop: "Chown", name: "Chown", pkg: "", typ: $funcType([$Int, $Int], [$error], false)}, {prop: "Truncate", name: "Truncate", pkg: "", typ: $funcType([$Int64], [$error], false)}, {prop: "Sync", name: "Sync", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Fd", name: "Fd", pkg: "", typ: $funcType([], [$Uintptr], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Stat", name: "Stat", pkg: "", typ: $funcType([], [FileInfo, $error], false)}, {prop: "readdir", name: "readdir", pkg: "os", typ: $funcType([$Int], [sliceType$2, $error], false)}, {prop: "read", name: "read", pkg: "os", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "pread", name: "pread", pkg: "os", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}, {prop: "write", name: "write", pkg: "os", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "pwrite", name: "pwrite", pkg: "os", typ: $funcType([sliceType$1, $Int64], [$Int, $error], false)}, {prop: "seek", name: "seek", pkg: "os", typ: $funcType([$Int64, $Int], [$Int64, $error], false)}]; - ptrType$12.methods = [{prop: "close", name: "close", pkg: "os", typ: $funcType([], [$error], false)}]; - FileMode.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "IsRegular", name: "IsRegular", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Perm", name: "Perm", pkg: "", typ: $funcType([], [FileMode], false)}]; - ptrType$15.methods = [{prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Mode", name: "Mode", pkg: "", typ: $funcType([], [FileMode], false)}, {prop: "ModTime", name: "ModTime", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}]; - PathError.init([{prop: "Op", name: "Op", pkg: "", typ: $String, tag: ""}, {prop: "Path", name: "Path", pkg: "", typ: $String, tag: ""}, {prop: "Err", name: "Err", pkg: "", typ: $error, tag: ""}]); - SyscallError.init([{prop: "Syscall", name: "Syscall", pkg: "", typ: $String, tag: ""}, {prop: "Err", name: "Err", pkg: "", typ: $error, tag: ""}]); - LinkError.init([{prop: "Op", name: "Op", pkg: "", typ: $String, tag: ""}, {prop: "Old", name: "Old", pkg: "", typ: $String, tag: ""}, {prop: "New", name: "New", pkg: "", typ: $String, tag: ""}, {prop: "Err", name: "Err", pkg: "", typ: $error, tag: ""}]); - File.init([{prop: "file", name: "", pkg: "os", typ: ptrType$12, tag: ""}]); - file.init([{prop: "fd", name: "fd", pkg: "os", typ: $Int, tag: ""}, {prop: "name", name: "name", pkg: "os", typ: $String, tag: ""}, {prop: "dirinfo", name: "dirinfo", pkg: "os", typ: ptrType, tag: ""}]); - dirInfo.init([{prop: "buf", name: "buf", pkg: "os", typ: sliceType$1, tag: ""}, {prop: "nbuf", name: "nbuf", pkg: "os", typ: $Int, tag: ""}, {prop: "bufp", name: "bufp", pkg: "os", typ: $Int, tag: ""}]); - FileInfo.init([{prop: "IsDir", name: "IsDir", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ModTime", name: "ModTime", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "Mode", name: "Mode", pkg: "", typ: $funcType([], [FileMode], false)}, {prop: "Name", name: "Name", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Sys", name: "Sys", pkg: "", typ: $funcType([], [$emptyInterface], false)}]); - fileStat.init([{prop: "name", name: "name", pkg: "os", typ: $String, tag: ""}, {prop: "size", name: "size", pkg: "os", typ: $Int64, tag: ""}, {prop: "mode", name: "mode", pkg: "os", typ: FileMode, tag: ""}, {prop: "modTime", name: "modTime", pkg: "os", typ: time.Time, tag: ""}, {prop: "sys", name: "sys", pkg: "os", typ: syscall.Stat_t, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = atomic.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = syscall.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = time.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $pkg.Args = sliceType.nil; - $pkg.ErrInvalid = errors.New("invalid argument"); - $pkg.ErrPermission = errors.New("permission denied"); - $pkg.ErrExist = errors.New("file already exists"); - $pkg.ErrNotExist = errors.New("file does not exist"); - errFinished = errors.New("os: process already finished"); - $pkg.Stdin = NewFile((syscall.Stdin >>> 0), "/dev/stdin"); - $pkg.Stdout = NewFile((syscall.Stdout >>> 0), "/dev/stdout"); - $pkg.Stderr = NewFile((syscall.Stderr >>> 0), "/dev/stderr"); - lstat = Lstat; - init(); - init$1(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["fmt"] = (function() { - var $pkg = {}, $init, errors, io, math, os, reflect, strconv, sync, utf8, fmtFlags, fmt, State, Formatter, Stringer, GoStringer, buffer, pp, runeUnreader, ScanState, scanError, ss, ssave, sliceType, sliceType$1, ptrType, arrayType, arrayType$1, ptrType$1, arrayType$2, sliceType$2, ptrType$2, ptrType$5, ptrType$25, funcType, padZeroBytes, padSpaceBytes, trueBytes, falseBytes, commaSpaceBytes, nilAngleBytes, nilParenBytes, nilBytes, mapBytes, percentBangBytes, missingBytes, badIndexBytes, panicBytes, extraBytes, irparenBytes, bytesBytes, badWidthBytes, badPrecBytes, noVerbBytes, ppFree, intBits, uintptrBits, byteType, space, ssFree, complexError, boolError, _r, _r$1, init, doPrec, newPrinter, Fprintf, Sprintf, Errorf, Fprint, Fprintln, getField, tooLarge, parsenum, intFromArg, parseArgNumber, isSpace, notSpace, indexRune; - errors = $packages["errors"]; - io = $packages["io"]; - math = $packages["math"]; - os = $packages["os"]; - reflect = $packages["reflect"]; - strconv = $packages["strconv"]; - sync = $packages["sync"]; - utf8 = $packages["unicode/utf8"]; - fmtFlags = $pkg.fmtFlags = $newType(0, $kindStruct, "fmt.fmtFlags", "fmtFlags", "fmt", function(widPresent_, precPresent_, minus_, plus_, sharp_, space_, unicode_, uniQuote_, zero_, plusV_, sharpV_) { - this.$val = this; - if (arguments.length === 0) { - this.widPresent = false; - this.precPresent = false; - this.minus = false; - this.plus = false; - this.sharp = false; - this.space = false; - this.unicode = false; - this.uniQuote = false; - this.zero = false; - this.plusV = false; - this.sharpV = false; - return; - } - this.widPresent = widPresent_; - this.precPresent = precPresent_; - this.minus = minus_; - this.plus = plus_; - this.sharp = sharp_; - this.space = space_; - this.unicode = unicode_; - this.uniQuote = uniQuote_; - this.zero = zero_; - this.plusV = plusV_; - this.sharpV = sharpV_; - }); - fmt = $pkg.fmt = $newType(0, $kindStruct, "fmt.fmt", "fmt", "fmt", function(intbuf_, buf_, wid_, prec_, fmtFlags_) { - this.$val = this; - if (arguments.length === 0) { - this.intbuf = arrayType$1.zero(); - this.buf = ptrType$1.nil; - this.wid = 0; - this.prec = 0; - this.fmtFlags = new fmtFlags.ptr(false, false, false, false, false, false, false, false, false, false, false); - return; - } - this.intbuf = intbuf_; - this.buf = buf_; - this.wid = wid_; - this.prec = prec_; - this.fmtFlags = fmtFlags_; - }); - State = $pkg.State = $newType(8, $kindInterface, "fmt.State", "State", "fmt", null); - Formatter = $pkg.Formatter = $newType(8, $kindInterface, "fmt.Formatter", "Formatter", "fmt", null); - Stringer = $pkg.Stringer = $newType(8, $kindInterface, "fmt.Stringer", "Stringer", "fmt", null); - GoStringer = $pkg.GoStringer = $newType(8, $kindInterface, "fmt.GoStringer", "GoStringer", "fmt", null); - buffer = $pkg.buffer = $newType(12, $kindSlice, "fmt.buffer", "buffer", "fmt", null); - pp = $pkg.pp = $newType(0, $kindStruct, "fmt.pp", "pp", "fmt", function(n_, panicking_, erroring_, buf_, arg_, value_, reordered_, goodArgNum_, runeBuf_, fmt_) { - this.$val = this; - if (arguments.length === 0) { - this.n = 0; - this.panicking = false; - this.erroring = false; - this.buf = buffer.nil; - this.arg = $ifaceNil; - this.value = new reflect.Value.ptr(ptrType.nil, 0, 0); - this.reordered = false; - this.goodArgNum = false; - this.runeBuf = arrayType.zero(); - this.fmt = new fmt.ptr(arrayType$1.zero(), ptrType$1.nil, 0, 0, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false, false, false)); - return; - } - this.n = n_; - this.panicking = panicking_; - this.erroring = erroring_; - this.buf = buf_; - this.arg = arg_; - this.value = value_; - this.reordered = reordered_; - this.goodArgNum = goodArgNum_; - this.runeBuf = runeBuf_; - this.fmt = fmt_; - }); - runeUnreader = $pkg.runeUnreader = $newType(8, $kindInterface, "fmt.runeUnreader", "runeUnreader", "fmt", null); - ScanState = $pkg.ScanState = $newType(8, $kindInterface, "fmt.ScanState", "ScanState", "fmt", null); - scanError = $pkg.scanError = $newType(0, $kindStruct, "fmt.scanError", "scanError", "fmt", function(err_) { - this.$val = this; - if (arguments.length === 0) { - this.err = $ifaceNil; - return; - } - this.err = err_; - }); - ss = $pkg.ss = $newType(0, $kindStruct, "fmt.ss", "ss", "fmt", function(rr_, buf_, peekRune_, prevRune_, count_, atEOF_, ssave_) { - this.$val = this; - if (arguments.length === 0) { - this.rr = $ifaceNil; - this.buf = buffer.nil; - this.peekRune = 0; - this.prevRune = 0; - this.count = 0; - this.atEOF = false; - this.ssave = new ssave.ptr(false, false, false, 0, 0, 0); - return; - } - this.rr = rr_; - this.buf = buf_; - this.peekRune = peekRune_; - this.prevRune = prevRune_; - this.count = count_; - this.atEOF = atEOF_; - this.ssave = ssave_; - }); - ssave = $pkg.ssave = $newType(0, $kindStruct, "fmt.ssave", "ssave", "fmt", function(validSave_, nlIsEnd_, nlIsSpace_, argLimit_, limit_, maxWid_) { - this.$val = this; - if (arguments.length === 0) { - this.validSave = false; - this.nlIsEnd = false; - this.nlIsSpace = false; - this.argLimit = 0; - this.limit = 0; - this.maxWid = 0; - return; - } - this.validSave = validSave_; - this.nlIsEnd = nlIsEnd_; - this.nlIsSpace = nlIsSpace_; - this.argLimit = argLimit_; - this.limit = limit_; - this.maxWid = maxWid_; - }); - sliceType = $sliceType($Uint8); - sliceType$1 = $sliceType($emptyInterface); - ptrType = $ptrType(reflect.rtype); - arrayType = $arrayType($Uint8, 4); - arrayType$1 = $arrayType($Uint8, 65); - ptrType$1 = $ptrType(buffer); - arrayType$2 = $arrayType($Uint16, 2); - sliceType$2 = $sliceType(arrayType$2); - ptrType$2 = $ptrType(pp); - ptrType$5 = $ptrType(ss); - ptrType$25 = $ptrType(fmt); - funcType = $funcType([$Int32], [$Bool], false); - init = function() { - var $ptr, i; - i = 0; - while (true) { - if (!(i < 65)) { break; } - ((i < 0 || i >= padZeroBytes.$length) ? $throwRuntimeError("index out of range") : padZeroBytes.$array[padZeroBytes.$offset + i] = 48); - ((i < 0 || i >= padSpaceBytes.$length) ? $throwRuntimeError("index out of range") : padSpaceBytes.$array[padSpaceBytes.$offset + i] = 32); - i = i + (1) >> 0; - } - }; - fmt.ptr.prototype.clearflags = function() { - var $ptr, f; - f = this; - fmtFlags.copy(f.fmtFlags, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false, false, false)); - }; - fmt.prototype.clearflags = function() { return this.$val.clearflags(); }; - fmt.ptr.prototype.init = function(buf) { - var $ptr, buf, f; - f = this; - f.buf = buf; - f.clearflags(); - }; - fmt.prototype.init = function(buf) { return this.$val.init(buf); }; - fmt.ptr.prototype.computePadding = function(width) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, f, left, leftWidth, padding, rightWidth, w, width; - padding = sliceType.nil; - leftWidth = 0; - rightWidth = 0; - f = this; - left = !f.fmtFlags.minus; - w = f.wid; - if (w < 0) { - left = false; - w = -w; - } - w = w - (width) >> 0; - if (w > 0) { - if (left && f.fmtFlags.zero) { - _tmp = padZeroBytes; - _tmp$1 = w; - _tmp$2 = 0; - padding = _tmp; - leftWidth = _tmp$1; - rightWidth = _tmp$2; - return [padding, leftWidth, rightWidth]; - } - if (left) { - _tmp$3 = padSpaceBytes; - _tmp$4 = w; - _tmp$5 = 0; - padding = _tmp$3; - leftWidth = _tmp$4; - rightWidth = _tmp$5; - return [padding, leftWidth, rightWidth]; - } else { - _tmp$6 = padSpaceBytes; - _tmp$7 = 0; - _tmp$8 = w; - padding = _tmp$6; - leftWidth = _tmp$7; - rightWidth = _tmp$8; - return [padding, leftWidth, rightWidth]; - } - } - return [padding, leftWidth, rightWidth]; - }; - fmt.prototype.computePadding = function(width) { return this.$val.computePadding(width); }; - fmt.ptr.prototype.writePadding = function(n, padding) { - var $ptr, f, m, n, padding; - f = this; - while (true) { - if (!(n > 0)) { break; } - m = n; - if (m > 65) { - m = 65; - } - f.buf.Write($subslice(padding, 0, m)); - n = n - (m) >> 0; - } - }; - fmt.prototype.writePadding = function(n, padding) { return this.$val.writePadding(n, padding); }; - fmt.ptr.prototype.pad = function(b) { - var $ptr, _tuple, b, f, left, padding, right; - f = this; - if (!f.fmtFlags.widPresent || (f.wid === 0)) { - f.buf.Write(b); - return; - } - _tuple = f.computePadding(utf8.RuneCount(b)); - padding = _tuple[0]; - left = _tuple[1]; - right = _tuple[2]; - if (left > 0) { - f.writePadding(left, padding); - } - f.buf.Write(b); - if (right > 0) { - f.writePadding(right, padding); - } - }; - fmt.prototype.pad = function(b) { return this.$val.pad(b); }; - fmt.ptr.prototype.padString = function(s) { - var $ptr, _tuple, f, left, padding, right, s; - f = this; - if (!f.fmtFlags.widPresent || (f.wid === 0)) { - f.buf.WriteString(s); - return; - } - _tuple = f.computePadding(utf8.RuneCountInString(s)); - padding = _tuple[0]; - left = _tuple[1]; - right = _tuple[2]; - if (left > 0) { - f.writePadding(left, padding); - } - f.buf.WriteString(s); - if (right > 0) { - f.writePadding(right, padding); - } - }; - fmt.prototype.padString = function(s) { return this.$val.padString(s); }; - fmt.ptr.prototype.fmt_boolean = function(v) { - var $ptr, f, v; - f = this; - if (v) { - f.pad(trueBytes); - } else { - f.pad(falseBytes); - } - }; - fmt.prototype.fmt_boolean = function(v) { return this.$val.fmt_boolean(v); }; - fmt.ptr.prototype.integer = function(a, base, signedness, digits) { - var $ptr, _1, _2, a, base, buf, digits, f, i, j, negative, next, prec, runeWidth, signedness, ua, width, width$1, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - f = this; - if (f.fmtFlags.precPresent && (f.prec === 0) && (a.$high === 0 && a.$low === 0)) { - return; - } - negative = signedness && (a.$high < 0 || (a.$high === 0 && a.$low < 0)); - if (negative) { - a = new $Int64(-a.$high, -a.$low); - } - buf = $subslice(new sliceType(f.intbuf), 0); - if (f.fmtFlags.widPresent || f.fmtFlags.precPresent || f.fmtFlags.plus || f.fmtFlags.space) { - width = f.wid + f.prec >> 0; - if ((base.$high === 0 && base.$low === 16) && f.fmtFlags.sharp) { - width = width + (2) >> 0; - } - if (f.fmtFlags.unicode) { - width = width + (2) >> 0; - if (f.fmtFlags.uniQuote) { - width = width + (7) >> 0; - } - } - if (negative || f.fmtFlags.plus || f.fmtFlags.space) { - width = width + (1) >> 0; - } - if (width > 65) { - buf = $makeSlice(sliceType, width); - } - } - prec = 0; - if (f.fmtFlags.precPresent) { - prec = f.prec; - f.fmtFlags.zero = false; - } else if (f.fmtFlags.zero && f.fmtFlags.widPresent && !f.fmtFlags.minus && f.wid > 0) { - prec = f.wid; - if (negative || f.fmtFlags.plus || f.fmtFlags.space) { - prec = prec - (1) >> 0; - } - } - i = buf.$length; - ua = new $Uint64(a.$high, a.$low); - _1 = base; - if ((x = new $Uint64(0, 10), (_1.$high === x.$high && _1.$low === x.$low))) { - while (true) { - if (!((ua.$high > 0 || (ua.$high === 0 && ua.$low >= 10)))) { break; } - i = i - (1) >> 0; - next = $div64(ua, new $Uint64(0, 10), false); - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = ((x$4 = new $Uint64(0 + ua.$high, 48 + ua.$low), x$5 = $mul64(next, new $Uint64(0, 10)), new $Uint64(x$4.$high - x$5.$high, x$4.$low - x$5.$low)).$low << 24 >>> 24)); - ua = next; - } - } else if ((x$1 = new $Uint64(0, 16), (_1.$high === x$1.$high && _1.$low === x$1.$low))) { - while (true) { - if (!((ua.$high > 0 || (ua.$high === 0 && ua.$low >= 16)))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(new $Uint64(ua.$high & 0, (ua.$low & 15) >>> 0)))); - ua = $shiftRightUint64(ua, (4)); - } - } else if ((x$2 = new $Uint64(0, 8), (_1.$high === x$2.$high && _1.$low === x$2.$low))) { - while (true) { - if (!((ua.$high > 0 || (ua.$high === 0 && ua.$low >= 8)))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = ((x$6 = new $Uint64(ua.$high & 0, (ua.$low & 7) >>> 0), new $Uint64(0 + x$6.$high, 48 + x$6.$low)).$low << 24 >>> 24)); - ua = $shiftRightUint64(ua, (3)); - } - } else if ((x$3 = new $Uint64(0, 2), (_1.$high === x$3.$high && _1.$low === x$3.$low))) { - while (true) { - if (!((ua.$high > 0 || (ua.$high === 0 && ua.$low >= 2)))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = ((x$7 = new $Uint64(ua.$high & 0, (ua.$low & 1) >>> 0), new $Uint64(0 + x$7.$high, 48 + x$7.$low)).$low << 24 >>> 24)); - ua = $shiftRightUint64(ua, (1)); - } - } else { - $panic(new $String("fmt: unknown base; can't happen")); - } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = digits.charCodeAt($flatten64(ua))); - while (true) { - if (!(i > 0 && prec > (buf.$length - i >> 0))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 48); - } - if (f.fmtFlags.sharp) { - _2 = base; - if ((x$8 = new $Uint64(0, 8), (_2.$high === x$8.$high && _2.$low === x$8.$low))) { - if (!((((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i]) === 48))) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 48); - } - } else if ((x$9 = new $Uint64(0, 16), (_2.$high === x$9.$high && _2.$low === x$9.$low))) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = ((120 + digits.charCodeAt(10) << 24 >>> 24) - 97 << 24 >>> 24)); - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 48); - } - } - if (f.fmtFlags.unicode) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 43); - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 85); - } - if (negative) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 45); - } else if (f.fmtFlags.plus) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 43); - } else if (f.fmtFlags.space) { - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = 32); - } - if (f.fmtFlags.unicode && f.fmtFlags.uniQuote && (a.$high > 0 || (a.$high === 0 && a.$low >= 0)) && (a.$high < 0 || (a.$high === 0 && a.$low <= 1114111)) && strconv.IsPrint(((a.$low + ((a.$high >> 31) * 4294967296)) >> 0))) { - runeWidth = utf8.RuneLen(((a.$low + ((a.$high >> 31) * 4294967296)) >> 0)); - width$1 = (2 + runeWidth >> 0) + 1 >> 0; - $copySlice($subslice(buf, (i - width$1 >> 0)), $subslice(buf, i)); - i = i - (width$1) >> 0; - j = buf.$length - width$1 >> 0; - ((j < 0 || j >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + j] = 32); - j = j + (1) >> 0; - ((j < 0 || j >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + j] = 39); - j = j + (1) >> 0; - utf8.EncodeRune($subslice(buf, j), ((a.$low + ((a.$high >> 31) * 4294967296)) >> 0)); - j = j + (runeWidth) >> 0; - ((j < 0 || j >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + j] = 39); - } - f.pad($subslice(buf, i)); - }; - fmt.prototype.integer = function(a, base, signedness, digits) { return this.$val.integer(a, base, signedness, digits); }; - fmt.ptr.prototype.truncate = function(s) { - var $ptr, _i, _ref, _rune, f, i, n, s; - f = this; - if (f.fmtFlags.precPresent && f.prec < utf8.RuneCountInString(s)) { - n = f.prec; - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.length)) { break; } - _rune = $decodeRune(_ref, _i); - i = _i; - if (n === 0) { - s = s.substring(0, i); - break; - } - n = n - (1) >> 0; - _i += _rune[1]; - } - } - return s; - }; - fmt.prototype.truncate = function(s) { return this.$val.truncate(s); }; - fmt.ptr.prototype.fmt_s = function(s) { - var $ptr, f, s; - f = this; - s = f.truncate(s); - f.padString(s); - }; - fmt.prototype.fmt_s = function(s) { return this.$val.fmt_s(s); }; - fmt.ptr.prototype.fmt_sbx = function(s, b, digits) { - var $ptr, b, buf, c, digits, f, i, n, s, x; - f = this; - n = b.$length; - if (b === sliceType.nil) { - n = s.length; - } - x = (digits.charCodeAt(10) - 97 << 24 >>> 24) + 120 << 24 >>> 24; - buf = sliceType.nil; - i = 0; - while (true) { - if (!(i < n)) { break; } - if (i > 0 && f.fmtFlags.space) { - buf = $append(buf, 32); - } - if (f.fmtFlags.sharp && (f.fmtFlags.space || (i === 0))) { - buf = $append(buf, 48, x); - } - c = 0; - if (b === sliceType.nil) { - c = s.charCodeAt(i); - } else { - c = ((i < 0 || i >= b.$length) ? $throwRuntimeError("index out of range") : b.$array[b.$offset + i]); - } - buf = $append(buf, digits.charCodeAt((c >>> 4 << 24 >>> 24)), digits.charCodeAt(((c & 15) >>> 0))); - i = i + (1) >> 0; - } - f.pad(buf); - }; - fmt.prototype.fmt_sbx = function(s, b, digits) { return this.$val.fmt_sbx(s, b, digits); }; - fmt.ptr.prototype.fmt_sx = function(s, digits) { - var $ptr, digits, f, s; - f = this; - if (f.fmtFlags.precPresent && f.prec < s.length) { - s = s.substring(0, f.prec); - } - f.fmt_sbx(s, sliceType.nil, digits); - }; - fmt.prototype.fmt_sx = function(s, digits) { return this.$val.fmt_sx(s, digits); }; - fmt.ptr.prototype.fmt_bx = function(b, digits) { - var $ptr, b, digits, f; - f = this; - if (f.fmtFlags.precPresent && f.prec < b.$length) { - b = $subslice(b, 0, f.prec); - } - f.fmt_sbx("", b, digits); - }; - fmt.prototype.fmt_bx = function(b, digits) { return this.$val.fmt_bx(b, digits); }; - fmt.ptr.prototype.fmt_q = function(s) { - var $ptr, f, quoted, s; - f = this; - s = f.truncate(s); - quoted = ""; - if (f.fmtFlags.sharp && strconv.CanBackquote(s)) { - quoted = "`" + s + "`"; - } else { - if (f.fmtFlags.plus) { - quoted = strconv.QuoteToASCII(s); - } else { - quoted = strconv.Quote(s); - } - } - f.padString(quoted); - }; - fmt.prototype.fmt_q = function(s) { return this.$val.fmt_q(s); }; - fmt.ptr.prototype.fmt_qc = function(c) { - var $ptr, c, f, quoted; - f = this; - quoted = sliceType.nil; - if (f.fmtFlags.plus) { - quoted = strconv.AppendQuoteRuneToASCII($subslice(new sliceType(f.intbuf), 0, 0), ((c.$low + ((c.$high >> 31) * 4294967296)) >> 0)); - } else { - quoted = strconv.AppendQuoteRune($subslice(new sliceType(f.intbuf), 0, 0), ((c.$low + ((c.$high >> 31) * 4294967296)) >> 0)); - } - f.pad(quoted); - }; - fmt.prototype.fmt_qc = function(c) { return this.$val.fmt_qc(c); }; - doPrec = function(f, def) { - var $ptr, def, f; - if (f.fmtFlags.precPresent) { - return f.prec; - } - return def; - }; - fmt.ptr.prototype.formatFloat = function(v, verb, prec, n) { - var $ptr, f, n, num, prec, v, verb, $deferred; - /* */ var $err = null; try { $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - f = this; - num = strconv.AppendFloat($subslice(new sliceType(f.intbuf), 0, 1), v, verb, prec, n); - if (((1 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 1]) === 45) || ((1 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 1]) === 43)) { - num = $subslice(num, 1); - } else { - (0 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 0] = 43); - } - if (math.IsInf(v, 0)) { - if (f.fmtFlags.zero) { - $deferred.push([(function() { - var $ptr; - f.fmtFlags.zero = true; - }), []]); - f.fmtFlags.zero = false; - } - } - if (f.fmtFlags.zero && f.fmtFlags.widPresent && f.wid > num.$length) { - if (f.fmtFlags.space && v >= 0) { - f.buf.WriteByte(32); - f.wid = f.wid - (1) >> 0; - } else if (f.fmtFlags.plus || v < 0) { - f.buf.WriteByte((0 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 0])); - f.wid = f.wid - (1) >> 0; - } - f.pad($subslice(num, 1)); - return; - } - if (f.fmtFlags.space && ((0 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 0]) === 43)) { - (0 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 0] = 32); - f.pad(num); - return; - } - if (f.fmtFlags.plus || ((0 >= num.$length ? $throwRuntimeError("index out of range") : num.$array[num.$offset + 0]) === 45) || math.IsInf(v, 0)) { - f.pad(num); - return; - } - f.pad($subslice(num, 1)); - /* */ } catch(err) { $err = err; } finally { $callDeferred($deferred, $err); } - }; - fmt.prototype.formatFloat = function(v, verb, prec, n) { return this.$val.formatFloat(v, verb, prec, n); }; - fmt.ptr.prototype.fmt_e64 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 101, doPrec(f, 6), 64); - }; - fmt.prototype.fmt_e64 = function(v) { return this.$val.fmt_e64(v); }; - fmt.ptr.prototype.fmt_E64 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 69, doPrec(f, 6), 64); - }; - fmt.prototype.fmt_E64 = function(v) { return this.$val.fmt_E64(v); }; - fmt.ptr.prototype.fmt_f64 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 102, doPrec(f, 6), 64); - }; - fmt.prototype.fmt_f64 = function(v) { return this.$val.fmt_f64(v); }; - fmt.ptr.prototype.fmt_g64 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 103, doPrec(f, -1), 64); - }; - fmt.prototype.fmt_g64 = function(v) { return this.$val.fmt_g64(v); }; - fmt.ptr.prototype.fmt_G64 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 71, doPrec(f, -1), 64); - }; - fmt.prototype.fmt_G64 = function(v) { return this.$val.fmt_G64(v); }; - fmt.ptr.prototype.fmt_fb64 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 98, 0, 64); - }; - fmt.prototype.fmt_fb64 = function(v) { return this.$val.fmt_fb64(v); }; - fmt.ptr.prototype.fmt_e32 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 101, doPrec(f, 6), 32); - }; - fmt.prototype.fmt_e32 = function(v) { return this.$val.fmt_e32(v); }; - fmt.ptr.prototype.fmt_E32 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 69, doPrec(f, 6), 32); - }; - fmt.prototype.fmt_E32 = function(v) { return this.$val.fmt_E32(v); }; - fmt.ptr.prototype.fmt_f32 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 102, doPrec(f, 6), 32); - }; - fmt.prototype.fmt_f32 = function(v) { return this.$val.fmt_f32(v); }; - fmt.ptr.prototype.fmt_g32 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 103, doPrec(f, -1), 32); - }; - fmt.prototype.fmt_g32 = function(v) { return this.$val.fmt_g32(v); }; - fmt.ptr.prototype.fmt_G32 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 71, doPrec(f, -1), 32); - }; - fmt.prototype.fmt_G32 = function(v) { return this.$val.fmt_G32(v); }; - fmt.ptr.prototype.fmt_fb32 = function(v) { - var $ptr, f, v; - f = this; - f.formatFloat(v, 98, 0, 32); - }; - fmt.prototype.fmt_fb32 = function(v) { return this.$val.fmt_fb32(v); }; - fmt.ptr.prototype.fmt_c64 = function(v, verb) { - var $ptr, f, v, verb; - f = this; - f.fmt_complex(v.$real, v.$imag, 32, verb); - }; - fmt.prototype.fmt_c64 = function(v, verb) { return this.$val.fmt_c64(v, verb); }; - fmt.ptr.prototype.fmt_c128 = function(v, verb) { - var $ptr, f, v, verb; - f = this; - f.fmt_complex(v.$real, v.$imag, 64, verb); - }; - fmt.prototype.fmt_c128 = function(v, verb) { return this.$val.fmt_c128(v, verb); }; - fmt.ptr.prototype.fmt_complex = function(r, j, size, verb) { - var $ptr, _3, f, i, j, oldPlus, oldSpace, oldWid, r, size, verb; - f = this; - f.buf.WriteByte(40); - oldPlus = f.fmtFlags.plus; - oldSpace = f.fmtFlags.space; - oldWid = f.wid; - i = 0; - while (true) { - _3 = verb; - if (_3 === (98)) { - f.formatFloat(r, 98, 0, size); - } else if (_3 === (101)) { - f.formatFloat(r, 101, doPrec(f, 6), size); - } else if (_3 === (69)) { - f.formatFloat(r, 69, doPrec(f, 6), size); - } else if ((_3 === (102)) || (_3 === (70))) { - f.formatFloat(r, 102, doPrec(f, 6), size); - } else if (_3 === (103)) { - f.formatFloat(r, 103, doPrec(f, -1), size); - } else if (_3 === (71)) { - f.formatFloat(r, 71, doPrec(f, -1), size); - } - if (!((i === 0))) { - break; - } - f.fmtFlags.plus = true; - f.fmtFlags.space = false; - f.wid = oldWid; - r = j; - i = i + (1) >> 0; - } - f.fmtFlags.space = oldSpace; - f.fmtFlags.plus = oldPlus; - f.wid = oldWid; - f.buf.Write(irparenBytes); - }; - fmt.prototype.fmt_complex = function(r, j, size, verb) { return this.$val.fmt_complex(r, j, size, verb); }; - $ptrType(buffer).prototype.Write = function(p) { - var $ptr, _tmp, _tmp$1, b, err, n, p; - n = 0; - err = $ifaceNil; - b = this; - b.$set($appendSlice(b.$get(), p)); - _tmp = p.$length; - _tmp$1 = $ifaceNil; - n = _tmp; - err = _tmp$1; - return [n, err]; - }; - $ptrType(buffer).prototype.WriteString = function(s) { - var $ptr, _tmp, _tmp$1, b, err, n, s; - n = 0; - err = $ifaceNil; - b = this; - b.$set($appendSlice(b.$get(), s)); - _tmp = s.length; - _tmp$1 = $ifaceNil; - n = _tmp; - err = _tmp$1; - return [n, err]; - }; - $ptrType(buffer).prototype.WriteByte = function(c) { - var $ptr, b, c; - b = this; - b.$set($append(b.$get(), c)); - return $ifaceNil; - }; - $ptrType(buffer).prototype.WriteRune = function(r) { - var $ptr, b, bp, n, r, w, x; - bp = this; - if (r < 128) { - bp.$set($append(bp.$get(), (r << 24 >>> 24))); - return $ifaceNil; - } - b = bp.$get(); - n = b.$length; - while (true) { - if (!((n + 4 >> 0) > b.$capacity)) { break; } - b = $append(b, 0); - } - w = utf8.EncodeRune((x = $subslice(b, n, (n + 4 >> 0)), $subslice(new sliceType(x.$array), x.$offset, x.$offset + x.$length)), r); - bp.$set($subslice(b, 0, (n + w >> 0))); - return $ifaceNil; - }; - newPrinter = function() { - var $ptr, _r$2, p, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$2 = ppFree.Get(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - p = $assertType(_r$2, ptrType$2); - p.panicking = false; - p.erroring = false; - p.fmt.init((p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p)))); - return p; - /* */ } return; } if ($f === undefined) { $f = { $blk: newPrinter }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.ptr.prototype.free = function() { - var $ptr, p; - p = this; - if (p.buf.$capacity > 1024) { - return; - } - p.buf = $subslice(p.buf, 0, 0); - p.arg = $ifaceNil; - p.value = new reflect.Value.ptr(ptrType.nil, 0, 0); - ppFree.Put(p); - }; - pp.prototype.free = function() { return this.$val.free(); }; - pp.ptr.prototype.Width = function() { - var $ptr, _tmp, _tmp$1, ok, p, wid; - wid = 0; - ok = false; - p = this; - _tmp = p.fmt.wid; - _tmp$1 = p.fmt.fmtFlags.widPresent; - wid = _tmp; - ok = _tmp$1; - return [wid, ok]; - }; - pp.prototype.Width = function() { return this.$val.Width(); }; - pp.ptr.prototype.Precision = function() { - var $ptr, _tmp, _tmp$1, ok, p, prec; - prec = 0; - ok = false; - p = this; - _tmp = p.fmt.prec; - _tmp$1 = p.fmt.fmtFlags.precPresent; - prec = _tmp; - ok = _tmp$1; - return [prec, ok]; - }; - pp.prototype.Precision = function() { return this.$val.Precision(); }; - pp.ptr.prototype.Flag = function(b) { - var $ptr, _1, b, p; - p = this; - _1 = b; - if (_1 === (45)) { - return p.fmt.fmtFlags.minus; - } else if (_1 === (43)) { - return p.fmt.fmtFlags.plus; - } else if (_1 === (35)) { - return p.fmt.fmtFlags.sharp; - } else if (_1 === (32)) { - return p.fmt.fmtFlags.space; - } else if (_1 === (48)) { - return p.fmt.fmtFlags.zero; - } - return false; - }; - pp.prototype.Flag = function(b) { return this.$val.Flag(b); }; - pp.ptr.prototype.add = function(c) { - var $ptr, c, p; - p = this; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteRune(c); - }; - pp.prototype.add = function(c) { return this.$val.add(c); }; - pp.ptr.prototype.Write = function(b) { - var $ptr, _tuple, b, err, p, ret; - ret = 0; - err = $ifaceNil; - p = this; - _tuple = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(b); - ret = _tuple[0]; - err = _tuple[1]; - return [ret, err]; - }; - pp.prototype.Write = function(b) { return this.$val.Write(b); }; - Fprintf = function(w, format, a) { - var $ptr, _r$2, _r$3, _tuple, a, err, format, n, p, w, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; a = $f.a; err = $f.err; format = $f.format; n = $f.n; p = $f.p; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - _r$2 = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - p = _r$2; - $r = p.doPrintf(format, a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _r$3 = w.Write((x = p.buf, $subslice(new sliceType(x.$array), x.$offset, x.$offset + x.$length))); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _tuple = _r$3; - n = _tuple[0]; - err = _tuple[1]; - p.free(); - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Fprintf }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.format = format; $f.n = n; $f.p = p; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Fprintf = Fprintf; - Sprintf = function(format, a) { - var $ptr, _r$2, a, format, p, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; a = $f.a; format = $f.format; p = $f.p; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$2 = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - p = _r$2; - $r = p.doPrintf(format, a); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - s = $bytesToString(p.buf); - p.free(); - return s; - /* */ } return; } if ($f === undefined) { $f = { $blk: Sprintf }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.a = a; $f.format = format; $f.p = p; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Sprintf = Sprintf; - Errorf = function(format, a) { - var $ptr, _r$2, _r$3, a, format, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; a = $f.a; format = $f.format; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$2 = Sprintf(format, a); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = errors.New(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ $s = 3; case 3: - return _r$3; - /* */ } return; } if ($f === undefined) { $f = { $blk: Errorf }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.a = a; $f.format = format; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Errorf = Errorf; - Fprint = function(w, a) { - var $ptr, _r$2, _r$3, _tuple, a, err, n, p, w, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; p = $f.p; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - _r$2 = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - p = _r$2; - $r = p.doPrint(a, false, false); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _r$3 = w.Write((x = p.buf, $subslice(new sliceType(x.$array), x.$offset, x.$offset + x.$length))); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _tuple = _r$3; - n = _tuple[0]; - err = _tuple[1]; - p.free(); - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Fprint }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Fprint = Fprint; - Fprintln = function(w, a) { - var $ptr, _r$2, _r$3, _tuple, a, err, n, p, w, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; a = $f.a; err = $f.err; n = $f.n; p = $f.p; w = $f.w; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - _r$2 = newPrinter(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - p = _r$2; - $r = p.doPrint(a, true, true); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _r$3 = w.Write((x = p.buf, $subslice(new sliceType(x.$array), x.$offset, x.$offset + x.$length))); /* */ $s = 3; case 3: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _tuple = _r$3; - n = _tuple[0]; - err = _tuple[1]; - p.free(); - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Fprintln }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.a = a; $f.err = err; $f.n = n; $f.p = p; $f.w = w; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Fprintln = Fprintln; - getField = function(v, i) { - var $ptr, _r$2, _r$3, i, v, val, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; i = $f.i; v = $f.v; val = $f.val; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _r$2 = v.Field(i); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - val = _r$2; - /* */ if ((val.Kind() === 20) && !val.IsNil()) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if ((val.Kind() === 20) && !val.IsNil()) { */ case 2: - _r$3 = val.Elem(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - val = _r$3; - /* } */ case 3: - return val; - /* */ } return; } if ($f === undefined) { $f = { $blk: getField }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.i = i; $f.v = v; $f.val = val; $f.$s = $s; $f.$r = $r; return $f; - }; - tooLarge = function(x) { - var $ptr, x; - return x > 1000000 || x < -1000000; - }; - parsenum = function(s, start, end) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, end, isnum, newi, num, s, start; - num = 0; - isnum = false; - newi = 0; - if (start >= end) { - _tmp = 0; - _tmp$1 = false; - _tmp$2 = end; - num = _tmp; - isnum = _tmp$1; - newi = _tmp$2; - return [num, isnum, newi]; - } - newi = start; - while (true) { - if (!(newi < end && 48 <= s.charCodeAt(newi) && s.charCodeAt(newi) <= 57)) { break; } - if (tooLarge(num)) { - _tmp$3 = 0; - _tmp$4 = false; - _tmp$5 = end; - num = _tmp$3; - isnum = _tmp$4; - newi = _tmp$5; - return [num, isnum, newi]; - } - num = ($imul(num, 10)) + ((s.charCodeAt(newi) - 48 << 24 >>> 24) >> 0) >> 0; - isnum = true; - newi = newi + (1) >> 0; - } - return [num, isnum, newi]; - }; - pp.ptr.prototype.unknownType = function(v) { - var $ptr, _r$2, _r$3, p, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; p = $f.p; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - p = this; - if (!v.IsValid()) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); - return; - } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(63); - _r$2 = v.Type().String(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$3; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(63); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.unknownType }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.p = p; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.unknownType = function(v) { return this.$val.unknownType(v); }; - pp.ptr.prototype.badVerb = function(verb) { - var $ptr, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, p, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; p = $f.p; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - p.erroring = true; - p.add(37); - p.add(33); - p.add(verb); - p.add(40); - /* */ if (!($interfaceIsEqual(p.arg, $ifaceNil))) { $s = 2; continue; } - /* */ if (p.value.IsValid()) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (!($interfaceIsEqual(p.arg, $ifaceNil))) { */ case 2: - _r$2 = reflect.TypeOf(p.arg).String(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$2); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$3; - p.add(61); - _r$4 = p.printArg(p.arg, 118, 0); /* */ $s = 8; case 8: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _r$4; - $s = 5; continue; - /* } else if (p.value.IsValid()) { */ case 3: - _r$5 = p.value.Type().String(); /* */ $s = 9; case 9: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _r$6 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$5); /* */ $s = 10; case 10: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _r$6; - p.add(61); - _r$7 = p.printValue(p.value, 118, 0); /* */ $s = 11; case 11: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - _r$7; - $s = 5; continue; - /* } else { */ case 4: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); - /* } */ case 5: - case 1: - p.add(41); - p.erroring = false; - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.badVerb }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f.p = p; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.badVerb = function(verb) { return this.$val.badVerb(verb); }; - pp.ptr.prototype.fmtBool = function(v, verb) { - var $ptr, _2, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _2 = $f._2; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - _2 = verb; - /* */ if ((_2 === (116)) || (_2 === (118))) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if ((_2 === (116)) || (_2 === (118))) { */ case 2: - p.fmt.fmt_boolean(v); - $s = 4; continue; - /* } else { */ case 3: - $r = p.badVerb(verb); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 4: - case 1: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtBool }; } $f.$ptr = $ptr; $f._2 = _2; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.fmtBool = function(v, verb) { return this.$val.fmtBool(v, verb); }; - pp.ptr.prototype.fmtC = function(c) { - var $ptr, c, p, r, w, x; - p = this; - r = ((c.$low + ((c.$high >> 31) * 4294967296)) >> 0); - if (!((x = new $Int64(0, r), (x.$high === c.$high && x.$low === c.$low)))) { - r = 65533; - } - w = utf8.EncodeRune($subslice(new sliceType(p.runeBuf), 0, 4), r); - p.fmt.pad($subslice(new sliceType(p.runeBuf), 0, w)); - }; - pp.prototype.fmtC = function(c) { return this.$val.fmtC(c); }; - pp.ptr.prototype.fmtInt64 = function(v, verb) { - var $ptr, _3, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _3 = $f._3; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - _3 = verb; - /* */ if (_3 === (98)) { $s = 2; continue; } - /* */ if (_3 === (99)) { $s = 3; continue; } - /* */ if ((_3 === (100)) || (_3 === (118))) { $s = 4; continue; } - /* */ if (_3 === (111)) { $s = 5; continue; } - /* */ if (_3 === (113)) { $s = 6; continue; } - /* */ if (_3 === (120)) { $s = 7; continue; } - /* */ if (_3 === (85)) { $s = 8; continue; } - /* */ if (_3 === (88)) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (_3 === (98)) { */ case 2: - p.fmt.integer(v, new $Uint64(0, 2), true, "0123456789abcdef"); - $s = 11; continue; - /* } else if (_3 === (99)) { */ case 3: - p.fmtC(v); - $s = 11; continue; - /* } else if ((_3 === (100)) || (_3 === (118))) { */ case 4: - p.fmt.integer(v, new $Uint64(0, 10), true, "0123456789abcdef"); - $s = 11; continue; - /* } else if (_3 === (111)) { */ case 5: - p.fmt.integer(v, new $Uint64(0, 8), true, "0123456789abcdef"); - $s = 11; continue; - /* } else if (_3 === (113)) { */ case 6: - /* */ if ((0 < v.$high || (0 === v.$high && 0 <= v.$low)) && (v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { $s = 12; continue; } - /* */ $s = 13; continue; - /* if ((0 < v.$high || (0 === v.$high && 0 <= v.$low)) && (v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { */ case 12: - p.fmt.fmt_qc(v); - $s = 14; continue; - /* } else { */ case 13: - $r = p.badVerb(verb); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 14: - $s = 11; continue; - /* } else if (_3 === (120)) { */ case 7: - p.fmt.integer(v, new $Uint64(0, 16), true, "0123456789abcdef"); - $s = 11; continue; - /* } else if (_3 === (85)) { */ case 8: - p.fmtUnicode(v); - $s = 11; continue; - /* } else if (_3 === (88)) { */ case 9: - p.fmt.integer(v, new $Uint64(0, 16), true, "0123456789ABCDEF"); - $s = 11; continue; - /* } else { */ case 10: - $r = p.badVerb(verb); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 11: - case 1: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtInt64 }; } $f.$ptr = $ptr; $f._3 = _3; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.fmtInt64 = function(v, verb) { return this.$val.fmtInt64(v, verb); }; - pp.ptr.prototype.fmt0x64 = function(v, leading0x) { - var $ptr, leading0x, p, sharp, v; - p = this; - sharp = p.fmt.fmtFlags.sharp; - p.fmt.fmtFlags.sharp = leading0x; - p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 16), false, "0123456789abcdef"); - p.fmt.fmtFlags.sharp = sharp; - }; - pp.prototype.fmt0x64 = function(v, leading0x) { return this.$val.fmt0x64(v, leading0x); }; - pp.ptr.prototype.fmtUnicode = function(v) { - var $ptr, p, prec, precPresent, sharp, v; - p = this; - precPresent = p.fmt.fmtFlags.precPresent; - sharp = p.fmt.fmtFlags.sharp; - p.fmt.fmtFlags.sharp = false; - prec = p.fmt.prec; - if (!precPresent) { - p.fmt.prec = 4; - p.fmt.fmtFlags.precPresent = true; - } - p.fmt.fmtFlags.unicode = true; - p.fmt.fmtFlags.uniQuote = sharp; - p.fmt.integer(v, new $Uint64(0, 16), false, "0123456789ABCDEF"); - p.fmt.fmtFlags.unicode = false; - p.fmt.fmtFlags.uniQuote = false; - p.fmt.prec = prec; - p.fmt.fmtFlags.precPresent = precPresent; - p.fmt.fmtFlags.sharp = sharp; - }; - pp.prototype.fmtUnicode = function(v) { return this.$val.fmtUnicode(v); }; - pp.ptr.prototype.fmtUint64 = function(v, verb) { - var $ptr, _4, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _4 = $f._4; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - _4 = verb; - /* */ if (_4 === (98)) { $s = 2; continue; } - /* */ if (_4 === (99)) { $s = 3; continue; } - /* */ if (_4 === (100)) { $s = 4; continue; } - /* */ if (_4 === (118)) { $s = 5; continue; } - /* */ if (_4 === (111)) { $s = 6; continue; } - /* */ if (_4 === (113)) { $s = 7; continue; } - /* */ if (_4 === (120)) { $s = 8; continue; } - /* */ if (_4 === (88)) { $s = 9; continue; } - /* */ if (_4 === (85)) { $s = 10; continue; } - /* */ $s = 11; continue; - /* if (_4 === (98)) { */ case 2: - p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 2), false, "0123456789abcdef"); - $s = 12; continue; - /* } else if (_4 === (99)) { */ case 3: - p.fmtC(new $Int64(v.$high, v.$low)); - $s = 12; continue; - /* } else if (_4 === (100)) { */ case 4: - p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 10), false, "0123456789abcdef"); - $s = 12; continue; - /* } else if (_4 === (118)) { */ case 5: - if (p.fmt.fmtFlags.sharpV) { - p.fmt0x64(v, true); - } else { - p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 10), false, "0123456789abcdef"); - } - $s = 12; continue; - /* } else if (_4 === (111)) { */ case 6: - p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 8), false, "0123456789abcdef"); - $s = 12; continue; - /* } else if (_4 === (113)) { */ case 7: - /* */ if ((0 < v.$high || (0 === v.$high && 0 <= v.$low)) && (v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { $s = 13; continue; } - /* */ $s = 14; continue; - /* if ((0 < v.$high || (0 === v.$high && 0 <= v.$low)) && (v.$high < 0 || (v.$high === 0 && v.$low <= 1114111))) { */ case 13: - p.fmt.fmt_qc(new $Int64(v.$high, v.$low)); - $s = 15; continue; - /* } else { */ case 14: - $r = p.badVerb(verb); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 15: - $s = 12; continue; - /* } else if (_4 === (120)) { */ case 8: - p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 16), false, "0123456789abcdef"); - $s = 12; continue; - /* } else if (_4 === (88)) { */ case 9: - p.fmt.integer(new $Int64(v.$high, v.$low), new $Uint64(0, 16), false, "0123456789ABCDEF"); - $s = 12; continue; - /* } else if (_4 === (85)) { */ case 10: - p.fmtUnicode(new $Int64(v.$high, v.$low)); - $s = 12; continue; - /* } else { */ case 11: - $r = p.badVerb(verb); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 12: - case 1: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtUint64 }; } $f.$ptr = $ptr; $f._4 = _4; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.fmtUint64 = function(v, verb) { return this.$val.fmtUint64(v, verb); }; - pp.ptr.prototype.fmtFloat32 = function(v, verb) { - var $ptr, _5, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _5 = $f._5; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - _5 = verb; - /* */ if (_5 === (98)) { $s = 2; continue; } - /* */ if (_5 === (101)) { $s = 3; continue; } - /* */ if (_5 === (69)) { $s = 4; continue; } - /* */ if ((_5 === (102)) || (_5 === (70))) { $s = 5; continue; } - /* */ if ((_5 === (103)) || (_5 === (118))) { $s = 6; continue; } - /* */ if (_5 === (71)) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (_5 === (98)) { */ case 2: - p.fmt.fmt_fb32(v); - $s = 9; continue; - /* } else if (_5 === (101)) { */ case 3: - p.fmt.fmt_e32(v); - $s = 9; continue; - /* } else if (_5 === (69)) { */ case 4: - p.fmt.fmt_E32(v); - $s = 9; continue; - /* } else if ((_5 === (102)) || (_5 === (70))) { */ case 5: - p.fmt.fmt_f32(v); - $s = 9; continue; - /* } else if ((_5 === (103)) || (_5 === (118))) { */ case 6: - p.fmt.fmt_g32(v); - $s = 9; continue; - /* } else if (_5 === (71)) { */ case 7: - p.fmt.fmt_G32(v); - $s = 9; continue; - /* } else { */ case 8: - $r = p.badVerb(verb); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 9: - case 1: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtFloat32 }; } $f.$ptr = $ptr; $f._5 = _5; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.fmtFloat32 = function(v, verb) { return this.$val.fmtFloat32(v, verb); }; - pp.ptr.prototype.fmtFloat64 = function(v, verb) { - var $ptr, _6, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _6 = $f._6; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - _6 = verb; - /* */ if (_6 === (98)) { $s = 2; continue; } - /* */ if (_6 === (101)) { $s = 3; continue; } - /* */ if (_6 === (69)) { $s = 4; continue; } - /* */ if ((_6 === (102)) || (_6 === (70))) { $s = 5; continue; } - /* */ if ((_6 === (103)) || (_6 === (118))) { $s = 6; continue; } - /* */ if (_6 === (71)) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (_6 === (98)) { */ case 2: - p.fmt.fmt_fb64(v); - $s = 9; continue; - /* } else if (_6 === (101)) { */ case 3: - p.fmt.fmt_e64(v); - $s = 9; continue; - /* } else if (_6 === (69)) { */ case 4: - p.fmt.fmt_E64(v); - $s = 9; continue; - /* } else if ((_6 === (102)) || (_6 === (70))) { */ case 5: - p.fmt.fmt_f64(v); - $s = 9; continue; - /* } else if ((_6 === (103)) || (_6 === (118))) { */ case 6: - p.fmt.fmt_g64(v); - $s = 9; continue; - /* } else if (_6 === (71)) { */ case 7: - p.fmt.fmt_G64(v); - $s = 9; continue; - /* } else { */ case 8: - $r = p.badVerb(verb); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 9: - case 1: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtFloat64 }; } $f.$ptr = $ptr; $f._6 = _6; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.fmtFloat64 = function(v, verb) { return this.$val.fmtFloat64(v, verb); }; - pp.ptr.prototype.fmtComplex64 = function(v, verb) { - var $ptr, _7, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _7 = $f._7; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - _7 = verb; - /* */ if ((_7 === (98)) || (_7 === (101)) || (_7 === (69)) || (_7 === (102)) || (_7 === (70)) || (_7 === (103)) || (_7 === (71))) { $s = 2; continue; } - /* */ if (_7 === (118)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if ((_7 === (98)) || (_7 === (101)) || (_7 === (69)) || (_7 === (102)) || (_7 === (70)) || (_7 === (103)) || (_7 === (71))) { */ case 2: - p.fmt.fmt_c64(v, verb); - $s = 5; continue; - /* } else if (_7 === (118)) { */ case 3: - p.fmt.fmt_c64(v, 103); - $s = 5; continue; - /* } else { */ case 4: - $r = p.badVerb(verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 5: - case 1: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtComplex64 }; } $f.$ptr = $ptr; $f._7 = _7; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.fmtComplex64 = function(v, verb) { return this.$val.fmtComplex64(v, verb); }; - pp.ptr.prototype.fmtComplex128 = function(v, verb) { - var $ptr, _8, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _8 = $f._8; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - _8 = verb; - /* */ if ((_8 === (98)) || (_8 === (101)) || (_8 === (69)) || (_8 === (102)) || (_8 === (70)) || (_8 === (103)) || (_8 === (71))) { $s = 2; continue; } - /* */ if (_8 === (118)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if ((_8 === (98)) || (_8 === (101)) || (_8 === (69)) || (_8 === (102)) || (_8 === (70)) || (_8 === (103)) || (_8 === (71))) { */ case 2: - p.fmt.fmt_c128(v, verb); - $s = 5; continue; - /* } else if (_8 === (118)) { */ case 3: - p.fmt.fmt_c128(v, 103); - $s = 5; continue; - /* } else { */ case 4: - $r = p.badVerb(verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 5: - case 1: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtComplex128 }; } $f.$ptr = $ptr; $f._8 = _8; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.fmtComplex128 = function(v, verb) { return this.$val.fmtComplex128(v, verb); }; - pp.ptr.prototype.fmtString = function(v, verb) { - var $ptr, _9, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _9 = $f._9; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - _9 = verb; - /* */ if (_9 === (118)) { $s = 2; continue; } - /* */ if (_9 === (115)) { $s = 3; continue; } - /* */ if (_9 === (120)) { $s = 4; continue; } - /* */ if (_9 === (88)) { $s = 5; continue; } - /* */ if (_9 === (113)) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if (_9 === (118)) { */ case 2: - if (p.fmt.fmtFlags.sharpV) { - p.fmt.fmt_q(v); - } else { - p.fmt.fmt_s(v); - } - $s = 8; continue; - /* } else if (_9 === (115)) { */ case 3: - p.fmt.fmt_s(v); - $s = 8; continue; - /* } else if (_9 === (120)) { */ case 4: - p.fmt.fmt_sx(v, "0123456789abcdef"); - $s = 8; continue; - /* } else if (_9 === (88)) { */ case 5: - p.fmt.fmt_sx(v, "0123456789ABCDEF"); - $s = 8; continue; - /* } else if (_9 === (113)) { */ case 6: - p.fmt.fmt_q(v); - $s = 8; continue; - /* } else { */ case 7: - $r = p.badVerb(verb); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 8: - case 1: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtString }; } $f.$ptr = $ptr; $f._9 = _9; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.fmtString = function(v, verb) { return this.$val.fmtString(v, verb); }; - pp.ptr.prototype.fmtBytes = function(v, verb, typ, depth) { - var $ptr, _10, _i, _r$2, _r$3, _r$4, _r$5, _r$6, _ref, c, depth, i, p, typ, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _10 = $f._10; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _ref = $f._ref; c = $f.c; depth = $f.depth; i = $f.i; p = $f.p; typ = $f.typ; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - /* */ if ((verb === 118) || (verb === 100)) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if ((verb === 118) || (verb === 100)) { */ case 1: - /* */ if (p.fmt.fmtFlags.sharpV) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (p.fmt.fmtFlags.sharpV) { */ case 3: - /* */ if (v === sliceType.nil) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if (v === sliceType.nil) { */ case 6: - /* */ if ($interfaceIsEqual(typ, $ifaceNil)) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if ($interfaceIsEqual(typ, $ifaceNil)) { */ case 8: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("[]byte(nil)"); - $s = 10; continue; - /* } else { */ case 9: - _r$2 = typ.String(); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$2); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$3; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilParenBytes); - /* } */ case 10: - return; - /* } */ case 7: - /* */ if ($interfaceIsEqual(typ, $ifaceNil)) { $s = 13; continue; } - /* */ $s = 14; continue; - /* if ($interfaceIsEqual(typ, $ifaceNil)) { */ case 13: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(bytesBytes); - $s = 15; continue; - /* } else { */ case 14: - _r$4 = typ.String(); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _r$5 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$4); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _r$5; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); - /* } */ case 15: - $s = 5; continue; - /* } else { */ case 4: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(91); - /* } */ case 5: - _ref = v; - _i = 0; - /* while (true) { */ case 18: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 19; continue; } - i = _i; - c = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (i > 0) { - if (p.fmt.fmtFlags.sharpV) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(commaSpaceBytes); - } else { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); - } - } - _r$6 = p.printArg(new $Uint8(c), 118, depth + 1 >> 0); /* */ $s = 20; case 20: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _r$6; - _i++; - /* } */ $s = 18; continue; case 19: - if (p.fmt.fmtFlags.sharpV) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); - } else { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); - } - return; - /* } */ case 2: - _10 = verb; - /* */ if (_10 === (115)) { $s = 22; continue; } - /* */ if (_10 === (120)) { $s = 23; continue; } - /* */ if (_10 === (88)) { $s = 24; continue; } - /* */ if (_10 === (113)) { $s = 25; continue; } - /* */ $s = 26; continue; - /* if (_10 === (115)) { */ case 22: - p.fmt.fmt_s($bytesToString(v)); - $s = 27; continue; - /* } else if (_10 === (120)) { */ case 23: - p.fmt.fmt_bx(v, "0123456789abcdef"); - $s = 27; continue; - /* } else if (_10 === (88)) { */ case 24: - p.fmt.fmt_bx(v, "0123456789ABCDEF"); - $s = 27; continue; - /* } else if (_10 === (113)) { */ case 25: - p.fmt.fmt_q($bytesToString(v)); - $s = 27; continue; - /* } else { */ case 26: - $r = p.badVerb(verb); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 27: - case 21: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtBytes }; } $f.$ptr = $ptr; $f._10 = _10; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._ref = _ref; $f.c = c; $f.depth = depth; $f.i = i; $f.p = p; $f.typ = typ; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.fmtBytes = function(v, verb, typ, depth) { return this.$val.fmtBytes(v, verb, typ, depth); }; - pp.ptr.prototype.fmtPointer = function(value, verb) { - var $ptr, _11, _12, _r$2, _r$3, p, u, use0x64, value, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _11 = $f._11; _12 = $f._12; _r$2 = $f._r$2; _r$3 = $f._r$3; p = $f.p; u = $f.u; use0x64 = $f.use0x64; value = $f.value; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - value = value; - p = this; - use0x64 = true; - _11 = verb; - /* */ if ((_11 === (112)) || (_11 === (118))) { $s = 2; continue; } - /* */ if ((_11 === (98)) || (_11 === (100)) || (_11 === (111)) || (_11 === (120)) || (_11 === (88))) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if ((_11 === (112)) || (_11 === (118))) { */ case 2: - $s = 5; continue; - /* } else if ((_11 === (98)) || (_11 === (100)) || (_11 === (111)) || (_11 === (120)) || (_11 === (88))) { */ case 3: - use0x64 = false; - $s = 5; continue; - /* } else { */ case 4: - $r = p.badVerb(verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return; - /* } */ case 5: - case 1: - u = 0; - _12 = value.Kind(); - /* */ if ((_12 === (18)) || (_12 === (19)) || (_12 === (21)) || (_12 === (22)) || (_12 === (23)) || (_12 === (26))) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if ((_12 === (18)) || (_12 === (19)) || (_12 === (21)) || (_12 === (22)) || (_12 === (23)) || (_12 === (26))) { */ case 8: - u = value.Pointer(); - $s = 10; continue; - /* } else { */ case 9: - $r = p.badVerb(verb); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return; - /* } */ case 10: - case 7: - /* */ if (p.fmt.fmtFlags.sharpV) { $s = 12; continue; } - /* */ if ((verb === 118) && (u === 0)) { $s = 13; continue; } - /* */ $s = 14; continue; - /* if (p.fmt.fmtFlags.sharpV) { */ case 12: - p.add(40); - _r$2 = value.Type().String(); /* */ $s = 16; case 16: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$2); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$3; - p.add(41); - p.add(40); - if (u === 0) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilBytes); - } else { - p.fmt0x64(new $Uint64(0, u.constructor === Number ? u : 1), true); - } - p.add(41); - $s = 15; continue; - /* } else if ((verb === 118) && (u === 0)) { */ case 13: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); - $s = 15; continue; - /* } else { */ case 14: - /* */ if (use0x64) { $s = 18; continue; } - /* */ $s = 19; continue; - /* if (use0x64) { */ case 18: - p.fmt0x64(new $Uint64(0, u.constructor === Number ? u : 1), !p.fmt.fmtFlags.sharp); - $s = 20; continue; - /* } else { */ case 19: - $r = p.fmtUint64(new $Uint64(0, u.constructor === Number ? u : 1), verb); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 20: - /* } */ case 15: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.fmtPointer }; } $f.$ptr = $ptr; $f._11 = _11; $f._12 = _12; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.p = p; $f.u = u; $f.use0x64 = use0x64; $f.value = value; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.fmtPointer = function(value, verb) { return this.$val.fmtPointer(value, verb); }; - pp.ptr.prototype.catchPanic = function(arg, verb) { - var $ptr, _r$2, _r$3, arg, err, p, v, verb, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; arg = $f.arg; err = $f.err; p = $f.p; v = $f.v; verb = $f.verb; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - err = $recover(); - /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 1: - _r$2 = reflect.ValueOf(arg); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - v = _r$2; - if ((v.Kind() === 22) && v.IsNil()) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); - return; - } - if (p.panicking) { - $panic(err); - } - p.fmt.clearflags(); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(percentBangBytes); - p.add(verb); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(panicBytes); - p.panicking = true; - _r$3 = p.printArg(err, 118, 0); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$3; - p.panicking = false; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); - /* } */ case 2: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.catchPanic }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.arg = arg; $f.err = err; $f.p = p; $f.v = v; $f.verb = verb; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.catchPanic = function(arg, verb) { return this.$val.catchPanic(arg, verb); }; - pp.ptr.prototype.clearSpecialFlags = function() { - var $ptr, p, plusV, sharpV; - plusV = false; - sharpV = false; - p = this; - plusV = p.fmt.fmtFlags.plusV; - if (plusV) { - p.fmt.fmtFlags.plus = true; - p.fmt.fmtFlags.plusV = false; - } - sharpV = p.fmt.fmtFlags.sharpV; - if (sharpV) { - p.fmt.fmtFlags.sharp = true; - p.fmt.fmtFlags.sharpV = false; - } - return [plusV, sharpV]; - }; - pp.prototype.clearSpecialFlags = function() { return this.$val.clearSpecialFlags(); }; - pp.ptr.prototype.restoreSpecialFlags = function(plusV, sharpV) { - var $ptr, p, plusV, sharpV; - p = this; - if (plusV) { - p.fmt.fmtFlags.plus = false; - p.fmt.fmtFlags.plusV = true; - } - if (sharpV) { - p.fmt.fmtFlags.sharp = false; - p.fmt.fmtFlags.sharpV = true; - } - }; - pp.prototype.restoreSpecialFlags = function(plusV, sharpV) { return this.$val.restoreSpecialFlags(plusV, sharpV); }; - pp.ptr.prototype.handleMethods = function(verb, depth) { - var $ptr, _13, _r$2, _r$3, _r$4, _r$5, _r$6, _ref, _tuple, _tuple$1, _tuple$2, depth, formatter, handled, ok, ok$1, p, stringer, v, v$1, verb, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _13 = $f._13; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; depth = $f.depth; formatter = $f.formatter; handled = $f.handled; ok = $f.ok; ok$1 = $f.ok$1; p = $f.p; stringer = $f.stringer; v = $f.v; v$1 = $f.v$1; verb = $f.verb; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - handled = false; - p = this; - if (p.erroring) { - return handled; - } - _tuple = $assertType(p.arg, Formatter, true); - formatter = _tuple[0]; - ok = _tuple[1]; - /* */ if (ok) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (ok) { */ case 1: - handled = true; - _tuple$1 = p.clearSpecialFlags(); - $deferred.push([$methodVal(p, "restoreSpecialFlags"), [_tuple$1[0], _tuple$1[1]]]); - $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); - $r = formatter.Format(p, verb); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return handled; - /* } */ case 2: - /* */ if (p.fmt.fmtFlags.sharpV) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (p.fmt.fmtFlags.sharpV) { */ case 4: - _tuple$2 = $assertType(p.arg, GoStringer, true); - stringer = _tuple$2[0]; - ok$1 = _tuple$2[1]; - /* */ if (ok$1) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (ok$1) { */ case 7: - handled = true; - $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); - _r$2 = stringer.GoString(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $r = p.fmt.fmt_s(_r$2); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return handled; - /* } */ case 8: - $s = 6; continue; - /* } else { */ case 5: - _13 = verb; - /* */ if ((_13 === (118)) || (_13 === (115)) || (_13 === (120)) || (_13 === (88)) || (_13 === (113))) { $s = 12; continue; } - /* */ $s = 13; continue; - /* if ((_13 === (118)) || (_13 === (115)) || (_13 === (120)) || (_13 === (88)) || (_13 === (113))) { */ case 12: - _ref = p.arg; - /* */ if ($assertType(_ref, $error, true)[1]) { $s = 14; continue; } - /* */ if ($assertType(_ref, Stringer, true)[1]) { $s = 15; continue; } - /* */ $s = 16; continue; - /* if ($assertType(_ref, $error, true)[1]) { */ case 14: - v = _ref; - handled = true; - $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); - _r$3 = v.Error(); /* */ $s = 17; case 17: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$4 = p.printArg(new $String(_r$3), verb, depth); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _r$4; - return handled; - /* } else if ($assertType(_ref, Stringer, true)[1]) { */ case 15: - v$1 = _ref; - handled = true; - $deferred.push([$methodVal(p, "catchPanic"), [p.arg, verb]]); - _r$5 = v$1.String(); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _r$6 = p.printArg(new $String(_r$5), verb, depth); /* */ $s = 20; case 20: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _r$6; - return handled; - /* } */ case 16: - /* } */ case 13: - case 11: - /* } */ case 6: - handled = false; - return handled; - /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return handled; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: pp.ptr.prototype.handleMethods }; } $f.$ptr = $ptr; $f._13 = _13; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f.depth = depth; $f.formatter = formatter; $f.handled = handled; $f.ok = ok; $f.ok$1 = ok$1; $f.p = p; $f.stringer = stringer; $f.v = v; $f.v$1 = v$1; $f.verb = verb; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - pp.prototype.handleMethods = function(verb, depth) { return this.$val.handleMethods(verb, depth); }; - pp.ptr.prototype.printArg = function(arg, verb, depth) { - var $ptr, _14, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _ref, arg, depth, f, f$1, f$10, f$11, f$12, f$13, f$14, f$15, f$16, f$17, f$18, f$19, f$2, f$3, f$4, f$5, f$6, f$7, f$8, f$9, handled, p, verb, wasString, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _14 = $f._14; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _ref = $f._ref; arg = $f.arg; depth = $f.depth; f = $f.f; f$1 = $f.f$1; f$10 = $f.f$10; f$11 = $f.f$11; f$12 = $f.f$12; f$13 = $f.f$13; f$14 = $f.f$14; f$15 = $f.f$15; f$16 = $f.f$16; f$17 = $f.f$17; f$18 = $f.f$18; f$19 = $f.f$19; f$2 = $f.f$2; f$3 = $f.f$3; f$4 = $f.f$4; f$5 = $f.f$5; f$6 = $f.f$6; f$7 = $f.f$7; f$8 = $f.f$8; f$9 = $f.f$9; handled = $f.handled; p = $f.p; verb = $f.verb; wasString = $f.wasString; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - wasString = false; - p = this; - p.arg = arg; - p.value = new reflect.Value.ptr(ptrType.nil, 0, 0); - /* */ if ($interfaceIsEqual(arg, $ifaceNil)) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if ($interfaceIsEqual(arg, $ifaceNil)) { */ case 1: - /* */ if ((verb === 84) || (verb === 118)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if ((verb === 84) || (verb === 118)) { */ case 3: - p.fmt.pad(nilAngleBytes); - $s = 5; continue; - /* } else { */ case 4: - $r = p.badVerb(verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 5: - wasString = false; - return wasString; - /* } */ case 2: - _14 = verb; - /* */ if (_14 === (84)) { $s = 8; continue; } - /* */ if (_14 === (112)) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (_14 === (84)) { */ case 8: - _r$2 = reflect.TypeOf(arg).String(); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = p.printArg(new $String(_r$2), 115, 0); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$3; - wasString = false; - return wasString; - /* } else if (_14 === (112)) { */ case 9: - _r$4 = reflect.ValueOf(arg); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - $r = p.fmtPointer(_r$4, verb); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - wasString = false; - return wasString; - /* } */ case 10: - case 7: - _ref = arg; - /* */ if ($assertType(_ref, $Bool, true)[1]) { $s = 15; continue; } - /* */ if ($assertType(_ref, $Float32, true)[1]) { $s = 16; continue; } - /* */ if ($assertType(_ref, $Float64, true)[1]) { $s = 17; continue; } - /* */ if ($assertType(_ref, $Complex64, true)[1]) { $s = 18; continue; } - /* */ if ($assertType(_ref, $Complex128, true)[1]) { $s = 19; continue; } - /* */ if ($assertType(_ref, $Int, true)[1]) { $s = 20; continue; } - /* */ if ($assertType(_ref, $Int8, true)[1]) { $s = 21; continue; } - /* */ if ($assertType(_ref, $Int16, true)[1]) { $s = 22; continue; } - /* */ if ($assertType(_ref, $Int32, true)[1]) { $s = 23; continue; } - /* */ if ($assertType(_ref, $Int64, true)[1]) { $s = 24; continue; } - /* */ if ($assertType(_ref, $Uint, true)[1]) { $s = 25; continue; } - /* */ if ($assertType(_ref, $Uint8, true)[1]) { $s = 26; continue; } - /* */ if ($assertType(_ref, $Uint16, true)[1]) { $s = 27; continue; } - /* */ if ($assertType(_ref, $Uint32, true)[1]) { $s = 28; continue; } - /* */ if ($assertType(_ref, $Uint64, true)[1]) { $s = 29; continue; } - /* */ if ($assertType(_ref, $Uintptr, true)[1]) { $s = 30; continue; } - /* */ if ($assertType(_ref, $String, true)[1]) { $s = 31; continue; } - /* */ if ($assertType(_ref, sliceType, true)[1]) { $s = 32; continue; } - /* */ if ($assertType(_ref, reflect.Value, true)[1]) { $s = 33; continue; } - /* */ $s = 34; continue; - /* if ($assertType(_ref, $Bool, true)[1]) { */ case 15: - f = _ref.$val; - $r = p.fmtBool(f, verb); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Float32, true)[1]) { */ case 16: - f$1 = _ref.$val; - $r = p.fmtFloat32(f$1, verb); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Float64, true)[1]) { */ case 17: - f$2 = _ref.$val; - $r = p.fmtFloat64(f$2, verb); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Complex64, true)[1]) { */ case 18: - f$3 = _ref.$val; - $r = p.fmtComplex64(f$3, verb); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Complex128, true)[1]) { */ case 19: - f$4 = _ref.$val; - $r = p.fmtComplex128(f$4, verb); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Int, true)[1]) { */ case 20: - f$5 = _ref.$val; - $r = p.fmtInt64(new $Int64(0, f$5), verb); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Int8, true)[1]) { */ case 21: - f$6 = _ref.$val; - $r = p.fmtInt64(new $Int64(0, f$6), verb); /* */ $s = 42; case 42: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Int16, true)[1]) { */ case 22: - f$7 = _ref.$val; - $r = p.fmtInt64(new $Int64(0, f$7), verb); /* */ $s = 43; case 43: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Int32, true)[1]) { */ case 23: - f$8 = _ref.$val; - $r = p.fmtInt64(new $Int64(0, f$8), verb); /* */ $s = 44; case 44: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Int64, true)[1]) { */ case 24: - f$9 = _ref.$val; - $r = p.fmtInt64(f$9, verb); /* */ $s = 45; case 45: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Uint, true)[1]) { */ case 25: - f$10 = _ref.$val; - $r = p.fmtUint64(new $Uint64(0, f$10), verb); /* */ $s = 46; case 46: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Uint8, true)[1]) { */ case 26: - f$11 = _ref.$val; - $r = p.fmtUint64(new $Uint64(0, f$11), verb); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Uint16, true)[1]) { */ case 27: - f$12 = _ref.$val; - $r = p.fmtUint64(new $Uint64(0, f$12), verb); /* */ $s = 48; case 48: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Uint32, true)[1]) { */ case 28: - f$13 = _ref.$val; - $r = p.fmtUint64(new $Uint64(0, f$13), verb); /* */ $s = 49; case 49: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Uint64, true)[1]) { */ case 29: - f$14 = _ref.$val; - $r = p.fmtUint64(f$14, verb); /* */ $s = 50; case 50: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $Uintptr, true)[1]) { */ case 30: - f$15 = _ref.$val; - $r = p.fmtUint64(new $Uint64(0, f$15.constructor === Number ? f$15 : 1), verb); /* */ $s = 51; case 51: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 35; continue; - /* } else if ($assertType(_ref, $String, true)[1]) { */ case 31: - f$16 = _ref.$val; - $r = p.fmtString(f$16, verb); /* */ $s = 52; case 52: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - wasString = (verb === 115) || (verb === 118); - $s = 35; continue; - /* } else if ($assertType(_ref, sliceType, true)[1]) { */ case 32: - f$17 = _ref.$val; - $r = p.fmtBytes(f$17, verb, $ifaceNil, depth); /* */ $s = 53; case 53: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - wasString = verb === 115; - $s = 35; continue; - /* } else if ($assertType(_ref, reflect.Value, true)[1]) { */ case 33: - f$18 = _ref.$val; - _r$5 = p.printReflectValue(f$18, verb, depth); /* */ $s = 54; case 54: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - wasString = _r$5; - /* */ $s = 55; case 55: - return wasString; - /* } else { */ case 34: - f$19 = _ref; - _r$6 = p.handleMethods(verb, depth); /* */ $s = 56; case 56: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - handled = _r$6; - if (handled) { - wasString = false; - return wasString; - } - _r$7 = reflect.ValueOf(arg); /* */ $s = 57; case 57: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - _r$8 = p.printReflectValue(_r$7, verb, depth); /* */ $s = 58; case 58: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } - wasString = _r$8; - /* */ $s = 59; case 59: - return wasString; - /* } */ case 35: - p.arg = $ifaceNil; - return wasString; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printArg }; } $f.$ptr = $ptr; $f._14 = _14; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._ref = _ref; $f.arg = arg; $f.depth = depth; $f.f = f; $f.f$1 = f$1; $f.f$10 = f$10; $f.f$11 = f$11; $f.f$12 = f$12; $f.f$13 = f$13; $f.f$14 = f$14; $f.f$15 = f$15; $f.f$16 = f$16; $f.f$17 = f$17; $f.f$18 = f$18; $f.f$19 = f$19; $f.f$2 = f$2; $f.f$3 = f$3; $f.f$4 = f$4; $f.f$5 = f$5; $f.f$6 = f$6; $f.f$7 = f$7; $f.f$8 = f$8; $f.f$9 = f$9; $f.handled = handled; $f.p = p; $f.verb = verb; $f.wasString = wasString; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.printArg = function(arg, verb, depth) { return this.$val.printArg(arg, verb, depth); }; - pp.ptr.prototype.printValue = function(value, verb, depth) { - var $ptr, _15, _r$2, _r$3, _r$4, _r$5, _r$6, depth, handled, p, value, verb, wasString, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _15 = $f._15; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; depth = $f.depth; handled = $f.handled; p = $f.p; value = $f.value; verb = $f.verb; wasString = $f.wasString; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - wasString = false; - value = value; - p = this; - /* */ if (!value.IsValid()) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!value.IsValid()) { */ case 1: - /* */ if ((verb === 84) || (verb === 118)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if ((verb === 84) || (verb === 118)) { */ case 3: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); - $s = 5; continue; - /* } else { */ case 4: - $r = p.badVerb(verb); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 5: - wasString = false; - return wasString; - /* } */ case 2: - _15 = verb; - /* */ if (_15 === (84)) { $s = 8; continue; } - /* */ if (_15 === (112)) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (_15 === (84)) { */ case 8: - _r$2 = value.Type().String(); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = p.printArg(new $String(_r$2), 115, 0); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$3; - wasString = false; - return wasString; - /* } else if (_15 === (112)) { */ case 9: - $r = p.fmtPointer(value, verb); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - wasString = false; - return wasString; - /* } */ case 10: - case 7: - p.arg = $ifaceNil; - /* */ if (value.CanInterface()) { $s = 14; continue; } - /* */ $s = 15; continue; - /* if (value.CanInterface()) { */ case 14: - _r$4 = value.Interface(); /* */ $s = 16; case 16: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - p.arg = _r$4; - /* } */ case 15: - _r$5 = p.handleMethods(verb, depth); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - handled = _r$5; - if (handled) { - wasString = false; - return wasString; - } - _r$6 = p.printReflectValue(value, verb, depth); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - wasString = _r$6; - /* */ $s = 19; case 19: - return wasString; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printValue }; } $f.$ptr = $ptr; $f._15 = _15; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f.depth = depth; $f.handled = handled; $f.p = p; $f.value = value; $f.verb = verb; $f.wasString = wasString; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.printValue = function(value, verb, depth) { return this.$val.printValue(value, verb, depth); }; - pp.ptr.prototype.printReflectValue = function(value, verb, depth) { - var $ptr, _16, _17, _i, _i$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$25, _r$26, _r$27, _r$28, _r$29, _r$3, _r$30, _r$31, _r$32, _r$33, _r$34, _r$35, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _ref$1, _v, a, bytes, depth, f, f$1, i, i$1, i$2, i$3, key, keys, oldValue, p, t, typ, v, v$1, value, value$1, verb, wasString, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _16 = $f._16; _17 = $f._17; _i = $f._i; _i$1 = $f._i$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$18 = $f._r$18; _r$19 = $f._r$19; _r$2 = $f._r$2; _r$20 = $f._r$20; _r$21 = $f._r$21; _r$22 = $f._r$22; _r$23 = $f._r$23; _r$24 = $f._r$24; _r$25 = $f._r$25; _r$26 = $f._r$26; _r$27 = $f._r$27; _r$28 = $f._r$28; _r$29 = $f._r$29; _r$3 = $f._r$3; _r$30 = $f._r$30; _r$31 = $f._r$31; _r$32 = $f._r$32; _r$33 = $f._r$33; _r$34 = $f._r$34; _r$35 = $f._r$35; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _ref$1 = $f._ref$1; _v = $f._v; a = $f.a; bytes = $f.bytes; depth = $f.depth; f = $f.f; f$1 = $f.f$1; i = $f.i; i$1 = $f.i$1; i$2 = $f.i$2; i$3 = $f.i$3; key = $f.key; keys = $f.keys; oldValue = $f.oldValue; p = $f.p; t = $f.t; typ = $f.typ; v = $f.v; v$1 = $f.v$1; value = $f.value; value$1 = $f.value$1; verb = $f.verb; wasString = $f.wasString; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - wasString = false; - value = value; - p = this; - oldValue = p.value; - p.value = value; - f = value; - _16 = f.Kind(); - /* */ if (_16 === (0)) { $s = 2; continue; } - /* */ if (_16 === (1)) { $s = 3; continue; } - /* */ if ((_16 === (2)) || (_16 === (3)) || (_16 === (4)) || (_16 === (5)) || (_16 === (6))) { $s = 4; continue; } - /* */ if ((_16 === (7)) || (_16 === (8)) || (_16 === (9)) || (_16 === (10)) || (_16 === (11)) || (_16 === (12))) { $s = 5; continue; } - /* */ if ((_16 === (13)) || (_16 === (14))) { $s = 6; continue; } - /* */ if ((_16 === (15)) || (_16 === (16))) { $s = 7; continue; } - /* */ if (_16 === (24)) { $s = 8; continue; } - /* */ if (_16 === (21)) { $s = 9; continue; } - /* */ if (_16 === (25)) { $s = 10; continue; } - /* */ if (_16 === (20)) { $s = 11; continue; } - /* */ if ((_16 === (17)) || (_16 === (23))) { $s = 12; continue; } - /* */ if (_16 === (22)) { $s = 13; continue; } - /* */ if ((_16 === (18)) || (_16 === (19)) || (_16 === (26))) { $s = 14; continue; } - /* */ $s = 15; continue; - /* if (_16 === (0)) { */ case 2: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(""); - $s = 16; continue; - /* } else if (_16 === (1)) { */ case 3: - $r = p.fmtBool(f.Bool(), verb); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 16; continue; - /* } else if ((_16 === (2)) || (_16 === (3)) || (_16 === (4)) || (_16 === (5)) || (_16 === (6))) { */ case 4: - $r = p.fmtInt64(f.Int(), verb); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 16; continue; - /* } else if ((_16 === (7)) || (_16 === (8)) || (_16 === (9)) || (_16 === (10)) || (_16 === (11)) || (_16 === (12))) { */ case 5: - $r = p.fmtUint64(f.Uint(), verb); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 16; continue; - /* } else if ((_16 === (13)) || (_16 === (14))) { */ case 6: - _r$2 = f.Type().Size(); /* */ $s = 23; case 23: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ if (_r$2 === 4) { $s = 20; continue; } - /* */ $s = 21; continue; - /* if (_r$2 === 4) { */ case 20: - $r = p.fmtFloat32($fround(f.Float()), verb); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 22; continue; - /* } else { */ case 21: - $r = p.fmtFloat64(f.Float(), verb); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 22: - $s = 16; continue; - /* } else if ((_16 === (15)) || (_16 === (16))) { */ case 7: - _r$3 = f.Type().Size(); /* */ $s = 29; case 29: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (_r$3 === 8) { $s = 26; continue; } - /* */ $s = 27; continue; - /* if (_r$3 === 8) { */ case 26: - $r = p.fmtComplex64((x = f.Complex(), new $Complex64(x.$real, x.$imag)), verb); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 28; continue; - /* } else { */ case 27: - $r = p.fmtComplex128(f.Complex(), verb); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 28: - $s = 16; continue; - /* } else if (_16 === (24)) { */ case 8: - _r$4 = f.String(); /* */ $s = 32; case 32: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - $r = p.fmtString(_r$4, verb); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 16; continue; - /* } else if (_16 === (21)) { */ case 9: - /* */ if (p.fmt.fmtFlags.sharpV) { $s = 34; continue; } - /* */ $s = 35; continue; - /* if (p.fmt.fmtFlags.sharpV) { */ case 34: - _r$5 = f.Type().String(); /* */ $s = 37; case 37: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _r$6 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$5); /* */ $s = 38; case 38: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _r$6; - if (f.IsNil()) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); - /* break; */ $s = 1; continue; - } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); - $s = 36; continue; - /* } else { */ case 35: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(mapBytes); - /* } */ case 36: - _r$7 = f.MapKeys(); /* */ $s = 39; case 39: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - keys = _r$7; - _ref = keys; - _i = 0; - /* while (true) { */ case 40: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 41; continue; } - i = _i; - key = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (i > 0) { - if (p.fmt.fmtFlags.sharpV) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(commaSpaceBytes); - } else { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); - } - } - _r$8 = p.printValue(key, verb, depth + 1 >> 0); /* */ $s = 42; case 42: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } - _r$8; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(58); - _r$9 = f.MapIndex(key); /* */ $s = 43; case 43: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } - _r$10 = p.printValue(_r$9, verb, depth + 1 >> 0); /* */ $s = 44; case 44: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } - _r$10; - _i++; - /* } */ $s = 40; continue; case 41: - if (p.fmt.fmtFlags.sharpV) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); - } else { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); - } - $s = 16; continue; - /* } else if (_16 === (25)) { */ case 10: - /* */ if (p.fmt.fmtFlags.sharpV) { $s = 45; continue; } - /* */ $s = 46; continue; - /* if (p.fmt.fmtFlags.sharpV) { */ case 45: - _r$11 = value.Type().String(); /* */ $s = 47; case 47: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } - _r$12 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$11); /* */ $s = 48; case 48: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } - _r$12; - /* } */ case 46: - p.add(123); - v = f; - t = v.Type(); - i$1 = 0; - /* while (true) { */ case 49: - /* if (!(i$1 < v.NumField())) { break; } */ if(!(i$1 < v.NumField())) { $s = 50; continue; } - if (i$1 > 0) { - if (p.fmt.fmtFlags.sharpV) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(commaSpaceBytes); - } else { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); - } - } - /* */ if (p.fmt.fmtFlags.plusV || p.fmt.fmtFlags.sharpV) { $s = 51; continue; } - /* */ $s = 52; continue; - /* if (p.fmt.fmtFlags.plusV || p.fmt.fmtFlags.sharpV) { */ case 51: - _r$13 = t.Field(i$1); /* */ $s = 53; case 53: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } - f$1 = $clone(_r$13, reflect.StructField); - if (!(f$1.Name === "")) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(f$1.Name); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(58); - } - /* } */ case 52: - _r$14 = getField(v, i$1); /* */ $s = 54; case 54: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } - _r$15 = p.printValue(_r$14, verb, depth + 1 >> 0); /* */ $s = 55; case 55: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } - _r$15; - i$1 = i$1 + (1) >> 0; - /* } */ $s = 49; continue; case 50: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); - $s = 16; continue; - /* } else if (_16 === (20)) { */ case 11: - _r$16 = f.Elem(); /* */ $s = 56; case 56: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } - value$1 = _r$16; - /* */ if (!value$1.IsValid()) { $s = 57; continue; } - /* */ $s = 58; continue; - /* if (!value$1.IsValid()) { */ case 57: - /* */ if (p.fmt.fmtFlags.sharpV) { $s = 60; continue; } - /* */ $s = 61; continue; - /* if (p.fmt.fmtFlags.sharpV) { */ case 60: - _r$17 = f.Type().String(); /* */ $s = 63; case 63: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } - _r$18 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$17); /* */ $s = 64; case 64: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; } - _r$18; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilParenBytes); - $s = 62; continue; - /* } else { */ case 61: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(nilAngleBytes); - /* } */ case 62: - $s = 59; continue; - /* } else { */ case 58: - _r$19 = p.printValue(value$1, verb, depth + 1 >> 0); /* */ $s = 65; case 65: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; } - wasString = _r$19; - /* } */ case 59: - $s = 16; continue; - /* } else if ((_16 === (17)) || (_16 === (23))) { */ case 12: - typ = f.Type(); - _r$20 = typ.Elem(); /* */ $s = 69; case 69: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; } - _r$21 = _r$20.Kind(); /* */ $s = 70; case 70: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; } - if (!(_r$21 === 8)) { _v = false; $s = 68; continue s; } - _r$22 = typ.Elem(); /* */ $s = 71; case 71: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; } - _v = $interfaceIsEqual(_r$22, byteType) || (verb === 115) || (verb === 113) || (verb === 120); case 68: - /* */ if (_v) { $s = 66; continue; } - /* */ $s = 67; continue; - /* if (_v) { */ case 66: - bytes = sliceType.nil; - /* */ if (f.Kind() === 23) { $s = 72; continue; } - /* */ if (f.CanAddr()) { $s = 73; continue; } - /* */ $s = 74; continue; - /* if (f.Kind() === 23) { */ case 72: - _r$23 = f.Bytes(); /* */ $s = 76; case 76: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; } - bytes = _r$23; - $s = 75; continue; - /* } else if (f.CanAddr()) { */ case 73: - _r$24 = f.Slice(0, f.Len()); /* */ $s = 77; case 77: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; } - _r$25 = _r$24.Bytes(); /* */ $s = 78; case 78: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; } - bytes = _r$25; - $s = 75; continue; - /* } else { */ case 74: - bytes = $makeSlice(sliceType, f.Len()); - _ref$1 = bytes; - _i$1 = 0; - /* while (true) { */ case 79: - /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 80; continue; } - i$2 = _i$1; - _r$26 = f.Index(i$2); /* */ $s = 81; case 81: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; } - _r$27 = _r$26.Uint(); /* */ $s = 82; case 82: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; } - ((i$2 < 0 || i$2 >= bytes.$length) ? $throwRuntimeError("index out of range") : bytes.$array[bytes.$offset + i$2] = (_r$27.$low << 24 >>> 24)); - _i$1++; - /* } */ $s = 79; continue; case 80: - /* } */ case 75: - $r = p.fmtBytes(bytes, verb, typ, depth); /* */ $s = 83; case 83: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - wasString = verb === 115; - /* break; */ $s = 1; continue; - /* } */ case 67: - /* */ if (p.fmt.fmtFlags.sharpV) { $s = 84; continue; } - /* */ $s = 85; continue; - /* if (p.fmt.fmtFlags.sharpV) { */ case 84: - _r$28 = value.Type().String(); /* */ $s = 87; case 87: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; } - _r$29 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$28); /* */ $s = 88; case 88: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; } - _r$29; - if ((f.Kind() === 23) && f.IsNil()) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString("(nil)"); - /* break; */ $s = 1; continue; - } - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(123); - $s = 86; continue; - /* } else { */ case 85: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(91); - /* } */ case 86: - i$3 = 0; - /* while (true) { */ case 89: - /* if (!(i$3 < f.Len())) { break; } */ if(!(i$3 < f.Len())) { $s = 90; continue; } - if (i$3 > 0) { - if (p.fmt.fmtFlags.sharpV) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(commaSpaceBytes); - } else { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); - } - } - _r$30 = f.Index(i$3); /* */ $s = 91; case 91: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; } - _r$31 = p.printValue(_r$30, verb, depth + 1 >> 0); /* */ $s = 92; case 92: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; } - _r$31; - i$3 = i$3 + (1) >> 0; - /* } */ $s = 89; continue; case 90: - if (p.fmt.fmtFlags.sharpV) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(125); - } else { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(93); - } - $s = 16; continue; - /* } else if (_16 === (22)) { */ case 13: - v$1 = f.Pointer(); - /* */ if (!((v$1 === 0)) && (depth === 0)) { $s = 93; continue; } - /* */ $s = 94; continue; - /* if (!((v$1 === 0)) && (depth === 0)) { */ case 93: - _r$32 = f.Elem(); /* */ $s = 96; case 96: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; } - a = _r$32; - _17 = a.Kind(); - /* */ if ((_17 === (17)) || (_17 === (23))) { $s = 97; continue; } - /* */ if (_17 === (25)) { $s = 98; continue; } - /* */ if (_17 === (21)) { $s = 99; continue; } - /* */ $s = 100; continue; - /* if ((_17 === (17)) || (_17 === (23))) { */ case 97: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(38); - _r$33 = p.printValue(a, verb, depth + 1 >> 0); /* */ $s = 101; case 101: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; } - _r$33; - /* break BigSwitch; */ $s = 1; continue s; - $s = 100; continue; - /* } else if (_17 === (25)) { */ case 98: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(38); - _r$34 = p.printValue(a, verb, depth + 1 >> 0); /* */ $s = 102; case 102: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; } - _r$34; - /* break BigSwitch; */ $s = 1; continue s; - $s = 100; continue; - /* } else if (_17 === (21)) { */ case 99: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(38); - _r$35 = p.printValue(a, verb, depth + 1 >> 0); /* */ $s = 103; case 103: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; } - _r$35; - /* break BigSwitch; */ $s = 1; continue s; - /* } */ case 100: - case 95: - /* } */ case 94: - $r = p.fmtPointer(value, verb); /* */ $s = 104; case 104: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 16; continue; - /* } else if ((_16 === (18)) || (_16 === (19)) || (_16 === (26))) { */ case 14: - $r = p.fmtPointer(value, verb); /* */ $s = 105; case 105: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 16; continue; - /* } else { */ case 15: - $r = p.unknownType(f); /* */ $s = 106; case 106: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 16: - case 1: - p.value = oldValue; - wasString = wasString; - return wasString; - /* */ } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.printReflectValue }; } $f.$ptr = $ptr; $f._16 = _16; $f._17 = _17; $f._i = _i; $f._i$1 = _i$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$18 = _r$18; $f._r$19 = _r$19; $f._r$2 = _r$2; $f._r$20 = _r$20; $f._r$21 = _r$21; $f._r$22 = _r$22; $f._r$23 = _r$23; $f._r$24 = _r$24; $f._r$25 = _r$25; $f._r$26 = _r$26; $f._r$27 = _r$27; $f._r$28 = _r$28; $f._r$29 = _r$29; $f._r$3 = _r$3; $f._r$30 = _r$30; $f._r$31 = _r$31; $f._r$32 = _r$32; $f._r$33 = _r$33; $f._r$34 = _r$34; $f._r$35 = _r$35; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._ref$1 = _ref$1; $f._v = _v; $f.a = a; $f.bytes = bytes; $f.depth = depth; $f.f = f; $f.f$1 = f$1; $f.i = i; $f.i$1 = i$1; $f.i$2 = i$2; $f.i$3 = i$3; $f.key = key; $f.keys = keys; $f.oldValue = oldValue; $f.p = p; $f.t = t; $f.typ = typ; $f.v = v; $f.v$1 = v$1; $f.value = value; $f.value$1 = value$1; $f.verb = verb; $f.wasString = wasString; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.printReflectValue = function(value, verb, depth) { return this.$val.printReflectValue(value, verb, depth); }; - intFromArg = function(a, argNum) { - var $ptr, _18, _r$2, _tuple, a, argNum, isInt, n, n$1, newArgNum, num, v, x, x$1, x$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _18 = $f._18; _r$2 = $f._r$2; _tuple = $f._tuple; a = $f.a; argNum = $f.argNum; isInt = $f.isInt; n = $f.n; n$1 = $f.n$1; newArgNum = $f.newArgNum; num = $f.num; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - num = 0; - isInt = false; - newArgNum = 0; - newArgNum = argNum; - /* */ if (argNum < a.$length) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (argNum < a.$length) { */ case 1: - _tuple = $assertType(((argNum < 0 || argNum >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + argNum]), $Int, true); - num = _tuple[0]; - isInt = _tuple[1]; - /* */ if (!isInt) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (!isInt) { */ case 3: - _r$2 = reflect.ValueOf(((argNum < 0 || argNum >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + argNum])); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - v = _r$2; - _18 = v.Kind(); - if ((_18 === (2)) || (_18 === (3)) || (_18 === (4)) || (_18 === (5)) || (_18 === (6))) { - n = v.Int(); - if ((x = new $Int64(0, ((n.$low + ((n.$high >> 31) * 4294967296)) >> 0)), (x.$high === n.$high && x.$low === n.$low))) { - num = ((n.$low + ((n.$high >> 31) * 4294967296)) >> 0); - isInt = true; - } - } else if ((_18 === (7)) || (_18 === (8)) || (_18 === (9)) || (_18 === (10)) || (_18 === (11)) || (_18 === (12))) { - n$1 = v.Uint(); - if ((x$1 = new $Int64(n$1.$high, n$1.$low), (x$1.$high > 0 || (x$1.$high === 0 && x$1.$low >= 0))) && (x$2 = new $Uint64(0, (n$1.$low >> 0)), (x$2.$high === n$1.$high && x$2.$low === n$1.$low))) { - num = (n$1.$low >> 0); - isInt = true; - } - } - case 5: - /* } */ case 4: - newArgNum = argNum + 1 >> 0; - if (tooLarge(num)) { - num = 0; - isInt = false; - } - /* } */ case 2: - return [num, isInt, newArgNum]; - /* */ } return; } if ($f === undefined) { $f = { $blk: intFromArg }; } $f.$ptr = $ptr; $f._18 = _18; $f._r$2 = _r$2; $f._tuple = _tuple; $f.a = a; $f.argNum = argNum; $f.isInt = isInt; $f.n = n; $f.n$1 = n$1; $f.newArgNum = newArgNum; $f.num = num; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; - }; - parseArgNumber = function(format) { - var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, format, i, index, newi, ok, ok$1, wid, width; - index = 0; - wid = 0; - ok = false; - if (format.length < 3) { - _tmp = 0; - _tmp$1 = 1; - _tmp$2 = false; - index = _tmp; - wid = _tmp$1; - ok = _tmp$2; - return [index, wid, ok]; - } - i = 1; - while (true) { - if (!(i < format.length)) { break; } - if (format.charCodeAt(i) === 93) { - _tuple = parsenum(format, 1, i); - width = _tuple[0]; - ok$1 = _tuple[1]; - newi = _tuple[2]; - if (!ok$1 || !((newi === i))) { - _tmp$3 = 0; - _tmp$4 = i + 1 >> 0; - _tmp$5 = false; - index = _tmp$3; - wid = _tmp$4; - ok = _tmp$5; - return [index, wid, ok]; - } - _tmp$6 = width - 1 >> 0; - _tmp$7 = i + 1 >> 0; - _tmp$8 = true; - index = _tmp$6; - wid = _tmp$7; - ok = _tmp$8; - return [index, wid, ok]; - } - i = i + (1) >> 0; - } - _tmp$9 = 0; - _tmp$10 = 1; - _tmp$11 = false; - index = _tmp$9; - wid = _tmp$10; - ok = _tmp$11; - return [index, wid, ok]; - }; - pp.ptr.prototype.argNumber = function(argNum, format, i, numArgs) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tuple, argNum, format, found, i, index, newArgNum, newi, numArgs, ok, p, wid; - newArgNum = 0; - newi = 0; - found = false; - p = this; - if (format.length <= i || !((format.charCodeAt(i) === 91))) { - _tmp = argNum; - _tmp$1 = i; - _tmp$2 = false; - newArgNum = _tmp; - newi = _tmp$1; - found = _tmp$2; - return [newArgNum, newi, found]; - } - p.reordered = true; - _tuple = parseArgNumber(format.substring(i)); - index = _tuple[0]; - wid = _tuple[1]; - ok = _tuple[2]; - if (ok && 0 <= index && index < numArgs) { - _tmp$3 = index; - _tmp$4 = i + wid >> 0; - _tmp$5 = true; - newArgNum = _tmp$3; - newi = _tmp$4; - found = _tmp$5; - return [newArgNum, newi, found]; - } - p.goodArgNum = false; - _tmp$6 = argNum; - _tmp$7 = i + wid >> 0; - _tmp$8 = ok; - newArgNum = _tmp$6; - newi = _tmp$7; - found = _tmp$8; - return [newArgNum, newi, found]; - }; - pp.prototype.argNumber = function(argNum, format, i, numArgs) { return this.$val.argNumber(argNum, format, i, numArgs); }; - pp.ptr.prototype.doPrintf = function(format, a) { - var $ptr, _19, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, _tuple$7, a, afterIndex, arg, arg$1, argNum, c, end, format, i, lasti, p, w, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _19 = $f._19; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; _tuple$6 = $f._tuple$6; _tuple$7 = $f._tuple$7; a = $f.a; afterIndex = $f.afterIndex; arg = $f.arg; arg$1 = $f.arg$1; argNum = $f.argNum; c = $f.c; end = $f.end; format = $f.format; i = $f.i; lasti = $f.lasti; p = $f.p; w = $f.w; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - end = format.length; - argNum = 0; - afterIndex = false; - p.reordered = false; - i = 0; - /* while (true) { */ case 1: - /* if (!(i < end)) { break; } */ if(!(i < end)) { $s = 2; continue; } - p.goodArgNum = true; - lasti = i; - while (true) { - if (!(i < end && !((format.charCodeAt(i) === 37)))) { break; } - i = i + (1) >> 0; - } - if (i > lasti) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(format.substring(lasti, i)); - } - if (i >= end) { - /* break; */ $s = 2; continue; - } - i = i + (1) >> 0; - p.fmt.clearflags(); - F: - while (true) { - if (!(i < end)) { break; } - _19 = format.charCodeAt(i); - if (_19 === (35)) { - p.fmt.fmtFlags.sharp = true; - } else if (_19 === (48)) { - p.fmt.fmtFlags.zero = true; - } else if (_19 === (43)) { - p.fmt.fmtFlags.plus = true; - } else if (_19 === (45)) { - p.fmt.fmtFlags.minus = true; - } else if (_19 === (32)) { - p.fmt.fmtFlags.space = true; - } else { - break F; - } - i = i + (1) >> 0; - } - _tuple = p.argNumber(argNum, format, i, a.$length); - argNum = _tuple[0]; - i = _tuple[1]; - afterIndex = _tuple[2]; - /* */ if (i < end && (format.charCodeAt(i) === 42)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (i < end && (format.charCodeAt(i) === 42)) { */ case 3: - i = i + (1) >> 0; - _r$2 = intFromArg(a, argNum); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$1 = _r$2; - p.fmt.wid = _tuple$1[0]; - p.fmt.fmtFlags.widPresent = _tuple$1[1]; - argNum = _tuple$1[2]; - if (!p.fmt.fmtFlags.widPresent) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(badWidthBytes); - } - if (p.fmt.wid < 0) { - p.fmt.wid = -p.fmt.wid; - p.fmt.fmtFlags.minus = true; - } - afterIndex = false; - $s = 5; continue; - /* } else { */ case 4: - _tuple$2 = parsenum(format, i, end); - p.fmt.wid = _tuple$2[0]; - p.fmt.fmtFlags.widPresent = _tuple$2[1]; - i = _tuple$2[2]; - if (afterIndex && p.fmt.fmtFlags.widPresent) { - p.goodArgNum = false; - } - /* } */ case 5: - /* */ if ((i + 1 >> 0) < end && (format.charCodeAt(i) === 46)) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if ((i + 1 >> 0) < end && (format.charCodeAt(i) === 46)) { */ case 7: - i = i + (1) >> 0; - if (afterIndex) { - p.goodArgNum = false; - } - _tuple$3 = p.argNumber(argNum, format, i, a.$length); - argNum = _tuple$3[0]; - i = _tuple$3[1]; - afterIndex = _tuple$3[2]; - /* */ if (i < end && (format.charCodeAt(i) === 42)) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (i < end && (format.charCodeAt(i) === 42)) { */ case 9: - i = i + (1) >> 0; - _r$3 = intFromArg(a, argNum); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _tuple$4 = _r$3; - p.fmt.prec = _tuple$4[0]; - p.fmt.fmtFlags.precPresent = _tuple$4[1]; - argNum = _tuple$4[2]; - if (p.fmt.prec < 0) { - p.fmt.prec = 0; - p.fmt.fmtFlags.precPresent = false; - } - if (!p.fmt.fmtFlags.precPresent) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(badPrecBytes); - } - afterIndex = false; - $s = 11; continue; - /* } else { */ case 10: - _tuple$5 = parsenum(format, i, end); - p.fmt.prec = _tuple$5[0]; - p.fmt.fmtFlags.precPresent = _tuple$5[1]; - i = _tuple$5[2]; - if (!p.fmt.fmtFlags.precPresent) { - p.fmt.prec = 0; - p.fmt.fmtFlags.precPresent = true; - } - /* } */ case 11: - /* } */ case 8: - if (!afterIndex) { - _tuple$6 = p.argNumber(argNum, format, i, a.$length); - argNum = _tuple$6[0]; - i = _tuple$6[1]; - afterIndex = _tuple$6[2]; - } - /* */ if (i >= end) { $s = 13; continue; } - /* */ $s = 14; continue; - /* if (i >= end) { */ case 13: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(noVerbBytes); - /* continue; */ $s = 1; continue; - /* } */ case 14: - _tuple$7 = utf8.DecodeRuneInString(format.substring(i)); - c = _tuple$7[0]; - w = _tuple$7[1]; - i = i + (w) >> 0; - /* */ if (c === 37) { $s = 15; continue; } - /* */ $s = 16; continue; - /* if (c === 37) { */ case 15: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(37); - /* continue; */ $s = 1; continue; - /* } */ case 16: - /* */ if (!p.goodArgNum) { $s = 17; continue; } - /* */ if (argNum >= a.$length) { $s = 18; continue; } - /* */ $s = 19; continue; - /* if (!p.goodArgNum) { */ case 17: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(percentBangBytes); - p.add(c); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(badIndexBytes); - /* continue; */ $s = 1; continue; - $s = 19; continue; - /* } else if (argNum >= a.$length) { */ case 18: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(percentBangBytes); - p.add(c); - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(missingBytes); - /* continue; */ $s = 1; continue; - /* } */ case 19: - arg = ((argNum < 0 || argNum >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + argNum]); - argNum = argNum + (1) >> 0; - if (c === 118) { - if (p.fmt.fmtFlags.sharp) { - p.fmt.fmtFlags.sharp = false; - p.fmt.fmtFlags.sharpV = true; - } - if (p.fmt.fmtFlags.plus) { - p.fmt.fmtFlags.plus = false; - p.fmt.fmtFlags.plusV = true; - } - } - _r$4 = p.printArg(arg, c, 0); /* */ $s = 20; case 20: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _r$4; - /* } */ $s = 1; continue; case 2: - /* */ if (!p.reordered && argNum < a.$length) { $s = 21; continue; } - /* */ $s = 22; continue; - /* if (!p.reordered && argNum < a.$length) { */ case 21: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(extraBytes); - /* while (true) { */ case 23: - /* if (!(argNum < a.$length)) { break; } */ if(!(argNum < a.$length)) { $s = 24; continue; } - arg$1 = ((argNum < 0 || argNum >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + argNum]); - /* */ if (!($interfaceIsEqual(arg$1, $ifaceNil))) { $s = 25; continue; } - /* */ $s = 26; continue; - /* if (!($interfaceIsEqual(arg$1, $ifaceNil))) { */ case 25: - _r$5 = reflect.TypeOf(arg$1).String(); /* */ $s = 27; case 27: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _r$6 = (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteString(_r$5); /* */ $s = 28; case 28: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _r$6; - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(61); - /* } */ case 26: - _r$7 = p.printArg(arg$1, 118, 0); /* */ $s = 29; case 29: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - _r$7; - if ((argNum + 1 >> 0) < a.$length) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).Write(commaSpaceBytes); - } - argNum = argNum + (1) >> 0; - /* } */ $s = 23; continue; case 24: - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(41); - /* } */ case 22: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrintf }; } $f.$ptr = $ptr; $f._19 = _19; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f._tuple$6 = _tuple$6; $f._tuple$7 = _tuple$7; $f.a = a; $f.afterIndex = afterIndex; $f.arg = arg; $f.arg$1 = arg$1; $f.argNum = argNum; $f.c = c; $f.end = end; $f.format = format; $f.i = i; $f.lasti = lasti; $f.p = p; $f.w = w; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.doPrintf = function(format, a) { return this.$val.doPrintf(format, a); }; - pp.ptr.prototype.doPrint = function(a, addspace, addnewline) { - var $ptr, _r$2, _r$3, _v, a, addnewline, addspace, arg, argNum, isString, p, prevString, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _v = $f._v; a = $f.a; addnewline = $f.addnewline; addspace = $f.addspace; arg = $f.arg; argNum = $f.argNum; isString = $f.isString; p = $f.p; prevString = $f.prevString; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - prevString = false; - argNum = 0; - /* while (true) { */ case 1: - /* if (!(argNum < a.$length)) { break; } */ if(!(argNum < a.$length)) { $s = 2; continue; } - p.fmt.clearflags(); - arg = ((argNum < 0 || argNum >= a.$length) ? $throwRuntimeError("index out of range") : a.$array[a.$offset + argNum]); - /* */ if (argNum > 0) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (argNum > 0) { */ case 3: - if (!(!($interfaceIsEqual(arg, $ifaceNil)))) { _v = false; $s = 5; continue s; } - _r$2 = reflect.TypeOf(arg).Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _v = _r$2 === 24; case 5: - isString = _v; - if (addspace || !isString && !prevString) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(32); - } - /* } */ case 4: - _r$3 = p.printArg(arg, 118, 0); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - prevString = _r$3; - argNum = argNum + (1) >> 0; - /* } */ $s = 1; continue; case 2: - if (addnewline) { - (p.$ptr_buf || (p.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, p))).WriteByte(10); - } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: pp.ptr.prototype.doPrint }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._v = _v; $f.a = a; $f.addnewline = addnewline; $f.addspace = addspace; $f.arg = arg; $f.argNum = argNum; $f.isString = isString; $f.p = p; $f.prevString = prevString; $f.$s = $s; $f.$r = $r; return $f; - }; - pp.prototype.doPrint = function(a, addspace, addnewline) { return this.$val.doPrint(a, addspace, addnewline); }; - ss.ptr.prototype.Read = function(buf) { - var $ptr, _tmp, _tmp$1, buf, err, n, s; - n = 0; - err = $ifaceNil; - s = this; - _tmp = 0; - _tmp$1 = errors.New("ScanState's Read should not be called. Use ReadRune"); - n = _tmp; - err = _tmp$1; - return [n, err]; - }; - ss.prototype.Read = function(buf) { return this.$val.Read(buf); }; - ss.ptr.prototype.ReadRune = function() { - var $ptr, _r$2, _tuple, err, r, s, size, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _tuple = $f._tuple; err = $f.err; r = $f.r; s = $f.s; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = 0; - size = 0; - err = $ifaceNil; - s = this; - if (s.peekRune >= 0) { - s.count = s.count + (1) >> 0; - r = s.peekRune; - size = utf8.RuneLen(r); - s.prevRune = r; - s.peekRune = -1; - return [r, size, err]; - } - if (s.atEOF || s.ssave.nlIsEnd && (s.prevRune === 10) || s.count >= s.ssave.argLimit) { - err = io.EOF; - return [r, size, err]; - } - _r$2 = s.rr.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple = _r$2; - r = _tuple[0]; - size = _tuple[1]; - err = _tuple[2]; - if ($interfaceIsEqual(err, $ifaceNil)) { - s.count = s.count + (1) >> 0; - s.prevRune = r; - } else if ($interfaceIsEqual(err, io.EOF)) { - s.atEOF = true; - } - return [r, size, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.ReadRune }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._tuple = _tuple; $f.err = err; $f.r = r; $f.s = s; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.ReadRune = function() { return this.$val.ReadRune(); }; - ss.ptr.prototype.Width = function() { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, ok, s, wid; - wid = 0; - ok = false; - s = this; - if (s.ssave.maxWid === 1073741824) { - _tmp = 0; - _tmp$1 = false; - wid = _tmp; - ok = _tmp$1; - return [wid, ok]; - } - _tmp$2 = s.ssave.maxWid; - _tmp$3 = true; - wid = _tmp$2; - ok = _tmp$3; - return [wid, ok]; - }; - ss.prototype.Width = function() { return this.$val.Width(); }; - ss.ptr.prototype.getRune = function() { - var $ptr, _r$2, _tuple, err, r, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _tuple = $f._tuple; err = $f.err; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = 0; - s = this; - _r$2 = s.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple = _r$2; - r = _tuple[0]; - err = _tuple[2]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - if ($interfaceIsEqual(err, io.EOF)) { - r = -1; - return r; - } - s.error(err); - } - return r; - /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.getRune }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._tuple = _tuple; $f.err = err; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.getRune = function() { return this.$val.getRune(); }; - ss.ptr.prototype.UnreadRune = function() { - var $ptr, _r$2, _tuple, ok, s, u, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _tuple = $f._tuple; ok = $f.ok; s = $f.s; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s = this; - _tuple = $assertType(s.rr, runeUnreader, true); - u = _tuple[0]; - ok = _tuple[1]; - /* */ if (ok) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (ok) { */ case 1: - _r$2 = u.UnreadRune(); /* */ $s = 4; case 4: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$2; - $s = 3; continue; - /* } else { */ case 2: - s.peekRune = s.prevRune; - /* } */ case 3: - s.prevRune = -1; - s.count = s.count - (1) >> 0; - return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.UnreadRune }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._tuple = _tuple; $f.ok = ok; $f.s = s; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.UnreadRune = function() { return this.$val.UnreadRune(); }; - ss.ptr.prototype.error = function(err) { - var $ptr, err, s, x; - s = this; - $panic((x = new scanError.ptr(err), new x.constructor.elem(x))); - }; - ss.prototype.error = function(err) { return this.$val.error(err); }; - ss.ptr.prototype.errorString = function(err) { - var $ptr, err, s, x; - s = this; - $panic((x = new scanError.ptr(errors.New(err)), new x.constructor.elem(x))); - }; - ss.prototype.errorString = function(err) { return this.$val.errorString(err); }; - ss.ptr.prototype.Token = function(skipSpace, f) { - var $ptr, _r$2, err, f, s, skipSpace, tok, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; err = $f.err; f = $f.f; s = $f.s; skipSpace = $f.skipSpace; tok = $f.tok; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - err = [err]; - tok = sliceType.nil; - err[0] = $ifaceNil; - s = this; - $deferred.push([(function(err) { return function() { - var $ptr, _tuple, e, ok, se; - e = $recover(); - if (!($interfaceIsEqual(e, $ifaceNil))) { - _tuple = $assertType(e, scanError, true); - se = $clone(_tuple[0], scanError); - ok = _tuple[1]; - if (ok) { - err[0] = se.err; - } else { - $panic(e); - } - } - }; })(err), []]); - if (f === $throwNilPointerError) { - f = notSpace; - } - s.buf = $subslice(s.buf, 0, 0); - _r$2 = s.token(skipSpace, f); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - tok = _r$2; - return [tok, err[0]]; - /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return [tok, err[0]]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: ss.ptr.prototype.Token }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.err = err; $f.f = f; $f.s = s; $f.skipSpace = skipSpace; $f.tok = tok; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - ss.prototype.Token = function(skipSpace, f) { return this.$val.Token(skipSpace, f); }; - isSpace = function(r) { - var $ptr, _i, _ref, r, rng, rx; - if (r >= 65536) { - return false; - } - rx = (r << 16 >>> 16); - _ref = space; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - rng = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), arrayType$2); - if (rx < rng[0]) { - return false; - } - if (rx <= rng[1]) { - return true; - } - _i++; - } - return false; - }; - notSpace = function(r) { - var $ptr, r; - return !isSpace(r); - }; - ss.ptr.prototype.SkipSpace = function() { - var $ptr, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s = this; - $r = s.skipSpace(false); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.SkipSpace }; } $f.$ptr = $ptr; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.SkipSpace = function() { return this.$val.SkipSpace(); }; - ss.ptr.prototype.free = function(old) { - var $ptr, old, s; - old = $clone(old, ssave); - s = this; - if (old.validSave) { - ssave.copy(s.ssave, old); - return; - } - if (s.buf.$capacity > 1024) { - return; - } - s.buf = $subslice(s.buf, 0, 0); - s.rr = $ifaceNil; - ssFree.Put(s); - }; - ss.prototype.free = function(old) { return this.$val.free(old); }; - ss.ptr.prototype.skipSpace = function(stopAtNewline) { - var $ptr, _r$2, _r$3, _r$4, _v, r, s, stopAtNewline, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _v = $f._v; r = $f.r; s = $f.s; stopAtNewline = $f.stopAtNewline; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s = this; - /* while (true) { */ case 1: - _r$2 = s.getRune(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - r = _r$2; - if (r === -1) { - return; - } - if (!(r === 13)) { _v = false; $s = 6; continue s; } - _r$3 = s.peek("\n"); /* */ $s = 7; case 7: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _v = _r$3; case 6: - /* */ if (_v) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_v) { */ case 4: - /* continue; */ $s = 1; continue; - /* } */ case 5: - /* */ if (r === 10) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if (r === 10) { */ case 8: - if (stopAtNewline) { - /* break; */ $s = 2; continue; - } - if (s.ssave.nlIsSpace) { - /* continue; */ $s = 1; continue; - } - s.errorString("unexpected newline"); - return; - /* } */ case 9: - /* */ if (!isSpace(r)) { $s = 10; continue; } - /* */ $s = 11; continue; - /* if (!isSpace(r)) { */ case 10: - _r$4 = s.UnreadRune(); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _r$4; - /* break; */ $s = 2; continue; - /* } */ case 11: - /* } */ $s = 1; continue; case 2: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.skipSpace }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._v = _v; $f.r = r; $f.s = s; $f.stopAtNewline = stopAtNewline; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.skipSpace = function(stopAtNewline) { return this.$val.skipSpace(stopAtNewline); }; - ss.ptr.prototype.token = function(skipSpace, f) { - var $ptr, _r$2, _r$3, _r$4, f, r, s, skipSpace, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; f = $f.f; r = $f.r; s = $f.s; skipSpace = $f.skipSpace; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s = this; - /* */ if (skipSpace) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (skipSpace) { */ case 1: - $r = s.skipSpace(false); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 2: - /* while (true) { */ case 4: - _r$2 = s.getRune(); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - r = _r$2; - if (r === -1) { - /* break; */ $s = 5; continue; - } - _r$3 = f(r); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (!_r$3) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (!_r$3) { */ case 7: - _r$4 = s.UnreadRune(); /* */ $s = 10; case 10: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _r$4; - /* break; */ $s = 5; continue; - /* } */ case 8: - (s.$ptr_buf || (s.$ptr_buf = new ptrType$1(function() { return this.$target.buf; }, function($v) { this.$target.buf = $v; }, s))).WriteRune(r); - /* } */ $s = 4; continue; case 5: - return (x = s.buf, $subslice(new sliceType(x.$array), x.$offset, x.$offset + x.$length)); - /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.token }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.f = f; $f.r = r; $f.s = s; $f.skipSpace = skipSpace; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.token = function(skipSpace, f) { return this.$val.token(skipSpace, f); }; - indexRune = function(s, r) { - var $ptr, _i, _ref, _rune, c, i, r, s; - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.length)) { break; } - _rune = $decodeRune(_ref, _i); - i = _i; - c = _rune[0]; - if (c === r) { - return i; - } - _i += _rune[1]; - } - return -1; - }; - ss.ptr.prototype.peek = function(ok) { - var $ptr, _r$2, _r$3, ok, r, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; ok = $f.ok; r = $f.r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s = this; - _r$2 = s.getRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - r = _r$2; - /* */ if (!((r === -1))) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (!((r === -1))) { */ case 2: - _r$3 = s.UnreadRune(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$3; - /* } */ case 3: - return indexRune(ok, r) >= 0; - /* */ } return; } if ($f === undefined) { $f = { $blk: ss.ptr.prototype.peek }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.ok = ok; $f.r = r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - ss.prototype.peek = function(ok) { return this.$val.peek(ok); }; - ptrType$25.methods = [{prop: "clearflags", name: "clearflags", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "init", name: "init", pkg: "fmt", typ: $funcType([ptrType$1], [], false)}, {prop: "computePadding", name: "computePadding", pkg: "fmt", typ: $funcType([$Int], [sliceType, $Int, $Int], false)}, {prop: "writePadding", name: "writePadding", pkg: "fmt", typ: $funcType([$Int, sliceType], [], false)}, {prop: "pad", name: "pad", pkg: "fmt", typ: $funcType([sliceType], [], false)}, {prop: "padString", name: "padString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmt_boolean", name: "fmt_boolean", pkg: "fmt", typ: $funcType([$Bool], [], false)}, {prop: "integer", name: "integer", pkg: "fmt", typ: $funcType([$Int64, $Uint64, $Bool, $String], [], false)}, {prop: "truncate", name: "truncate", pkg: "fmt", typ: $funcType([$String], [$String], false)}, {prop: "fmt_s", name: "fmt_s", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmt_sbx", name: "fmt_sbx", pkg: "fmt", typ: $funcType([$String, sliceType, $String], [], false)}, {prop: "fmt_sx", name: "fmt_sx", pkg: "fmt", typ: $funcType([$String, $String], [], false)}, {prop: "fmt_bx", name: "fmt_bx", pkg: "fmt", typ: $funcType([sliceType, $String], [], false)}, {prop: "fmt_q", name: "fmt_q", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "fmt_qc", name: "fmt_qc", pkg: "fmt", typ: $funcType([$Int64], [], false)}, {prop: "formatFloat", name: "formatFloat", pkg: "fmt", typ: $funcType([$Float64, $Uint8, $Int, $Int], [], false)}, {prop: "fmt_e64", name: "fmt_e64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_E64", name: "fmt_E64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_f64", name: "fmt_f64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_g64", name: "fmt_g64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_G64", name: "fmt_G64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_fb64", name: "fmt_fb64", pkg: "fmt", typ: $funcType([$Float64], [], false)}, {prop: "fmt_e32", name: "fmt_e32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_E32", name: "fmt_E32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_f32", name: "fmt_f32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_g32", name: "fmt_g32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_G32", name: "fmt_G32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_fb32", name: "fmt_fb32", pkg: "fmt", typ: $funcType([$Float32], [], false)}, {prop: "fmt_c64", name: "fmt_c64", pkg: "fmt", typ: $funcType([$Complex64, $Int32], [], false)}, {prop: "fmt_c128", name: "fmt_c128", pkg: "fmt", typ: $funcType([$Complex128, $Int32], [], false)}, {prop: "fmt_complex", name: "fmt_complex", pkg: "fmt", typ: $funcType([$Float64, $Float64, $Int, $Int32], [], false)}]; - ptrType$1.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "WriteString", name: "WriteString", pkg: "", typ: $funcType([$String], [$Int, $error], false)}, {prop: "WriteByte", name: "WriteByte", pkg: "", typ: $funcType([$Uint8], [$error], false)}, {prop: "WriteRune", name: "WriteRune", pkg: "", typ: $funcType([$Int32], [$error], false)}]; - ptrType$2.methods = [{prop: "free", name: "free", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Precision", name: "Precision", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Flag", name: "Flag", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "add", name: "add", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "unknownType", name: "unknownType", pkg: "fmt", typ: $funcType([reflect.Value], [], false)}, {prop: "badVerb", name: "badVerb", pkg: "fmt", typ: $funcType([$Int32], [], false)}, {prop: "fmtBool", name: "fmtBool", pkg: "fmt", typ: $funcType([$Bool, $Int32], [], false)}, {prop: "fmtC", name: "fmtC", pkg: "fmt", typ: $funcType([$Int64], [], false)}, {prop: "fmtInt64", name: "fmtInt64", pkg: "fmt", typ: $funcType([$Int64, $Int32], [], false)}, {prop: "fmt0x64", name: "fmt0x64", pkg: "fmt", typ: $funcType([$Uint64, $Bool], [], false)}, {prop: "fmtUnicode", name: "fmtUnicode", pkg: "fmt", typ: $funcType([$Int64], [], false)}, {prop: "fmtUint64", name: "fmtUint64", pkg: "fmt", typ: $funcType([$Uint64, $Int32], [], false)}, {prop: "fmtFloat32", name: "fmtFloat32", pkg: "fmt", typ: $funcType([$Float32, $Int32], [], false)}, {prop: "fmtFloat64", name: "fmtFloat64", pkg: "fmt", typ: $funcType([$Float64, $Int32], [], false)}, {prop: "fmtComplex64", name: "fmtComplex64", pkg: "fmt", typ: $funcType([$Complex64, $Int32], [], false)}, {prop: "fmtComplex128", name: "fmtComplex128", pkg: "fmt", typ: $funcType([$Complex128, $Int32], [], false)}, {prop: "fmtString", name: "fmtString", pkg: "fmt", typ: $funcType([$String, $Int32], [], false)}, {prop: "fmtBytes", name: "fmtBytes", pkg: "fmt", typ: $funcType([sliceType, $Int32, reflect.Type, $Int], [], false)}, {prop: "fmtPointer", name: "fmtPointer", pkg: "fmt", typ: $funcType([reflect.Value, $Int32], [], false)}, {prop: "catchPanic", name: "catchPanic", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32], [], false)}, {prop: "clearSpecialFlags", name: "clearSpecialFlags", pkg: "fmt", typ: $funcType([], [$Bool, $Bool], false)}, {prop: "restoreSpecialFlags", name: "restoreSpecialFlags", pkg: "fmt", typ: $funcType([$Bool, $Bool], [], false)}, {prop: "handleMethods", name: "handleMethods", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Bool], false)}, {prop: "printArg", name: "printArg", pkg: "fmt", typ: $funcType([$emptyInterface, $Int32, $Int], [$Bool], false)}, {prop: "printValue", name: "printValue", pkg: "fmt", typ: $funcType([reflect.Value, $Int32, $Int], [$Bool], false)}, {prop: "printReflectValue", name: "printReflectValue", pkg: "fmt", typ: $funcType([reflect.Value, $Int32, $Int], [$Bool], false)}, {prop: "argNumber", name: "argNumber", pkg: "fmt", typ: $funcType([$Int, $String, $Int, $Int], [$Int, $Int, $Bool], false)}, {prop: "doPrintf", name: "doPrintf", pkg: "fmt", typ: $funcType([$String, sliceType$1], [], false)}, {prop: "doPrint", name: "doPrint", pkg: "fmt", typ: $funcType([sliceType$1, $Bool, $Bool], [], false)}]; - ptrType$5.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "getRune", name: "getRune", pkg: "fmt", typ: $funcType([], [$Int32], false)}, {prop: "mustReadRune", name: "mustReadRune", pkg: "fmt", typ: $funcType([], [$Int32], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "error", name: "error", pkg: "fmt", typ: $funcType([$error], [], false)}, {prop: "errorString", name: "errorString", pkg: "fmt", typ: $funcType([$String], [], false)}, {prop: "Token", name: "Token", pkg: "", typ: $funcType([$Bool, funcType], [sliceType, $error], false)}, {prop: "SkipSpace", name: "SkipSpace", pkg: "", typ: $funcType([], [], false)}, {prop: "free", name: "free", pkg: "fmt", typ: $funcType([ssave], [], false)}, {prop: "skipSpace", name: "skipSpace", pkg: "fmt", typ: $funcType([$Bool], [], false)}, {prop: "token", name: "token", pkg: "fmt", typ: $funcType([$Bool, funcType], [sliceType], false)}, {prop: "consume", name: "consume", pkg: "fmt", typ: $funcType([$String, $Bool], [$Bool], false)}, {prop: "peek", name: "peek", pkg: "fmt", typ: $funcType([$String], [$Bool], false)}, {prop: "notEOF", name: "notEOF", pkg: "fmt", typ: $funcType([], [], false)}, {prop: "accept", name: "accept", pkg: "fmt", typ: $funcType([$String], [$Bool], false)}, {prop: "okVerb", name: "okVerb", pkg: "fmt", typ: $funcType([$Int32, $String, $String], [$Bool], false)}, {prop: "scanBool", name: "scanBool", pkg: "fmt", typ: $funcType([$Int32], [$Bool], false)}, {prop: "getBase", name: "getBase", pkg: "fmt", typ: $funcType([$Int32], [$Int, $String], false)}, {prop: "scanNumber", name: "scanNumber", pkg: "fmt", typ: $funcType([$String, $Bool], [$String], false)}, {prop: "scanRune", name: "scanRune", pkg: "fmt", typ: $funcType([$Int], [$Int64], false)}, {prop: "scanBasePrefix", name: "scanBasePrefix", pkg: "fmt", typ: $funcType([], [$Int, $String, $Bool], false)}, {prop: "scanInt", name: "scanInt", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Int64], false)}, {prop: "scanUint", name: "scanUint", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Uint64], false)}, {prop: "floatToken", name: "floatToken", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "complexTokens", name: "complexTokens", pkg: "fmt", typ: $funcType([], [$String, $String], false)}, {prop: "convertFloat", name: "convertFloat", pkg: "fmt", typ: $funcType([$String, $Int], [$Float64], false)}, {prop: "scanComplex", name: "scanComplex", pkg: "fmt", typ: $funcType([$Int32, $Int], [$Complex128], false)}, {prop: "convertString", name: "convertString", pkg: "fmt", typ: $funcType([$Int32], [$String], false)}, {prop: "quotedString", name: "quotedString", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "hexByte", name: "hexByte", pkg: "fmt", typ: $funcType([], [$Uint8, $Bool], false)}, {prop: "hexString", name: "hexString", pkg: "fmt", typ: $funcType([], [$String], false)}, {prop: "scanOne", name: "scanOne", pkg: "fmt", typ: $funcType([$Int32, $emptyInterface], [], false)}, {prop: "doScan", name: "doScan", pkg: "fmt", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "advance", name: "advance", pkg: "fmt", typ: $funcType([$String], [$Int], false)}, {prop: "doScanf", name: "doScanf", pkg: "fmt", typ: $funcType([$String, sliceType$1], [$Int, $error], false)}]; - fmtFlags.init([{prop: "widPresent", name: "widPresent", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "precPresent", name: "precPresent", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "minus", name: "minus", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "plus", name: "plus", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "sharp", name: "sharp", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "space", name: "space", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "unicode", name: "unicode", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "uniQuote", name: "uniQuote", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "zero", name: "zero", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "plusV", name: "plusV", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "sharpV", name: "sharpV", pkg: "fmt", typ: $Bool, tag: ""}]); - fmt.init([{prop: "intbuf", name: "intbuf", pkg: "fmt", typ: arrayType$1, tag: ""}, {prop: "buf", name: "buf", pkg: "fmt", typ: ptrType$1, tag: ""}, {prop: "wid", name: "wid", pkg: "fmt", typ: $Int, tag: ""}, {prop: "prec", name: "prec", pkg: "fmt", typ: $Int, tag: ""}, {prop: "fmtFlags", name: "", pkg: "fmt", typ: fmtFlags, tag: ""}]); - State.init([{prop: "Flag", name: "Flag", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "Precision", name: "Precision", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); - Formatter.init([{prop: "Format", name: "Format", pkg: "", typ: $funcType([State, $Int32], [], false)}]); - Stringer.init([{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); - GoStringer.init([{prop: "GoString", name: "GoString", pkg: "", typ: $funcType([], [$String], false)}]); - buffer.init($Uint8); - pp.init([{prop: "n", name: "n", pkg: "fmt", typ: $Int, tag: ""}, {prop: "panicking", name: "panicking", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "erroring", name: "erroring", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "buf", name: "buf", pkg: "fmt", typ: buffer, tag: ""}, {prop: "arg", name: "arg", pkg: "fmt", typ: $emptyInterface, tag: ""}, {prop: "value", name: "value", pkg: "fmt", typ: reflect.Value, tag: ""}, {prop: "reordered", name: "reordered", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "goodArgNum", name: "goodArgNum", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "runeBuf", name: "runeBuf", pkg: "fmt", typ: arrayType, tag: ""}, {prop: "fmt", name: "fmt", pkg: "fmt", typ: fmt, tag: ""}]); - runeUnreader.init([{prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}]); - ScanState.init([{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "ReadRune", name: "ReadRune", pkg: "", typ: $funcType([], [$Int32, $Int, $error], false)}, {prop: "SkipSpace", name: "SkipSpace", pkg: "", typ: $funcType([], [], false)}, {prop: "Token", name: "Token", pkg: "", typ: $funcType([$Bool, funcType], [sliceType, $error], false)}, {prop: "UnreadRune", name: "UnreadRune", pkg: "", typ: $funcType([], [$error], false)}, {prop: "Width", name: "Width", pkg: "", typ: $funcType([], [$Int, $Bool], false)}]); - scanError.init([{prop: "err", name: "err", pkg: "fmt", typ: $error, tag: ""}]); - ss.init([{prop: "rr", name: "rr", pkg: "fmt", typ: io.RuneReader, tag: ""}, {prop: "buf", name: "buf", pkg: "fmt", typ: buffer, tag: ""}, {prop: "peekRune", name: "peekRune", pkg: "fmt", typ: $Int32, tag: ""}, {prop: "prevRune", name: "prevRune", pkg: "fmt", typ: $Int32, tag: ""}, {prop: "count", name: "count", pkg: "fmt", typ: $Int, tag: ""}, {prop: "atEOF", name: "atEOF", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "ssave", name: "", pkg: "fmt", typ: ssave, tag: ""}]); - ssave.init([{prop: "validSave", name: "validSave", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "nlIsEnd", name: "nlIsEnd", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "nlIsSpace", name: "nlIsSpace", pkg: "fmt", typ: $Bool, tag: ""}, {prop: "argLimit", name: "argLimit", pkg: "fmt", typ: $Int, tag: ""}, {prop: "limit", name: "limit", pkg: "fmt", typ: $Int, tag: ""}, {prop: "maxWid", name: "maxWid", pkg: "fmt", typ: $Int, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = math.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = os.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = reflect.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strconv.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = utf8.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - padZeroBytes = $makeSlice(sliceType, 65); - padSpaceBytes = $makeSlice(sliceType, 65); - trueBytes = new sliceType($stringToBytes("true")); - falseBytes = new sliceType($stringToBytes("false")); - commaSpaceBytes = new sliceType($stringToBytes(", ")); - nilAngleBytes = new sliceType($stringToBytes("")); - nilParenBytes = new sliceType($stringToBytes("(nil)")); - nilBytes = new sliceType($stringToBytes("nil")); - mapBytes = new sliceType($stringToBytes("map[")); - percentBangBytes = new sliceType($stringToBytes("%!")); - missingBytes = new sliceType($stringToBytes("(MISSING)")); - badIndexBytes = new sliceType($stringToBytes("(BADINDEX)")); - panicBytes = new sliceType($stringToBytes("(PANIC=")); - extraBytes = new sliceType($stringToBytes("%!(EXTRA ")); - irparenBytes = new sliceType($stringToBytes("i)")); - bytesBytes = new sliceType($stringToBytes("[]byte{")); - badWidthBytes = new sliceType($stringToBytes("%!(BADWIDTH)")); - badPrecBytes = new sliceType($stringToBytes("%!(BADPREC)")); - noVerbBytes = new sliceType($stringToBytes("%!(NOVERB)")); - ppFree = new sync.Pool.ptr(0, 0, sliceType$1.nil, (function() { - var $ptr; - return new pp.ptr(0, false, false, buffer.nil, $ifaceNil, new reflect.Value.ptr(ptrType.nil, 0, 0), false, false, arrayType.zero(), new fmt.ptr(arrayType$1.zero(), ptrType$1.nil, 0, 0, new fmtFlags.ptr(false, false, false, false, false, false, false, false, false, false, false))); - })); - _r = reflect.TypeOf(new $Int(0)).Bits(); /* */ $s = 9; case 9: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - intBits = _r; - _r$1 = reflect.TypeOf(new $Uintptr(0)).Bits(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - uintptrBits = _r$1; - byteType = reflect.TypeOf(new $Uint8(0)); - space = new sliceType$2([$toNativeArray($kindUint16, [9, 13]), $toNativeArray($kindUint16, [32, 32]), $toNativeArray($kindUint16, [133, 133]), $toNativeArray($kindUint16, [160, 160]), $toNativeArray($kindUint16, [5760, 5760]), $toNativeArray($kindUint16, [8192, 8202]), $toNativeArray($kindUint16, [8232, 8233]), $toNativeArray($kindUint16, [8239, 8239]), $toNativeArray($kindUint16, [8287, 8287]), $toNativeArray($kindUint16, [12288, 12288])]); - ssFree = new sync.Pool.ptr(0, 0, sliceType$1.nil, (function() { - var $ptr; - return new ss.ptr($ifaceNil, buffer.nil, 0, 0, 0, false, new ssave.ptr(false, false, false, 0, 0, 0)); - })); - complexError = errors.New("syntax error scanning complex number"); - boolError = errors.New("syntax error scanning boolean"); - init(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["math/rand"] = (function() { - var $pkg = {}, $init, nosync, math, Source, Rand, lockedSource, rngSource, arrayType, sliceType, ptrType, sliceType$1, ptrType$2, ptrType$3, ke, we, fe, kn, wn, fn, globalRand, rng_cooked, absInt32, NewSource, New, seedrand; - nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; - math = $packages["math"]; - Source = $pkg.Source = $newType(8, $kindInterface, "rand.Source", "Source", "math/rand", null); - Rand = $pkg.Rand = $newType(0, $kindStruct, "rand.Rand", "Rand", "math/rand", function(src_) { - this.$val = this; - if (arguments.length === 0) { - this.src = $ifaceNil; - return; - } - this.src = src_; - }); - lockedSource = $pkg.lockedSource = $newType(0, $kindStruct, "rand.lockedSource", "lockedSource", "math/rand", function(lk_, src_) { - this.$val = this; - if (arguments.length === 0) { - this.lk = new nosync.Mutex.ptr(false); - this.src = $ifaceNil; - return; - } - this.lk = lk_; - this.src = src_; - }); - rngSource = $pkg.rngSource = $newType(0, $kindStruct, "rand.rngSource", "rngSource", "math/rand", function(tap_, feed_, vec_) { - this.$val = this; - if (arguments.length === 0) { - this.tap = 0; - this.feed = 0; - this.vec = arrayType.zero(); - return; - } - this.tap = tap_; - this.feed = feed_; - this.vec = vec_; - }); - arrayType = $arrayType($Int64, 607); - sliceType = $sliceType($Int); - ptrType = $ptrType(Rand); - sliceType$1 = $sliceType($Uint8); - ptrType$2 = $ptrType(lockedSource); - ptrType$3 = $ptrType(rngSource); - Rand.ptr.prototype.ExpFloat64 = function() { - var $ptr, _r, _r$1, _r$2, _r$3, i, j, r, x, x$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; i = $f.i; j = $f.j; r = $f.r; x = $f.x; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - /* while (true) { */ case 1: - _r = r.Uint32(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - j = _r; - i = (j & 255) >>> 0; - x = j * ((i < 0 || i >= we.length) ? $throwRuntimeError("index out of range") : we[i]); - if (j < ((i < 0 || i >= ke.length) ? $throwRuntimeError("index out of range") : ke[i])) { - return x; - } - /* */ if (i === 0) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (i === 0) { */ case 4: - _r$1 = r.Float64(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = math.Log(_r$1); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ $s = 8; case 8: - return 7.69711747013105 - _r$2; - /* } */ case 5: - _r$3 = r.Float64(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if ($fround(((i < 0 || i >= fe.length) ? $throwRuntimeError("index out of range") : fe[i]) + $fround($fround(_r$3) * ($fround((x$1 = i - 1 >>> 0, ((x$1 < 0 || x$1 >= fe.length) ? $throwRuntimeError("index out of range") : fe[x$1])) - ((i < 0 || i >= fe.length) ? $throwRuntimeError("index out of range") : fe[i]))))) < $fround(math.Exp(-x))) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if ($fround(((i < 0 || i >= fe.length) ? $throwRuntimeError("index out of range") : fe[i]) + $fround($fround(_r$3) * ($fround((x$1 = i - 1 >>> 0, ((x$1 < 0 || x$1 >= fe.length) ? $throwRuntimeError("index out of range") : fe[x$1])) - ((i < 0 || i >= fe.length) ? $throwRuntimeError("index out of range") : fe[i]))))) < $fround(math.Exp(-x))) { */ case 9: - return x; - /* } */ case 10: - /* } */ $s = 1; continue; case 2: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.ExpFloat64 }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.i = i; $f.j = j; $f.r = r; $f.x = x; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.ExpFloat64 = function() { return this.$val.ExpFloat64(); }; - absInt32 = function(i) { - var $ptr, i; - if (i < 0) { - return (-i >>> 0); - } - return (i >>> 0); - }; - Rand.ptr.prototype.NormFloat64 = function() { - var $ptr, _r, _r$1, _r$2, _r$3, _r$4, _r$5, i, j, r, x, x$1, y, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; i = $f.i; j = $f.j; r = $f.r; x = $f.x; x$1 = $f.x$1; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - /* while (true) { */ case 1: - _r = r.Uint32(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - j = (_r >> 0); - i = j & 127; - x = j * ((i < 0 || i >= wn.length) ? $throwRuntimeError("index out of range") : wn[i]); - if (absInt32(j) < ((i < 0 || i >= kn.length) ? $throwRuntimeError("index out of range") : kn[i])) { - return x; - } - /* */ if (i === 0) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (i === 0) { */ case 4: - /* while (true) { */ case 6: - _r$1 = r.Float64(); /* */ $s = 8; case 8: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$2 = math.Log(_r$1); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - x = -_r$2 * 0.29047645161474317; - _r$3 = r.Float64(); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$4 = math.Log(_r$3); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - y = -_r$4; - if (y + y >= x * x) { - /* break; */ $s = 7; continue; - } - /* } */ $s = 6; continue; case 7: - if (j > 0) { - return 3.442619855899 + x; - } - return -3.442619855899 - x; - /* } */ case 5: - _r$5 = r.Float64(); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - /* */ if ($fround(((i < 0 || i >= fn.length) ? $throwRuntimeError("index out of range") : fn[i]) + $fround($fround(_r$5) * ($fround((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= fn.length) ? $throwRuntimeError("index out of range") : fn[x$1])) - ((i < 0 || i >= fn.length) ? $throwRuntimeError("index out of range") : fn[i]))))) < $fround(math.Exp(-0.5 * x * x))) { $s = 12; continue; } - /* */ $s = 13; continue; - /* if ($fround(((i < 0 || i >= fn.length) ? $throwRuntimeError("index out of range") : fn[i]) + $fround($fround(_r$5) * ($fround((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= fn.length) ? $throwRuntimeError("index out of range") : fn[x$1])) - ((i < 0 || i >= fn.length) ? $throwRuntimeError("index out of range") : fn[i]))))) < $fround(math.Exp(-0.5 * x * x))) { */ case 12: - return x; - /* } */ case 13: - /* } */ $s = 1; continue; case 2: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.NormFloat64 }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.i = i; $f.j = j; $f.r = r; $f.x = x; $f.x$1 = x$1; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.NormFloat64 = function() { return this.$val.NormFloat64(); }; - NewSource = function(seed) { - var $ptr, rng, seed; - rng = new rngSource.ptr(0, 0, arrayType.zero()); - rng.Seed(seed); - return rng; - }; - $pkg.NewSource = NewSource; - New = function(src) { - var $ptr, src; - return new Rand.ptr(src); - }; - $pkg.New = New; - Rand.ptr.prototype.Seed = function(seed) { - var $ptr, r, seed, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - $r = r.src.Seed(seed); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Seed }; } $f.$ptr = $ptr; $f.r = r; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Seed = function(seed) { return this.$val.Seed(seed); }; - Rand.ptr.prototype.Int63 = function() { - var $ptr, _r, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - _r = r.src.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int63 }; } $f.$ptr = $ptr; $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Int63 = function() { return this.$val.Int63(); }; - Rand.ptr.prototype.Uint32 = function() { - var $ptr, _r, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - _r = r.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return ($shiftRightInt64(_r, 31).$low >>> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Uint32 }; } $f.$ptr = $ptr; $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Uint32 = function() { return this.$val.Uint32(); }; - Rand.ptr.prototype.Int31 = function() { - var $ptr, _r, r, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; r = $f.r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - _r = r.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return ((x = $shiftRightInt64(_r, 32), x.$low + ((x.$high >> 31) * 4294967296)) >> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int31 }; } $f.$ptr = $ptr; $f._r = _r; $f.r = r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Int31 = function() { return this.$val.Int31(); }; - Rand.ptr.prototype.Int = function() { - var $ptr, _r, r, u, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; r = $f.r; u = $f.u; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - _r = r.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - u = (_r.$low >>> 0); - return (((u << 1 >>> 0) >>> 1 >>> 0) >> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int }; } $f.$ptr = $ptr; $f._r = _r; $f.r = r; $f.u = u; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Int = function() { return this.$val.Int(); }; - Rand.ptr.prototype.Int63n = function(n) { - var $ptr, _r, _r$1, _r$2, max, n, r, v, x, x$1, x$2, x$3, x$4, x$5, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; max = $f.max; n = $f.n; r = $f.r; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; x$5 = $f.x$5; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - if ((n.$high < 0 || (n.$high === 0 && n.$low <= 0))) { - $panic(new $String("invalid argument to Int63n")); - } - /* */ if ((x = (x$1 = new $Int64(n.$high - 0, n.$low - 1), new $Int64(n.$high & x$1.$high, (n.$low & x$1.$low) >>> 0)), (x.$high === 0 && x.$low === 0))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if ((x = (x$1 = new $Int64(n.$high - 0, n.$low - 1), new $Int64(n.$high & x$1.$high, (n.$low & x$1.$low) >>> 0)), (x.$high === 0 && x.$low === 0))) { */ case 1: - _r = r.Int63(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return (x$2 = _r, x$3 = new $Int64(n.$high - 0, n.$low - 1), new $Int64(x$2.$high & x$3.$high, (x$2.$low & x$3.$low) >>> 0)); - /* } */ case 2: - max = (x$4 = (x$5 = $div64(new $Uint64(2147483648, 0), new $Uint64(n.$high, n.$low), true), new $Uint64(2147483647 - x$5.$high, 4294967295 - x$5.$low)), new $Int64(x$4.$high, x$4.$low)); - _r$1 = r.Int63(); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - v = _r$1; - /* while (true) { */ case 6: - /* if (!((v.$high > max.$high || (v.$high === max.$high && v.$low > max.$low)))) { break; } */ if(!((v.$high > max.$high || (v.$high === max.$high && v.$low > max.$low)))) { $s = 7; continue; } - _r$2 = r.Int63(); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - v = _r$2; - /* } */ $s = 6; continue; case 7: - return $div64(v, n, true); - /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int63n }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.max = max; $f.n = n; $f.r = r; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.x$5 = x$5; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Int63n = function(n) { return this.$val.Int63n(n); }; - Rand.ptr.prototype.Int31n = function(n) { - var $ptr, _r, _r$1, _r$2, _r$3, _r$4, max, n, r, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; max = $f.max; n = $f.n; r = $f.r; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - if (n <= 0) { - $panic(new $String("invalid argument to Int31n")); - } - /* */ if ((n & ((n - 1 >> 0))) === 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if ((n & ((n - 1 >> 0))) === 0) { */ case 1: - _r = r.Int31(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return _r & ((n - 1 >> 0)); - /* } */ case 2: - max = ((2147483647 - (_r$1 = 2147483648 % (n >>> 0), _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) >>> 0) >> 0); - _r$2 = r.Int31(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - v = _r$2; - /* while (true) { */ case 6: - /* if (!(v > max)) { break; } */ if(!(v > max)) { $s = 7; continue; } - _r$3 = r.Int31(); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - v = _r$3; - /* } */ $s = 6; continue; case 7: - return (_r$4 = v % n, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")); - /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Int31n }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.max = max; $f.n = n; $f.r = r; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Int31n = function(n) { return this.$val.Int31n(n); }; - Rand.ptr.prototype.Intn = function(n) { - var $ptr, _r, _r$1, n, r, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; n = $f.n; r = $f.r; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - if (n <= 0) { - $panic(new $String("invalid argument to Intn")); - } - /* */ if (n <= 2147483647) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (n <= 2147483647) { */ case 1: - _r = r.Int31n((n >> 0)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return (_r >> 0); - /* } */ case 2: - _r$1 = r.Int63n(new $Int64(0, n)); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 6; case 6: - return ((x = _r$1, x.$low + ((x.$high >> 31) * 4294967296)) >> 0); - /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Intn }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.n = n; $f.r = r; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Intn = function(n) { return this.$val.Intn(n); }; - Rand.ptr.prototype.Float64 = function() { - var $ptr, _r, f, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; f = $f.f; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - /* again: */ case 1: - _r = r.Int63(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - f = $flatten64(_r) / 9.223372036854776e+18; - /* */ if (f === 1) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (f === 1) { */ case 3: - /* goto again */ $s = 1; continue; - /* } */ case 4: - return f; - /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Float64 }; } $f.$ptr = $ptr; $f._r = _r; $f.f = f; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Float64 = function() { return this.$val.Float64(); }; - Rand.ptr.prototype.Float32 = function() { - var $ptr, _r, f, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; f = $f.f; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - /* again: */ case 1: - _r = r.Float64(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - f = $fround(_r); - /* */ if (f === 1) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (f === 1) { */ case 3: - /* goto again */ $s = 1; continue; - /* } */ case 4: - return f; - /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Float32 }; } $f.$ptr = $ptr; $f._r = _r; $f.f = f; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Float32 = function() { return this.$val.Float32(); }; - Rand.ptr.prototype.Perm = function(n) { - var $ptr, _r, i, j, m, n, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; j = $f.j; m = $f.m; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - m = $makeSlice(sliceType, n); - i = 0; - /* while (true) { */ case 1: - /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } - _r = r.Intn(i + 1 >> 0); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - j = _r; - ((i < 0 || i >= m.$length) ? $throwRuntimeError("index out of range") : m.$array[m.$offset + i] = ((j < 0 || j >= m.$length) ? $throwRuntimeError("index out of range") : m.$array[m.$offset + j])); - ((j < 0 || j >= m.$length) ? $throwRuntimeError("index out of range") : m.$array[m.$offset + j] = i); - i = i + (1) >> 0; - /* } */ $s = 1; continue; case 2: - return m; - /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Perm }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.j = j; $f.m = m; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Perm = function(n) { return this.$val.Perm(n); }; - Rand.ptr.prototype.Read = function(p) { - var $ptr, _r, _tmp, _tmp$1, err, i, j, n, p, r, val, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; err = $f.err; i = $f.i; j = $f.j; n = $f.n; p = $f.p; r = $f.r; val = $f.val; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - r = this; - i = 0; - /* while (true) { */ case 1: - /* if (!(i < p.$length)) { break; } */ if(!(i < p.$length)) { $s = 2; continue; } - _r = r.src.Int63(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - val = _r; - j = 0; - while (true) { - if (!((i + j >> 0) < p.$length && j < 7)) { break; } - (x = i + j >> 0, ((x < 0 || x >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x] = (val.$low << 24 >>> 24))); - val = $shiftRightInt64(val, (8)); - j = j + (1) >> 0; - } - i = i + (7) >> 0; - /* } */ $s = 1; continue; case 2: - _tmp = p.$length; - _tmp$1 = $ifaceNil; - n = _tmp; - err = _tmp$1; - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Rand.ptr.prototype.Read }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.err = err; $f.i = i; $f.j = j; $f.n = n; $f.p = p; $f.r = r; $f.val = val; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Rand.prototype.Read = function(p) { return this.$val.Read(p); }; - lockedSource.ptr.prototype.Int63 = function() { - var $ptr, _r, n, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; n = $f.n; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = new $Int64(0, 0); - r = this; - r.lk.Lock(); - _r = r.src.Int63(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - n = _r; - r.lk.Unlock(); - return n; - /* */ } return; } if ($f === undefined) { $f = { $blk: lockedSource.ptr.prototype.Int63 }; } $f.$ptr = $ptr; $f._r = _r; $f.n = n; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - lockedSource.prototype.Int63 = function() { return this.$val.Int63(); }; - lockedSource.ptr.prototype.Seed = function(seed) { - var $ptr, r, seed, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; r = $f.r; seed = $f.seed; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = this; - r.lk.Lock(); - $r = r.src.Seed(seed); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - r.lk.Unlock(); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: lockedSource.ptr.prototype.Seed }; } $f.$ptr = $ptr; $f.r = r; $f.seed = seed; $f.$s = $s; $f.$r = $r; return $f; - }; - lockedSource.prototype.Seed = function(seed) { return this.$val.Seed(seed); }; - seedrand = function(x) { - var $ptr, _q, _r, hi, lo, x; - hi = (_q = x / 44488, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - lo = (_r = x % 44488, _r === _r ? _r : $throwRuntimeError("integer divide by zero")); - x = ($imul(48271, lo)) - ($imul(3399, hi)) >> 0; - if (x < 0) { - x = x + (2147483647) >> 0; - } - return x; - }; - rngSource.ptr.prototype.Seed = function(seed) { - var $ptr, i, rng, seed, u, x, x$1, x$2, x$3, x$4, x$5; - rng = this; - rng.tap = 0; - rng.feed = 334; - seed = $div64(seed, new $Int64(0, 2147483647), true); - if ((seed.$high < 0 || (seed.$high === 0 && seed.$low < 0))) { - seed = (x = new $Int64(0, 2147483647), new $Int64(seed.$high + x.$high, seed.$low + x.$low)); - } - if ((seed.$high === 0 && seed.$low === 0)) { - seed = new $Int64(0, 89482311); - } - x$1 = ((seed.$low + ((seed.$high >> 31) * 4294967296)) >> 0); - i = -20; - while (true) { - if (!(i < 607)) { break; } - x$1 = seedrand(x$1); - if (i >= 0) { - u = new $Int64(0, 0); - u = $shiftLeft64(new $Int64(0, x$1), 40); - x$1 = seedrand(x$1); - u = (x$2 = $shiftLeft64(new $Int64(0, x$1), 20), new $Int64(u.$high ^ x$2.$high, (u.$low ^ x$2.$low) >>> 0)); - x$1 = seedrand(x$1); - u = (x$3 = new $Int64(0, x$1), new $Int64(u.$high ^ x$3.$high, (u.$low ^ x$3.$low) >>> 0)); - u = (x$4 = ((i < 0 || i >= rng_cooked.length) ? $throwRuntimeError("index out of range") : rng_cooked[i]), new $Int64(u.$high ^ x$4.$high, (u.$low ^ x$4.$low) >>> 0)); - (x$5 = rng.vec, ((i < 0 || i >= x$5.length) ? $throwRuntimeError("index out of range") : x$5[i] = new $Int64(u.$high & 2147483647, (u.$low & 4294967295) >>> 0))); - } - i = i + (1) >> 0; - } - }; - rngSource.prototype.Seed = function(seed) { return this.$val.Seed(seed); }; - rngSource.ptr.prototype.Int63 = function() { - var $ptr, rng, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - rng = this; - rng.tap = rng.tap - (1) >> 0; - if (rng.tap < 0) { - rng.tap = rng.tap + (607) >> 0; - } - rng.feed = rng.feed - (1) >> 0; - if (rng.feed < 0) { - rng.feed = rng.feed + (607) >> 0; - } - x$7 = (x = (x$1 = (x$2 = rng.vec, x$3 = rng.feed, ((x$3 < 0 || x$3 >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[x$3])), x$4 = (x$5 = rng.vec, x$6 = rng.tap, ((x$6 < 0 || x$6 >= x$5.length) ? $throwRuntimeError("index out of range") : x$5[x$6])), new $Int64(x$1.$high + x$4.$high, x$1.$low + x$4.$low)), new $Int64(x.$high & 2147483647, (x.$low & 4294967295) >>> 0)); - (x$8 = rng.vec, x$9 = rng.feed, ((x$9 < 0 || x$9 >= x$8.length) ? $throwRuntimeError("index out of range") : x$8[x$9] = x$7)); - return x$7; - }; - rngSource.prototype.Int63 = function() { return this.$val.Int63(); }; - ptrType.methods = [{prop: "ExpFloat64", name: "ExpFloat64", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "NormFloat64", name: "NormFloat64", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint32", name: "Uint32", pkg: "", typ: $funcType([], [$Uint32], false)}, {prop: "Int31", name: "Int31", pkg: "", typ: $funcType([], [$Int32], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Int63n", name: "Int63n", pkg: "", typ: $funcType([$Int64], [$Int64], false)}, {prop: "Int31n", name: "Int31n", pkg: "", typ: $funcType([$Int32], [$Int32], false)}, {prop: "Intn", name: "Intn", pkg: "", typ: $funcType([$Int], [$Int], false)}, {prop: "Float64", name: "Float64", pkg: "", typ: $funcType([], [$Float64], false)}, {prop: "Float32", name: "Float32", pkg: "", typ: $funcType([], [$Float32], false)}, {prop: "Perm", name: "Perm", pkg: "", typ: $funcType([$Int], [sliceType], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}]; - ptrType$2.methods = [{prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}]; - ptrType$3.methods = [{prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}, {prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}]; - Source.init([{prop: "Int63", name: "Int63", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Seed", name: "Seed", pkg: "", typ: $funcType([$Int64], [], false)}]); - Rand.init([{prop: "src", name: "src", pkg: "math/rand", typ: Source, tag: ""}]); - lockedSource.init([{prop: "lk", name: "lk", pkg: "math/rand", typ: nosync.Mutex, tag: ""}, {prop: "src", name: "src", pkg: "math/rand", typ: Source, tag: ""}]); - rngSource.init([{prop: "tap", name: "tap", pkg: "math/rand", typ: $Int, tag: ""}, {prop: "feed", name: "feed", pkg: "math/rand", typ: $Int, tag: ""}, {prop: "vec", name: "vec", pkg: "math/rand", typ: arrayType, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = nosync.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = math.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - ke = $toNativeArray($kindUint32, [3801129273, 0, 2615860924, 3279400049, 3571300752, 3733536696, 3836274812, 3906990442, 3958562475, 3997804264, 4028649213, 4053523342, 4074002619, 4091154507, 4105727352, 4118261130, 4129155133, 4138710916, 4147160435, 4154685009, 4161428406, 4167506077, 4173011791, 4178022498, 4182601930, 4186803325, 4190671498, 4194244443, 4197554582, 4200629752, 4203493986, 4206168142, 4208670408, 4211016720, 4213221098, 4215295924, 4217252177, 4219099625, 4220846988, 4222502074, 4224071896, 4225562770, 4226980400, 4228329951, 4229616109, 4230843138, 4232014925, 4233135020, 4234206673, 4235232866, 4236216336, 4237159604, 4238064994, 4238934652, 4239770563, 4240574564, 4241348362, 4242093539, 4242811568, 4243503822, 4244171579, 4244816032, 4245438297, 4246039419, 4246620374, 4247182079, 4247725394, 4248251127, 4248760037, 4249252839, 4249730206, 4250192773, 4250641138, 4251075867, 4251497493, 4251906522, 4252303431, 4252688672, 4253062674, 4253425844, 4253778565, 4254121205, 4254454110, 4254777611, 4255092022, 4255397640, 4255694750, 4255983622, 4256264513, 4256537670, 4256803325, 4257061702, 4257313014, 4257557464, 4257795244, 4258026541, 4258251531, 4258470383, 4258683258, 4258890309, 4259091685, 4259287526, 4259477966, 4259663135, 4259843154, 4260018142, 4260188212, 4260353470, 4260514019, 4260669958, 4260821380, 4260968374, 4261111028, 4261249421, 4261383632, 4261513736, 4261639802, 4261761900, 4261880092, 4261994441, 4262105003, 4262211835, 4262314988, 4262414513, 4262510454, 4262602857, 4262691764, 4262777212, 4262859239, 4262937878, 4263013162, 4263085118, 4263153776, 4263219158, 4263281289, 4263340187, 4263395872, 4263448358, 4263497660, 4263543789, 4263586755, 4263626565, 4263663224, 4263696735, 4263727099, 4263754314, 4263778377, 4263799282, 4263817020, 4263831582, 4263842955, 4263851124, 4263856071, 4263857776, 4263856218, 4263851370, 4263843206, 4263831695, 4263816804, 4263798497, 4263776735, 4263751476, 4263722676, 4263690284, 4263654251, 4263614520, 4263571032, 4263523724, 4263472530, 4263417377, 4263358192, 4263294892, 4263227394, 4263155608, 4263079437, 4262998781, 4262913534, 4262823581, 4262728804, 4262629075, 4262524261, 4262414220, 4262298801, 4262177846, 4262051187, 4261918645, 4261780032, 4261635148, 4261483780, 4261325704, 4261160681, 4260988457, 4260808763, 4260621313, 4260425802, 4260221905, 4260009277, 4259787550, 4259556329, 4259315195, 4259063697, 4258801357, 4258527656, 4258242044, 4257943926, 4257632664, 4257307571, 4256967906, 4256612870, 4256241598, 4255853155, 4255446525, 4255020608, 4254574202, 4254106002, 4253614578, 4253098370, 4252555662, 4251984571, 4251383021, 4250748722, 4250079132, 4249371435, 4248622490, 4247828790, 4246986404, 4246090910, 4245137315, 4244119963, 4243032411, 4241867296, 4240616155, 4239269214, 4237815118, 4236240596, 4234530035, 4232664930, 4230623176, 4228378137, 4225897409, 4223141146, 4220059768, 4216590757, 4212654085, 4208145538, 4202926710, 4196809522, 4189531420, 4180713890, 4169789475, 4155865042, 4137444620, 4111806704, 4073393724, 4008685917, 3873074895]); - we = $toNativeArray($kindFloat32, [2.0249555365836613e-09, 1.4866739783681027e-11, 2.4409616689036184e-11, 3.1968806074589295e-11, 3.844677007314168e-11, 4.42282044321729e-11, 4.951644302919611e-11, 5.443358958023836e-11, 5.905943789574764e-11, 6.34494193296753e-11, 6.764381416113352e-11, 7.167294535648239e-11, 7.556032188826833e-11, 7.932458162551725e-11, 8.298078890689453e-11, 8.654132271912474e-11, 9.001651507523079e-11, 9.341507428706208e-11, 9.674443190998971e-11, 1.0001099254308699e-10, 1.0322031424037093e-10, 1.0637725422757427e-10, 1.0948611461891744e-10, 1.1255067711157807e-10, 1.1557434870246297e-10, 1.1856014781042035e-10, 1.2151082917633005e-10, 1.2442885610752796e-10, 1.2731647680563896e-10, 1.3017574518325858e-10, 1.330085347417409e-10, 1.3581656632677408e-10, 1.386014220061682e-10, 1.413645728254309e-10, 1.4410737880776736e-10, 1.4683107507629245e-10, 1.4953686899854546e-10, 1.522258291641876e-10, 1.5489899640730442e-10, 1.575573282952547e-10, 1.6020171300645814e-10, 1.628330109637588e-10, 1.6545202707884954e-10, 1.68059510752272e-10, 1.7065616975120435e-10, 1.73242697965037e-10, 1.758197337720091e-10, 1.783878739169964e-10, 1.8094774290045024e-10, 1.834998542005195e-10, 1.8604476292871652e-10, 1.8858298256319017e-10, 1.9111498494872592e-10, 1.9364125580789704e-10, 1.9616222535212557e-10, 1.9867835154840918e-10, 2.011900368525943e-10, 2.0369768372052732e-10, 2.062016807302669e-10, 2.0870240258208383e-10, 2.1120022397624894e-10, 2.136955057352452e-10, 2.1618855317040442e-10, 2.1867974098199738e-10, 2.2116936060356807e-10, 2.2365774510202385e-10, 2.2614519978869652e-10, 2.2863201609713002e-10, 2.3111849933865614e-10, 2.3360494094681883e-10, 2.3609159072179864e-10, 2.3857874009713953e-10, 2.4106666662859766e-10, 2.4355562011635357e-10, 2.460458781161634e-10, 2.485376904282077e-10, 2.5103127909709144e-10, 2.5352694943414633e-10, 2.560248957284017e-10, 2.585253955356137e-10, 2.610286709003873e-10, 2.6353494386732734e-10, 2.6604446423661443e-10, 2.6855745405285347e-10, 2.71074163116225e-10, 2.7359478571575835e-10, 2.7611959940720965e-10, 2.786487707240326e-10, 2.8118254946640775e-10, 2.8372118543451563e-10, 2.8626484516180994e-10, 2.8881380620404684e-10, 2.9136826285025563e-10, 2.9392840938946563e-10, 2.96494523377433e-10, 2.990667713476114e-10, 3.016454031001814e-10, 3.042306406797479e-10, 3.068226783753403e-10, 3.09421765987139e-10, 3.12028125559749e-10, 3.1464195138219964e-10, 3.17263521010247e-10, 3.1989300097734485e-10, 3.225306410836737e-10, 3.2517669112941405e-10, 3.2783134540359526e-10, 3.3049485370639786e-10, 3.3316743808242677e-10, 3.3584937608743815e-10, 3.385408342548857e-10, 3.4124211789610115e-10, 3.4395342130011386e-10, 3.4667499426710435e-10, 3.494071143528288e-10, 3.521500313574677e-10, 3.54903967325626e-10, 3.576691720574843e-10, 3.6044595086437425e-10, 3.632345535464765e-10, 3.660352021483959e-10, 3.688482297370399e-10, 3.716738583570134e-10, 3.7451239331964814e-10, 3.773641121807003e-10, 3.802292924959261e-10, 3.831082673322328e-10, 3.8600128648980103e-10, 3.8890865527996255e-10, 3.9183070676962473e-10, 3.9476774627011935e-10, 3.977200790927782e-10, 4.006880383045086e-10, 4.0367195697221803e-10, 4.066721681628138e-10, 4.0968900494320337e-10, 4.127228558914453e-10, 4.15774054074447e-10, 4.188429603146915e-10, 4.2192993543466173e-10, 4.25035395767992e-10, 4.2815970213716525e-10, 4.313032986313914e-10, 4.3446651831757777e-10, 4.376498607960855e-10, 4.408536868893975e-10, 4.4407846844229937e-10, 4.4732464954400086e-10, 4.5059267428371186e-10, 4.538830145062178e-10, 4.5719619756745544e-10, 4.605326675566346e-10, 4.638929240741163e-10, 4.672775499869886e-10, 4.706869893844612e-10, 4.74121908400349e-10, 4.775827511238617e-10, 4.810701836888143e-10, 4.845848167178701e-10, 4.881271498113904e-10, 4.916979601254923e-10, 4.952977472605369e-10, 4.989272883726414e-10, 5.025872495956207e-10, 5.062783525744408e-10, 5.100013189540675e-10, 5.13756870379467e-10, 5.175458395179078e-10, 5.21369003525507e-10, 5.252272505806843e-10, 5.29121357839557e-10, 5.330522134805449e-10, 5.3702081670437e-10, 5.41028055689452e-10, 5.450749851476644e-10, 5.491624932574268e-10, 5.532918012640664e-10, 5.574638528571541e-10, 5.616799247931681e-10, 5.659410717839819e-10, 5.702485705860738e-10, 5.746036979559221e-10, 5.790077306500052e-10, 5.83462111958255e-10, 5.879682296594524e-10, 5.925275825546805e-10, 5.971417249561739e-10, 6.01812211176167e-10, 6.065408175714992e-10, 6.113292094767075e-10, 6.16179329782085e-10, 6.21092954844471e-10, 6.260721940876124e-10, 6.311191569352559e-10, 6.362359528111483e-10, 6.414249686947926e-10, 6.466885360545405e-10, 6.520292639144998e-10, 6.574497612987784e-10, 6.629528592760892e-10, 6.685415554485985e-10, 6.742187919073217e-10, 6.799880103436351e-10, 6.858525969377638e-10, 6.918161599145378e-10, 6.978825850545434e-10, 7.040559801829716e-10, 7.103406751696184e-10, 7.167412219288849e-10, 7.232625609532306e-10, 7.2990985477972e-10, 7.366885990123251e-10, 7.436047333442275e-10, 7.506645305355164e-10, 7.57874762946642e-10, 7.652426470272644e-10, 7.727759543385559e-10, 7.804830115532013e-10, 7.883728114777e-10, 7.964550685635174e-10, 8.047402189070851e-10, 8.132396422944055e-10, 8.219657177122031e-10, 8.309318788590758e-10, 8.401527806789488e-10, 8.496445214056791e-10, 8.594246980742071e-10, 8.695127395874636e-10, 8.799300732498239e-10, 8.90700457834015e-10, 9.01850316648023e-10, 9.134091816243028e-10, 9.254100818978372e-10, 9.37890431984556e-10, 9.508922538259412e-10, 9.64463842123564e-10, 9.78660263939446e-10, 9.935448019859905e-10, 1.0091912860943353e-09, 1.0256859805934937e-09, 1.0431305819125214e-09, 1.0616465484503124e-09, 1.0813799855569073e-09, 1.1025096391392708e-09, 1.1252564435793033e-09, 1.149898620766976e-09, 1.176793218427008e-09, 1.2064089727203964e-09, 1.2393785997488749e-09, 1.2765849488616254e-09, 1.319313880365769e-09, 1.36954347862428e-09, 1.4305497897382224e-09, 1.5083649884672923e-09, 1.6160853766322703e-09, 1.7921247819074893e-09]); - fe = $toNativeArray($kindFloat32, [1, 0.9381436705589294, 0.900469958782196, 0.8717043399810791, 0.847785472869873, 0.8269932866096497, 0.8084216713905334, 0.7915276288986206, 0.7759568691253662, 0.7614634037017822, 0.7478685975074768, 0.7350381016731262, 0.7228676676750183, 0.7112747430801392, 0.7001926302909851, 0.6895664930343628, 0.6793505549430847, 0.669506311416626, 0.6600008606910706, 0.6508058309555054, 0.6418967247009277, 0.633251965045929, 0.62485271692276, 0.6166821718215942, 0.608725368976593, 0.6009689569473267, 0.5934008955955505, 0.5860103368759155, 0.5787873864173889, 0.5717230439186096, 0.5648092031478882, 0.5580382943153381, 0.5514034032821655, 0.5448982119560242, 0.5385168790817261, 0.5322538614273071, 0.526104211807251, 0.5200631618499756, 0.5141264200210571, 0.5082897543907166, 0.5025495290756226, 0.4969019889831543, 0.4913438558578491, 0.4858720004558563, 0.48048335313796997, 0.4751752018928528, 0.4699448347091675, 0.4647897481918335, 0.4597076177597046, 0.4546961486339569, 0.4497532546520233, 0.44487687945365906, 0.4400651156902313, 0.4353161156177521, 0.4306281507015228, 0.42599955201148987, 0.42142874002456665, 0.4169141948223114, 0.4124544560909271, 0.40804818272590637, 0.4036940038204193, 0.39939069747924805, 0.3951369822025299, 0.39093172550201416, 0.38677382469177246, 0.38266217708587646, 0.378595769405365, 0.37457355856895447, 0.37059465050697327, 0.366658091545105, 0.362762987613678, 0.358908474445343, 0.35509374737739563, 0.35131800174713135, 0.3475804924964905, 0.34388044476509094, 0.34021714329719543, 0.33658990263938904, 0.3329980671405792, 0.3294409513473511, 0.32591795921325684, 0.32242849469184875, 0.3189719021320343, 0.3155476748943329, 0.31215524673461914, 0.3087940812110901, 0.30546361207962036, 0.30216339230537415, 0.29889291524887085, 0.29565170407295227, 0.2924392819404602, 0.2892552316188812, 0.28609907627105713, 0.2829704284667969, 0.27986884117126465, 0.2767939269542694, 0.2737452983856201, 0.2707225978374481, 0.26772540807724, 0.26475343108177185, 0.2618062496185303, 0.258883535861969, 0.2559850215911865, 0.25311028957366943, 0.25025907158851624, 0.24743106961250305, 0.2446259707212448, 0.24184346199035645, 0.23908329010009766, 0.23634515702724457, 0.2336287796497345, 0.23093391954898834, 0.22826029360294342, 0.22560766339302063, 0.22297576069831848, 0.22036437690258026, 0.21777324378490448, 0.21520215272903442, 0.212650865316391, 0.21011915802955627, 0.20760682225227356, 0.20511364936828613, 0.20263944566249847, 0.20018397271633148, 0.19774706661701202, 0.1953285187482834, 0.19292815029621124, 0.19054576754570007, 0.18818120658397675, 0.18583425879478455, 0.18350479006767273, 0.18119260668754578, 0.17889754474163055, 0.17661945521831512, 0.17435817420482635, 0.1721135377883911, 0.16988539695739746, 0.16767361760139465, 0.16547803580760956, 0.16329853236675262, 0.16113494336605072, 0.1589871346950531, 0.15685498714447021, 0.15473836660385132, 0.15263713896274567, 0.1505511850118637, 0.1484803706407547, 0.14642459154129028, 0.1443837285041809, 0.14235764741897583, 0.1403462439775467, 0.13834942877292633, 0.136367067694664, 0.13439907133579254, 0.1324453204870224, 0.1305057406425476, 0.12858019769191742, 0.12666863203048706, 0.12477091699838638, 0.12288697808980942, 0.1210167184472084, 0.11916005611419678, 0.11731690168380737, 0.11548716574907303, 0.11367076635360718, 0.11186762899160385, 0.11007767915725708, 0.1083008274435997, 0.10653700679540634, 0.10478614270687103, 0.1030481606721878, 0.10132300108671188, 0.0996105819940567, 0.09791085124015808, 0.09622374176979065, 0.09454918652772903, 0.09288713335990906, 0.09123751521110535, 0.08960027992725372, 0.08797537535429001, 0.08636274188756943, 0.0847623273730278, 0.08317409455776215, 0.08159798383712769, 0.08003395050764084, 0.07848194986581802, 0.07694194465875626, 0.07541389018297195, 0.07389774918556213, 0.07239348441362381, 0.070901058614254, 0.06942043453454971, 0.06795158982276917, 0.06649449467658997, 0.06504911929368973, 0.06361543387174606, 0.06219341605901718, 0.06078304722905159, 0.0593843050301075, 0.05799717456102371, 0.05662164092063904, 0.05525768920779228, 0.05390531197190285, 0.05256449431180954, 0.05123523622751236, 0.04991753399372101, 0.04861138388514519, 0.047316793352365494, 0.04603376239538193, 0.044762298464775085, 0.04350241273641586, 0.04225412383675575, 0.04101744294166565, 0.039792392402887344, 0.03857899457216263, 0.03737728297710419, 0.03618728369474411, 0.03500903770327568, 0.03384258225560188, 0.0326879620552063, 0.031545232981443405, 0.030414443463087082, 0.0292956605553627, 0.028188949450850487, 0.027094384655356407, 0.02601204626262188, 0.024942025542259216, 0.023884421214461327, 0.022839335724711418, 0.021806888282299042, 0.020787203684449196, 0.019780423492193222, 0.018786700442433357, 0.017806200310587883, 0.016839107498526573, 0.015885621309280396, 0.014945968054234982, 0.01402039173990488, 0.013109165243804455, 0.012212592177093029, 0.011331013403832912, 0.010464809834957123, 0.009614413604140282, 0.008780314587056637, 0.007963077165186405, 0.007163353264331818, 0.0063819061033427715, 0.005619642324745655, 0.004877655766904354, 0.004157294984906912, 0.003460264764726162, 0.0027887988835573196, 0.0021459676790982485, 0.001536299823783338, 0.0009672692976891994, 0.0004541343660093844]); - kn = $toNativeArray($kindUint32, [1991057938, 0, 1611602771, 1826899878, 1918584482, 1969227037, 2001281515, 2023368125, 2039498179, 2051788381, 2061460127, 2069267110, 2075699398, 2081089314, 2085670119, 2089610331, 2093034710, 2096037586, 2098691595, 2101053571, 2103168620, 2105072996, 2106796166, 2108362327, 2109791536, 2111100552, 2112303493, 2113412330, 2114437283, 2115387130, 2116269447, 2117090813, 2117856962, 2118572919, 2119243101, 2119871411, 2120461303, 2121015852, 2121537798, 2122029592, 2122493434, 2122931299, 2123344971, 2123736059, 2124106020, 2124456175, 2124787725, 2125101763, 2125399283, 2125681194, 2125948325, 2126201433, 2126441213, 2126668298, 2126883268, 2127086657, 2127278949, 2127460589, 2127631985, 2127793506, 2127945490, 2128088244, 2128222044, 2128347141, 2128463758, 2128572095, 2128672327, 2128764606, 2128849065, 2128925811, 2128994934, 2129056501, 2129110560, 2129157136, 2129196237, 2129227847, 2129251929, 2129268426, 2129277255, 2129278312, 2129271467, 2129256561, 2129233410, 2129201800, 2129161480, 2129112170, 2129053545, 2128985244, 2128906855, 2128817916, 2128717911, 2128606255, 2128482298, 2128345305, 2128194452, 2128028813, 2127847342, 2127648860, 2127432031, 2127195339, 2126937058, 2126655214, 2126347546, 2126011445, 2125643893, 2125241376, 2124799783, 2124314271, 2123779094, 2123187386, 2122530867, 2121799464, 2120980787, 2120059418, 2119015917, 2117825402, 2116455471, 2114863093, 2112989789, 2110753906, 2108037662, 2104664315, 2100355223, 2094642347, 2086670106, 2074676188, 2054300022, 2010539237]); - wn = $toNativeArray($kindFloat32, [1.7290404663583558e-09, 1.2680928529462676e-10, 1.689751810696194e-10, 1.9862687883343e-10, 2.223243117382978e-10, 2.4244936613904144e-10, 2.601613091623989e-10, 2.761198769629658e-10, 2.9073962681813725e-10, 3.042996965518796e-10, 3.169979556627567e-10, 3.289802041894774e-10, 3.4035738116777736e-10, 3.5121602848242617e-10, 3.61625090983253e-10, 3.7164057942185025e-10, 3.813085680537398e-10, 3.906675816178762e-10, 3.997501218933053e-10, 4.0858399996679395e-10, 4.1719308563337165e-10, 4.255982233303257e-10, 4.3381759295968436e-10, 4.4186720948857783e-10, 4.497613115272969e-10, 4.57512583373898e-10, 4.6513240481438345e-10, 4.726310454117311e-10, 4.800177477726209e-10, 4.873009773476156e-10, 4.944885056978876e-10, 5.015873272284921e-10, 5.086040477664255e-10, 5.155446070048697e-10, 5.224146670812502e-10, 5.292193350214802e-10, 5.359634958068682e-10, 5.426517013518151e-10, 5.492881705038144e-10, 5.558769555769061e-10, 5.624218868405251e-10, 5.689264614971989e-10, 5.75394121238304e-10, 5.818281967329142e-10, 5.882316855831959e-10, 5.946076964136182e-10, 6.009590047817426e-10, 6.072883862451306e-10, 6.135985053390414e-10, 6.19892026598734e-10, 6.261713370037114e-10, 6.324390455780815e-10, 6.386973727678935e-10, 6.449488165749528e-10, 6.511955974453087e-10, 6.574400468473129e-10, 6.636843297158634e-10, 6.699307220081607e-10, 6.761814441702541e-10, 6.824387166481927e-10, 6.887046488657234e-10, 6.949815167800466e-10, 7.012714853260604e-10, 7.075767749498141e-10, 7.13899661608508e-10, 7.202424212593428e-10, 7.266072743483676e-10, 7.329966078550854e-10, 7.394128087589991e-10, 7.458582640396116e-10, 7.523354716987285e-10, 7.588469852493063e-10, 7.653954137154528e-10, 7.719834771435785e-10, 7.786139510912449e-10, 7.852897221383159e-10, 7.920137878869582e-10, 7.987892014504894e-10, 8.056192379868321e-10, 8.125072836762115e-10, 8.194568912323064e-10, 8.264716688799467e-10, 8.3355555791087e-10, 8.407127216614185e-10, 8.479473234679347e-10, 8.552640262671218e-10, 8.626675485068347e-10, 8.701631637464402e-10, 8.777562010564566e-10, 8.854524335966119e-10, 8.932581896381464e-10, 9.011799639857543e-10, 9.092249730890956e-10, 9.174008219758889e-10, 9.25715837318819e-10, 9.341788453909317e-10, 9.42799727177146e-10, 9.515889187738935e-10, 9.605578554783278e-10, 9.697193048552322e-10, 9.790869226478094e-10, 9.886760299337993e-10, 9.985036131254788e-10, 1.008588212947359e-09, 1.0189509236369076e-09, 1.0296150598776421e-09, 1.040606933955246e-09, 1.0519566329136865e-09, 1.0636980185552147e-09, 1.0758701707302976e-09, 1.0885182755160372e-09, 1.101694735439196e-09, 1.115461056855338e-09, 1.1298901814171813e-09, 1.1450695946990663e-09, 1.1611052119775422e-09, 1.178127595480305e-09, 1.1962995039027646e-09, 1.2158286599728285e-09, 1.2369856250415978e-09, 1.2601323318151003e-09, 1.2857697129220469e-09, 1.3146201904845611e-09, 1.3477839955200466e-09, 1.3870635751089821e-09, 1.43574030442295e-09, 1.5008658760251592e-09, 1.6030947680434338e-09]); - fn = $toNativeArray($kindFloat32, [1, 0.963599681854248, 0.9362826943397522, 0.9130436182022095, 0.8922816514968872, 0.8732430338859558, 0.8555005788803101, 0.8387836217880249, 0.8229072093963623, 0.8077383041381836, 0.7931770086288452, 0.7791460752487183, 0.7655841708183289, 0.7524415850639343, 0.7396772503852844, 0.7272568941116333, 0.7151514887809753, 0.7033361196517944, 0.6917891502380371, 0.6804918646812439, 0.6694276928901672, 0.6585819721221924, 0.6479418277740479, 0.6374954581260681, 0.6272324919700623, 0.6171433925628662, 0.6072195172309875, 0.5974531769752502, 0.5878370404243469, 0.5783646702766418, 0.5690299868583679, 0.5598273873329163, 0.550751805305481, 0.5417983531951904, 0.5329626798629761, 0.5242405533790588, 0.5156282186508179, 0.5071220397949219, 0.49871864914894104, 0.4904148280620575, 0.48220765590667725, 0.47409430146217346, 0.466072142124176, 0.45813870429992676, 0.45029163360595703, 0.44252872467041016, 0.4348478317260742, 0.42724698781967163, 0.41972434520721436, 0.41227802634239197, 0.40490642189979553, 0.39760786294937134, 0.3903807997703552, 0.3832238018512726, 0.3761354684829712, 0.3691144585609436, 0.36215949058532715, 0.3552693724632263, 0.3484429717063904, 0.3416791558265686, 0.33497685194015503, 0.32833510637283325, 0.3217529058456421, 0.3152293860912323, 0.30876362323760986, 0.3023548424243927, 0.2960021495819092, 0.2897048592567444, 0.28346219658851624, 0.2772735059261322, 0.271138072013855, 0.2650552988052368, 0.25902456045150757, 0.25304529070854187, 0.24711695313453674, 0.24123899638652802, 0.23541094362735748, 0.22963231801986694, 0.22390270233154297, 0.21822164952754974, 0.21258877217769623, 0.20700371265411377, 0.20146611332893372, 0.1959756463766098, 0.19053204357624054, 0.18513499200344086, 0.17978426814079285, 0.1744796335697174, 0.16922089457511902, 0.16400785744190216, 0.1588403731584549, 0.15371830761432648, 0.14864157140254974, 0.14361007511615753, 0.13862377405166626, 0.13368265330791473, 0.12878671288490295, 0.12393598258495331, 0.11913054436445236, 0.11437050998210907, 0.10965602099895477, 0.1049872562289238, 0.10036443918943405, 0.09578784555196762, 0.09125780314207077, 0.08677466958761215, 0.08233889937400818, 0.07795098423957825, 0.07361150532960892, 0.06932111829519272, 0.06508058309555054, 0.06089077144861221, 0.05675266310572624, 0.05266740173101425, 0.048636294901371, 0.044660862535238266, 0.040742866694927216, 0.03688438981771469, 0.03308788686990738, 0.029356317594647408, 0.025693291798233986, 0.02210330404341221, 0.018592102453112602, 0.015167297795414925, 0.011839478276669979, 0.0086244847625494, 0.005548994988203049, 0.0026696291752159595]); - rng_cooked = $toNativeArray($kindInt64, [new $Int64(1173834291, 3952672746), new $Int64(1081821761, 3130416987), new $Int64(324977939, 3414273807), new $Int64(1241840476, 2806224363), new $Int64(669549340, 1997590414), new $Int64(2103305448, 2402795971), new $Int64(1663160183, 1140819369), new $Int64(1120601685, 1788868961), new $Int64(1848035537, 1089001426), new $Int64(1235702047, 873593504), new $Int64(1911387977, 581324885), new $Int64(492609478, 1609182556), new $Int64(1069394745, 1241596776), new $Int64(1895445337, 1771189259), new $Int64(772864846, 3467012610), new $Int64(2006957225, 2344407434), new $Int64(402115761, 782467244), new $Int64(26335124, 3404933915), new $Int64(1063924276, 618867887), new $Int64(1178782866, 520164395), new $Int64(555910815, 1341358184), new $Int64(632398609, 665794848), new $Int64(1527227641, 3183648150), new $Int64(1781176124, 696329606), new $Int64(1789146075, 4151988961), new $Int64(60039534, 998951326), new $Int64(1535158725, 1364957564), new $Int64(63173359, 4090230633), new $Int64(649454641, 4009697548), new $Int64(248009524, 2569622517), new $Int64(778703922, 3742421481), new $Int64(1038377625, 1506914633), new $Int64(1738099768, 1983412561), new $Int64(236311649, 1436266083), new $Int64(1035966148, 3922894967), new $Int64(810508934, 1792680179), new $Int64(563141142, 1188796351), new $Int64(1349617468, 405968250), new $Int64(1044074554, 433754187), new $Int64(870549669, 4073162024), new $Int64(1053232044, 433121399), new $Int64(2451824, 4162580594), new $Int64(2010221076, 4132415622), new $Int64(611252600, 3033822028), new $Int64(2016407895, 824682382), new $Int64(2366218, 3583765414), new $Int64(1522878809, 535386927), new $Int64(1637219058, 2286693689), new $Int64(1453075389, 2968466525), new $Int64(193683513, 1351410206), new $Int64(1863677552, 1412813499), new $Int64(492736522, 4126267639), new $Int64(512765208, 2105529399), new $Int64(2132966268, 2413882233), new $Int64(947457634, 32226200), new $Int64(1149341356, 2032329073), new $Int64(106485445, 1356518208), new $Int64(79673492, 3430061722), new $Int64(663048513, 3820169661), new $Int64(481498454, 2981816134), new $Int64(1017155588, 4184371017), new $Int64(206574701, 2119206761), new $Int64(1295374591, 2472200560), new $Int64(1587026100, 2853524696), new $Int64(1307803389, 1681119904), new $Int64(1972496813, 95608918), new $Int64(392686347, 3690479145), new $Int64(941912722, 1397922290), new $Int64(988169623, 1516129515), new $Int64(1827305493, 1547420459), new $Int64(1311333971, 1470949486), new $Int64(194013850, 1336785672), new $Int64(2102397034, 4131677129), new $Int64(755205548, 4246329084), new $Int64(1004983461, 3788585631), new $Int64(2081005363, 3080389532), new $Int64(1501045284, 2215402037), new $Int64(391002300, 1171593935), new $Int64(1408774047, 1423855166), new $Int64(1628305930, 2276716302), new $Int64(1779030508, 2068027241), new $Int64(1369359303, 3427553297), new $Int64(189241615, 3289637845), new $Int64(1057480830, 3486407650), new $Int64(634572984, 3071877822), new $Int64(1159653919, 3363620705), new $Int64(1213226718, 4159821533), new $Int64(2070861710, 1894661), new $Int64(1472989750, 1156868282), new $Int64(348271067, 776219088), new $Int64(1646054810, 2425634259), new $Int64(1716021749, 680510161), new $Int64(1573220192, 1310101429), new $Int64(1095885995, 2964454134), new $Int64(1821788136, 3467098407), new $Int64(1990672920, 2109628894), new $Int64(7834944, 1232604732), new $Int64(309412934, 3261916179), new $Int64(1699175360, 434597899), new $Int64(235436061, 1624796439), new $Int64(521080809, 3589632480), new $Int64(1198416575, 864579159), new $Int64(208735487, 1380889830), new $Int64(619206309, 2654509477), new $Int64(1419738251, 1468209306), new $Int64(403198876, 100794388), new $Int64(956062190, 2991674471), new $Int64(1938816907, 2224662036), new $Int64(1973824487, 977097250), new $Int64(1351320195, 726419512), new $Int64(1964023751, 1747974366), new $Int64(1394388465, 1556430604), new $Int64(1097991433, 1080776742), new $Int64(1761636690, 280794874), new $Int64(117767733, 919835643), new $Int64(1180474222, 3434019658), new $Int64(196069168, 2461941785), new $Int64(133215641, 3615001066), new $Int64(417204809, 3103414427), new $Int64(790056561, 3380809712), new $Int64(879802240, 2724693469), new $Int64(547796833, 598827710), new $Int64(300924196, 3452273442), new $Int64(2071705424, 649274915), new $Int64(1346182319, 2585724112), new $Int64(636549385, 3165579553), new $Int64(1185578221, 2635894283), new $Int64(2094573470, 2053289721), new $Int64(985976581, 3169337108), new $Int64(1170569632, 144717764), new $Int64(1079216270, 1383666384), new $Int64(2022678706, 681540375), new $Int64(1375448925, 537050586), new $Int64(182715304, 315246468), new $Int64(226402871, 849323088), new $Int64(1262421183, 45543944), new $Int64(1201038398, 2319052083), new $Int64(2106775454, 3613090841), new $Int64(560472520, 2992171180), new $Int64(1765620479, 2068244785), new $Int64(917538188, 4239862634), new $Int64(777927839, 3892253031), new $Int64(720683925, 958186149), new $Int64(1724185863, 1877702262), new $Int64(1357886971, 837674867), new $Int64(1837048883, 1507589294), new $Int64(1905518400, 873336795), new $Int64(267722611, 2764496274), new $Int64(341003118, 4196182374), new $Int64(1080717893, 550964545), new $Int64(818747069, 420611474), new $Int64(222653272, 204265180), new $Int64(1549974541, 1787046383), new $Int64(1215581865, 3102292318), new $Int64(418321538, 1552199393), new $Int64(1243493047, 980542004), new $Int64(267284263, 3293718720), new $Int64(1179528763, 3771917473), new $Int64(599484404, 2195808264), new $Int64(252818753, 3894702887), new $Int64(780007692, 2099949527), new $Int64(1424094358, 338442522), new $Int64(490737398, 637158004), new $Int64(419862118, 281976339), new $Int64(574970164, 3619802330), new $Int64(1715552825, 3084554784), new $Int64(882872465, 4129772886), new $Int64(43084605, 1680378557), new $Int64(525521057, 3339087776), new $Int64(1680500332, 4220317857), new $Int64(211654685, 2959322499), new $Int64(1675600481, 1488354890), new $Int64(1312620086, 3958162143), new $Int64(920972075, 2773705983), new $Int64(1876039582, 225908689), new $Int64(963748535, 908216283), new $Int64(1541787429, 3574646075), new $Int64(319760557, 1936937569), new $Int64(1519770881, 75492235), new $Int64(816689472, 1935193178), new $Int64(2142521206, 2018250883), new $Int64(455141620, 3943126022), new $Int64(1546084160, 3066544345), new $Int64(1932392669, 2793082663), new $Int64(908474287, 3297036421), new $Int64(1640597065, 2206987825), new $Int64(1594236910, 807894872), new $Int64(366158341, 766252117), new $Int64(2060649606, 3833114345), new $Int64(845619743, 1255067973), new $Int64(1201145605, 741697208), new $Int64(671241040, 2810093753), new $Int64(1109032642, 4229340371), new $Int64(1462188720, 1361684224), new $Int64(988084219, 1906263026), new $Int64(475781207, 3904421704), new $Int64(1523946520, 1769075545), new $Int64(1062308525, 2621599764), new $Int64(1279509432, 3431891480), new $Int64(404732502, 1871896503), new $Int64(128756421, 1412808876), new $Int64(1605404688, 952876175), new $Int64(1917039957, 1824438899), new $Int64(1662295856, 1005035476), new $Int64(1990909507, 527508597), new $Int64(1288873303, 3066806859), new $Int64(565995893, 3244940914), new $Int64(1257737460, 209092916), new $Int64(1899814242, 1242699167), new $Int64(1433653252, 456723774), new $Int64(1776978905, 1001252870), new $Int64(1468772157, 2026725874), new $Int64(857254202, 2137562569), new $Int64(765939740, 3183366709), new $Int64(1533887628, 2612072960), new $Int64(56977098, 1727148468), new $Int64(949899753, 3803658212), new $Int64(1883670356, 479946959), new $Int64(685713571, 1562982345), new $Int64(201241205, 1766109365), new $Int64(700596547, 3257093788), new $Int64(1962768719, 2365720207), new $Int64(93384808, 3742754173), new $Int64(1689098413, 2878193673), new $Int64(1096135042, 2174002182), new $Int64(1313222695, 3573511231), new $Int64(1392911121, 1760299077), new $Int64(771856457, 2260779833), new $Int64(1281464374, 1452805722), new $Int64(917811730, 2940011802), new $Int64(1890251082, 1886183802), new $Int64(893897673, 2514369088), new $Int64(1644345561, 3924317791), new $Int64(172616216, 500935732), new $Int64(1403501753, 676580929), new $Int64(581571365, 1184984890), new $Int64(1455515235, 1271474274), new $Int64(318728910, 3163791473), new $Int64(2051027584, 2842487377), new $Int64(1511537551, 2170968612), new $Int64(573262976, 3535856740), new $Int64(94256461, 1488599718), new $Int64(966951817, 3408913763), new $Int64(60951736, 2501050084), new $Int64(1272353200, 1639124157), new $Int64(138001144, 4088176393), new $Int64(1574896563, 3989947576), new $Int64(1982239940, 3414355209), new $Int64(1355154361, 2275136352), new $Int64(89709303, 2151835223), new $Int64(1216338715, 1654534827), new $Int64(1467562197, 377892833), new $Int64(1664767638, 660204544), new $Int64(85706799, 390828249), new $Int64(725310955, 3402783878), new $Int64(678849488, 3717936603), new $Int64(1113532086, 2211058823), new $Int64(1564224320, 2692150867), new $Int64(1952770442, 1928910388), new $Int64(788716862, 3931011137), new $Int64(1083670504, 1112701047), new $Int64(2079333076, 2452299106), new $Int64(1251318826, 2337204777), new $Int64(1774877857, 273889282), new $Int64(1798719843, 1462008793), new $Int64(2138834788, 1554494002), new $Int64(952516517, 182675323), new $Int64(548928884, 1882802136), new $Int64(589279648, 3700220025), new $Int64(381039426, 3083431543), new $Int64(1295624457, 3622207527), new $Int64(338126939, 432729309), new $Int64(480013522, 2391914317), new $Int64(297925497, 235747924), new $Int64(2120733629, 3088823825), new $Int64(1402403853, 2314658321), new $Int64(1165929723, 2957634338), new $Int64(501323675, 4117056981), new $Int64(1564699815, 1482500298), new $Int64(1406657158, 840489337), new $Int64(799522364, 3483178565), new $Int64(532129761, 2074004656), new $Int64(724246478, 3643392642), new $Int64(1482330167, 1583624461), new $Int64(1261660694, 287473085), new $Int64(1667835381, 3136843981), new $Int64(1138806821, 1266970974), new $Int64(135185781, 1998688839), new $Int64(392094735, 1492900209), new $Int64(1031326774, 1538112737), new $Int64(76914806, 2207265429), new $Int64(260686035, 963263315), new $Int64(1671145500, 2295892134), new $Int64(1068469660, 2002560897), new $Int64(1791233343, 1369254035), new $Int64(33436120, 3353312708), new $Int64(57507843, 947771099), new $Int64(201728503, 1747061399), new $Int64(1507240140, 2047354631), new $Int64(720000810, 4165367136), new $Int64(479265078, 3388864963), new $Int64(1195302398, 286492130), new $Int64(2045622690, 2795735007), new $Int64(1431753082, 3703961339), new $Int64(1999047161, 1797825479), new $Int64(1429039600, 1116589674), new $Int64(482063550, 2593309206), new $Int64(1329049334, 3404995677), new $Int64(1396904208, 3453462936), new $Int64(1014767077, 3016498634), new $Int64(75698599, 1650371545), new $Int64(1592007860, 212344364), new $Int64(1127766888, 3843932156), new $Int64(1399463792, 3573129983), new $Int64(1256901817, 665897820), new $Int64(1071492673, 1675628772), new $Int64(243225682, 2831752928), new $Int64(2120298836, 1486294219), new $Int64(193076235, 268782709), new $Int64(1145360145, 4186179080), new $Int64(624342951, 1613720397), new $Int64(857179861, 2703686015), new $Int64(1235864944, 2205342611), new $Int64(1474779655, 1411666394), new $Int64(619028749, 677744900), new $Int64(270855115, 4172867247), new $Int64(135494707, 2163418403), new $Int64(849547544, 2841526879), new $Int64(1029966689, 1082141470), new $Int64(377371856, 4046134367), new $Int64(51415528, 2142943655), new $Int64(1897659315, 3124627521), new $Int64(998228909, 219992939), new $Int64(1068692697, 1756846531), new $Int64(1283749206, 1225118210), new $Int64(1621625642, 1647770243), new $Int64(111523943, 444807907), new $Int64(2036369448, 3952076173), new $Int64(53201823, 1461839639), new $Int64(315761893, 3699250910), new $Int64(702974850, 1373688981), new $Int64(734022261, 147523747), new $Int64(100152742, 1211276581), new $Int64(1294440951, 2548832680), new $Int64(1144696256, 1995631888), new $Int64(154500578, 2011457303), new $Int64(796460974, 3057425772), new $Int64(667839456, 81484597), new $Int64(465502760, 3646681560), new $Int64(775020923, 635548515), new $Int64(602489502, 2508044581), new $Int64(353263531, 1014917157), new $Int64(719992433, 3214891315), new $Int64(852684611, 959582252), new $Int64(226415134, 3347040449), new $Int64(1784615552, 4102971975), new $Int64(397887437, 4078022210), new $Int64(1610679822, 2851767182), new $Int64(749162636, 1540160644), new $Int64(598384772, 1057290595), new $Int64(2034890660, 3907769253), new $Int64(579300318, 4248952684), new $Int64(1092907599, 132554364), new $Int64(1061621234, 1029351092), new $Int64(697840928, 2583007416), new $Int64(298619124, 1486185789), new $Int64(55905697, 2871589073), new $Int64(2017643612, 723203291), new $Int64(146250550, 2494333952), new $Int64(1064490251, 2230939180), new $Int64(342915576, 3943232912), new $Int64(1768732449, 2181367922), new $Int64(1418222537, 2889274791), new $Int64(1824032949, 2046728161), new $Int64(1653899792, 1376052477), new $Int64(1022327048, 381236993), new $Int64(1034385958, 3188942166), new $Int64(2073003539, 350070824), new $Int64(144881592, 61758415), new $Int64(1405659422, 3492950336), new $Int64(117440928, 3093818430), new $Int64(1693893113, 2962480613), new $Int64(235432940, 3154871160), new $Int64(511005079, 3228564679), new $Int64(610731502, 888276216), new $Int64(1200780674, 3574998604), new $Int64(870415268, 1967526716), new $Int64(591335707, 1554691298), new $Int64(574459414, 339944798), new $Int64(1223764147, 1154515356), new $Int64(1825645307, 967516237), new $Int64(1546195135, 596588202), new $Int64(279882768, 3764362170), new $Int64(492091056, 266611402), new $Int64(1754227768, 2047856075), new $Int64(1146757215, 21444105), new $Int64(1198058894, 3065563181), new $Int64(1915064845, 1140663212), new $Int64(633187674, 2323741028), new $Int64(2126290159, 3103873707), new $Int64(1008658319, 2766828349), new $Int64(1661896145, 1970872996), new $Int64(1628585413, 3766615585), new $Int64(1552335120, 2036813414), new $Int64(152606527, 3105536507), new $Int64(13954645, 3396176938), new $Int64(1426081645, 1377154485), new $Int64(2085644467, 3807014186), new $Int64(543009040, 3710110597), new $Int64(396058129, 916420443), new $Int64(734556788, 2103831255), new $Int64(381322154, 717331943), new $Int64(572884752, 3550505941), new $Int64(45939673, 378749927), new $Int64(149867929, 611017331), new $Int64(592130075, 758907650), new $Int64(1012992349, 154266815), new $Int64(1107028706, 1407468696), new $Int64(469292398, 970098704), new $Int64(1862426162, 1971660656), new $Int64(998365243, 3332747885), new $Int64(1947089649, 1935189867), new $Int64(1510248801, 203520055), new $Int64(842317902, 3916463034), new $Int64(1758884993, 3474113316), new $Int64(1036101639, 316544223), new $Int64(373738757, 1650844677), new $Int64(1240292229, 4267565603), new $Int64(1077208624, 2501167616), new $Int64(626831785, 3929401789), new $Int64(56122796, 337170252), new $Int64(1186981558, 2061966842), new $Int64(1843292800, 2508461464), new $Int64(206012532, 2791377107), new $Int64(1240791848, 1227227588), new $Int64(1813978778, 1709681848), new $Int64(1153692192, 3768820575), new $Int64(1145186199, 2887126398), new $Int64(700372314, 296561685), new $Int64(700300844, 3729960077), new $Int64(575172304, 372833036), new $Int64(2078875613, 2409779288), new $Int64(1829161290, 555274064), new $Int64(1041887929, 4239804901), new $Int64(1839403216, 3723486978), new $Int64(498390553, 2145871984), new $Int64(564717933, 3565480803), new $Int64(578829821, 2197313814), new $Int64(974785092, 3613674566), new $Int64(438638731, 3042093666), new $Int64(2050927384, 3324034321), new $Int64(869420878, 3708873369), new $Int64(946682149, 1698090092), new $Int64(1618900382, 4213940712), new $Int64(304003901, 2087477361), new $Int64(381315848, 2407950639), new $Int64(851258090, 3942568569), new $Int64(923583198, 4088074412), new $Int64(723260036, 2964773675), new $Int64(1473561819, 1539178386), new $Int64(1062961552, 2694849566), new $Int64(460977733, 2120273838), new $Int64(542912908, 2484608657), new $Int64(880846449, 2956190677), new $Int64(1970902366, 4223313749), new $Int64(662161910, 3502682327), new $Int64(705634754, 4133891139), new $Int64(1116124348, 1166449596), new $Int64(1038247601, 3362705993), new $Int64(93734798, 3892921029), new $Int64(1876124043, 786869787), new $Int64(1057490746, 1046342263), new $Int64(242763728, 493777327), new $Int64(1293910447, 3304827646), new $Int64(616460742, 125356352), new $Int64(499300063, 74094113), new $Int64(1351896723, 2500816079), new $Int64(1657235204, 514015239), new $Int64(1377565129, 543520454), new $Int64(107706923, 3614531153), new $Int64(2056746300, 2356753985), new $Int64(1390062617, 2018141668), new $Int64(131272971, 2087974891), new $Int64(644556607, 3166972343), new $Int64(372256200, 1517638666), new $Int64(1212207984, 173466846), new $Int64(1451709187, 4241513471), new $Int64(733932806, 2783126920), new $Int64(1972004134, 4167264826), new $Int64(29260506, 3907395640), new $Int64(1236582087, 1539634186), new $Int64(1551526350, 178241987), new $Int64(2034206012, 182168164), new $Int64(1044953189, 2386154934), new $Int64(1379126408, 4077374341), new $Int64(32803926, 1732699140), new $Int64(1726425903, 1041306002), new $Int64(1860414813, 2068001749), new $Int64(1005320202, 3208962910), new $Int64(844054010, 697710380), new $Int64(638124245, 2228431183), new $Int64(1337169671, 3554678728), new $Int64(1396494601, 173470263), new $Int64(2061597383, 3848297795), new $Int64(1220546671, 246236185), new $Int64(163293187, 2066374846), new $Int64(1771673660, 312890749), new $Int64(703378057, 3573310289), new $Int64(1548631747, 143166754), new $Int64(613554316, 2081511079), new $Int64(1197802104, 486038032), new $Int64(240999859, 2982218564), new $Int64(364901986, 1000939191), new $Int64(1902782651, 2750454885), new $Int64(1475638791, 3375313137), new $Int64(503615608, 881302957), new $Int64(638698903, 2514186393), new $Int64(443860803, 360024739), new $Int64(1399671872, 292500025), new $Int64(1381210821, 2276300752), new $Int64(521803381, 4069087683), new $Int64(208500981, 1637778212), new $Int64(720490469, 1676670893), new $Int64(1067262482, 3855174429), new $Int64(2114075974, 2067248671), new $Int64(2058057389, 2884561259), new $Int64(1341742553, 2456511185), new $Int64(983726246, 561175414), new $Int64(427994085, 432588903), new $Int64(885133709, 4059399550), new $Int64(2054387382, 1075014784), new $Int64(413651020, 2728058415), new $Int64(1839142064, 1299703678), new $Int64(1262333188, 2347583393), new $Int64(1285481956, 2468164145), new $Int64(989129637, 1140014346), new $Int64(2033889184, 1936972070), new $Int64(409904655, 3870530098), new $Int64(1662989391, 1717789158), new $Int64(1914486492, 1153452491), new $Int64(1157059232, 3948827651), new $Int64(790338018, 2101413152), new $Int64(1495744672, 3854091229), new $Int64(83644069, 4215565463), new $Int64(762206335, 1202710438), new $Int64(1582574611, 2072216740), new $Int64(705690639, 2066751068), new $Int64(33900336, 173902580), new $Int64(1405499842, 142459001), new $Int64(172391592, 1889151926), new $Int64(1648540523, 3034199774), new $Int64(1618587731, 516490102), new $Int64(93114264, 3692577783), new $Int64(68662295, 2953948865), new $Int64(1826544975, 4041040923), new $Int64(204965672, 592046130), new $Int64(1441840008, 384297211), new $Int64(95834184, 265863924), new $Int64(2101717619, 1333136237), new $Int64(1499611781, 1406273556), new $Int64(1074670496, 426305476), new $Int64(125704633, 2750898176), new $Int64(488068495, 1633944332), new $Int64(2037723464, 3236349343), new $Int64(444060402, 4013676611), new $Int64(1718532237, 2265047407), new $Int64(1433593806, 875071080), new $Int64(1804436145, 1418843655), new $Int64(2009228711, 451657300), new $Int64(1229446621, 1866374663), new $Int64(1653472867, 1551455622), new $Int64(577191481, 3560962459), new $Int64(1669204077, 3347903778), new $Int64(1849156454, 2675874918), new $Int64(316128071, 2762991672), new $Int64(530492383, 3689068477), new $Int64(844089962, 4071997905), new $Int64(1508155730, 1381702441), new $Int64(2089931018, 2373284878), new $Int64(1283216186, 2143983064), new $Int64(308739063, 1938207195), new $Int64(1754949306, 1188152253), new $Int64(1272345009, 615870490), new $Int64(742653194, 2662252621), new $Int64(1477718295, 3839976789), new $Int64(56149435, 306752547), new $Int64(720795581, 2162363077), new $Int64(2090431015, 2767224719), new $Int64(675859549, 2628837712), new $Int64(1678405918, 2967771969), new $Int64(1694285728, 499792248), new $Int64(403352367, 4285253508), new $Int64(962357072, 2856511070), new $Int64(679471692, 2526409716), new $Int64(353777175, 1240875658), new $Int64(1232590226, 2577342868), new $Int64(1146185433, 4136853496), new $Int64(670368674, 2403540137), new $Int64(1372824515, 1371410668), new $Int64(1970921600, 371758825), new $Int64(1706420536, 1528834084), new $Int64(2075795018, 1504757260), new $Int64(685663576, 699052551), new $Int64(1641940109, 3347789870), new $Int64(1951619734, 3430604759), new $Int64(2119672219, 1935601723), new $Int64(966789690, 834676166)]); - globalRand = New(new lockedSource.ptr(new nosync.Mutex.ptr(false), NewSource(new $Int64(0, 1)))); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["math/big"] = (function() { - var $pkg = {}, $init, bytes, binary, errors, fmt, nosync, io, math, rand, strconv, strings, Word, Int, byteReader, nat, divisor, arrayType, structType, sliceType, sliceType$1, sliceType$2, ptrType$1, ptrType$3, arrayType$1, ptrType$4, sliceType$3, ptrType$6, intOne, natOne, natTwo, karatsubaThreshold, deBruijn32Lookup, deBruijn64Lookup, leafSize, cacheBase10, mulWW, divWW, addVV, subVV, addVW, subVW, shlVU, shrVU, mulAddVWW, addMulVVW, divWVW, bitLen, addWW_g, subWW_g, mulWW_g, mulAddWWW_g, bitLen_g, nlz, divWW_g, addVV_g, subVV_g, addVW_g, subVW_g, shlVU_g, shrVU_g, mulAddVWW_g, addMulVVW_g, divWVW_g, low64, Jacobi, writeMultiple, scanSign, basicMul, karatsubaAdd, karatsubaSub, karatsuba, alias, addAt, max, karatsubaLen, trailingZeroBits, greaterThan, maxPow, pow, divisors; - bytes = $packages["bytes"]; - binary = $packages["encoding/binary"]; - errors = $packages["errors"]; - fmt = $packages["fmt"]; - nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; - io = $packages["io"]; - math = $packages["math"]; - rand = $packages["math/rand"]; - strconv = $packages["strconv"]; - strings = $packages["strings"]; - Word = $pkg.Word = $newType(4, $kindUintptr, "big.Word", "Word", "math/big", null); - Int = $pkg.Int = $newType(0, $kindStruct, "big.Int", "Int", "math/big", function(neg_, abs_) { - this.$val = this; - if (arguments.length === 0) { - this.neg = false; - this.abs = nat.nil; - return; - } - this.neg = neg_; - this.abs = abs_; - }); - byteReader = $pkg.byteReader = $newType(0, $kindStruct, "big.byteReader", "byteReader", "math/big", function(ScanState_) { - this.$val = this; - if (arguments.length === 0) { - this.ScanState = $ifaceNil; - return; - } - this.ScanState = ScanState_; - }); - nat = $pkg.nat = $newType(12, $kindSlice, "big.nat", "nat", "math/big", null); - divisor = $pkg.divisor = $newType(0, $kindStruct, "big.divisor", "divisor", "math/big", function(bbb_, nbits_, ndigits_) { - this.$val = this; - if (arguments.length === 0) { - this.bbb = nat.nil; - this.nbits = 0; - this.ndigits = 0; - return; - } - this.bbb = bbb_; - this.nbits = nbits_; - this.ndigits = ndigits_; - }); - arrayType = $arrayType(divisor, 64); - structType = $structType([{prop: "Mutex", name: "", pkg: "", typ: nosync.Mutex, tag: ""}, {prop: "table", name: "table", pkg: "math/big", typ: arrayType, tag: ""}]); - sliceType = $sliceType($Uint8); - sliceType$1 = $sliceType($emptyInterface); - sliceType$2 = $sliceType(Word); - ptrType$1 = $ptrType(Int); - ptrType$3 = $ptrType(Word); - arrayType$1 = $arrayType(nat, 16); - ptrType$4 = $ptrType(nat); - sliceType$3 = $sliceType(divisor); - ptrType$6 = $ptrType(rand.Rand); - mulWW = function(x, y) { - var $ptr, _tuple, x, y, z0, z1; - z1 = 0; - z0 = 0; - _tuple = mulWW_g(x, y); - z1 = _tuple[0]; - z0 = _tuple[1]; - return [z1, z0]; - }; - divWW = function(x1, x0, y) { - var $ptr, _tuple, q, r, x0, x1, y; - q = 0; - r = 0; - _tuple = divWW_g(x1, x0, y); - q = _tuple[0]; - r = _tuple[1]; - return [q, r]; - }; - addVV = function(z, x, y) { - var $ptr, c, x, y, z; - c = 0; - c = addVV_g(z, x, y); - return c; - }; - subVV = function(z, x, y) { - var $ptr, c, x, y, z; - c = 0; - c = subVV_g(z, x, y); - return c; - }; - addVW = function(z, x, y) { - var $ptr, c, x, y, z; - c = 0; - c = addVW_g(z, x, y); - return c; - }; - subVW = function(z, x, y) { - var $ptr, c, x, y, z; - c = 0; - c = subVW_g(z, x, y); - return c; - }; - shlVU = function(z, x, s) { - var $ptr, c, s, x, z; - c = 0; - c = shlVU_g(z, x, s); - return c; - }; - shrVU = function(z, x, s) { - var $ptr, c, s, x, z; - c = 0; - c = shrVU_g(z, x, s); - return c; - }; - mulAddVWW = function(z, x, y, r) { - var $ptr, c, r, x, y, z; - c = 0; - c = mulAddVWW_g(z, x, y, r); - return c; - }; - addMulVVW = function(z, x, y) { - var $ptr, c, x, y, z; - c = 0; - c = addMulVVW_g(z, x, y); - return c; - }; - divWVW = function(z, xn, x, y) { - var $ptr, r, x, xn, y, z; - r = 0; - r = divWVW_g(z, xn, x, y); - return r; - }; - bitLen = function(x) { - var $ptr, n, x; - n = 0; - n = bitLen_g(x); - return n; - }; - addWW_g = function(x, y, c) { - var $ptr, c, x, y, yc, z0, z1; - z1 = 0; - z0 = 0; - yc = y + c >>> 0; - z0 = x + yc >>> 0; - if (z0 < x || yc < y) { - z1 = 1; - } - return [z1, z0]; - }; - subWW_g = function(x, y, c) { - var $ptr, c, x, y, yc, z0, z1; - z1 = 0; - z0 = 0; - yc = y + c >>> 0; - z0 = x - yc >>> 0; - if (z0 > x || yc < y) { - z1 = 1; - } - return [z1, z0]; - }; - mulWW_g = function(x, y) { - var $ptr, t, w0, w1, w2, x, x0, x1, y, y0, y1, z0, z1; - z1 = 0; - z0 = 0; - x0 = (x & 65535) >>> 0; - x1 = x >>> 16 >>> 0; - y0 = (y & 65535) >>> 0; - y1 = y >>> 16 >>> 0; - w0 = $imul(x0, y0) >>> 0; - t = ($imul(x1, y0) >>> 0) + (w0 >>> 16 >>> 0) >>> 0; - w1 = (t & 65535) >>> 0; - w2 = t >>> 16 >>> 0; - w1 = w1 + (($imul(x0, y1) >>> 0)) >>> 0; - z1 = (($imul(x1, y1) >>> 0) + w2 >>> 0) + (w1 >>> 16 >>> 0) >>> 0; - z0 = $imul(x, y) >>> 0; - return [z1, z0]; - }; - mulAddWWW_g = function(x, y, c) { - var $ptr, _tuple, c, x, y, z0, z1, zz0; - z1 = 0; - z0 = 0; - _tuple = mulWW_g(x, y); - z1 = _tuple[0]; - zz0 = _tuple[1]; - z0 = zz0 + c >>> 0; - if (z0 < zz0) { - z1 = z1 + (1) >>> 0; - } - return [z1, z0]; - }; - bitLen_g = function(x) { - var $ptr, n, x, y, y$1, y$2, y$3; - n = 0; - while (true) { - if (!(x >= 32768)) { break; } - n = n + (16) >> 0; - x = (y = (16), y < 32 ? (x >>> y) : 0) >>> 0; - } - if (x >= 128) { - x = (y$1 = (8), y$1 < 32 ? (x >>> y$1) : 0) >>> 0; - n = n + (8) >> 0; - } - if (x >= 8) { - x = (y$2 = (4), y$2 < 32 ? (x >>> y$2) : 0) >>> 0; - n = n + (4) >> 0; - } - if (x >= 2) { - x = (y$3 = (2), y$3 < 32 ? (x >>> y$3) : 0) >>> 0; - n = n + (2) >> 0; - } - if (x >= 1) { - n = n + (1) >> 0; - } - return n; - }; - nlz = function(x) { - var $ptr, x; - return ((32 - bitLen(x) >> 0) >>> 0); - }; - divWW_g = function(u1, u0, v) { - var $ptr, _q, _q$1, _tmp, _tmp$1, _tmp$2, _tmp$3, q, q0, q1, r, rhat, s, u0, u1, un0, un1, un10, un21, un32, v, vn0, vn1, y, y$1, y$2, y$3, y$4; - q = 0; - r = 0; - if (u1 >= v) { - _tmp = 4294967295; - _tmp$1 = 4294967295; - q = _tmp; - r = _tmp$1; - return [q, r]; - } - s = nlz(v); - v = (y = (s), y < 32 ? (v << y) : 0) >>> 0; - vn1 = v >>> 16 >>> 0; - vn0 = (v & 65535) >>> 0; - un32 = (((y$1 = s, y$1 < 32 ? (u1 << y$1) : 0) >>> 0) | ((y$2 = ((32 - s >>> 0)), y$2 < 32 ? (u0 >>> y$2) : 0) >>> 0)) >>> 0; - un10 = (y$3 = s, y$3 < 32 ? (u0 << y$3) : 0) >>> 0; - un1 = un10 >>> 16 >>> 0; - un0 = (un10 & 65535) >>> 0; - q1 = (_q = un32 / vn1, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - rhat = un32 - ($imul(q1, vn1) >>> 0) >>> 0; - while (true) { - if (!(q1 >= 65536 || ($imul(q1, vn0) >>> 0) > (($imul(65536, rhat) >>> 0) + un1 >>> 0))) { break; } - q1 = q1 - (1) >>> 0; - rhat = rhat + (vn1) >>> 0; - if (rhat >= 65536) { - break; - } - } - un21 = (($imul(un32, 65536) >>> 0) + un1 >>> 0) - ($imul(q1, v) >>> 0) >>> 0; - q0 = (_q$1 = un21 / vn1, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); - rhat = un21 - ($imul(q0, vn1) >>> 0) >>> 0; - while (true) { - if (!(q0 >= 65536 || ($imul(q0, vn0) >>> 0) > (($imul(65536, rhat) >>> 0) + un0 >>> 0))) { break; } - q0 = q0 - (1) >>> 0; - rhat = rhat + (vn1) >>> 0; - if (rhat >= 65536) { - break; - } - } - _tmp$2 = ($imul(q1, 65536) >>> 0) + q0 >>> 0; - _tmp$3 = (y$4 = s, y$4 < 32 ? ((((($imul(un21, 65536) >>> 0) + un0 >>> 0) - ($imul(q0, v) >>> 0) >>> 0)) >>> y$4) : 0) >>> 0; - q = _tmp$2; - r = _tmp$3; - return [q, r]; - }; - addVV_g = function(z, x, y) { - var $ptr, _i, _i$1, _ref, _ref$1, _tuple, c, i, i$1, x, xi, y, yi, z, zi; - c = 0; - if (false) { - _ref = z; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - _tuple = addWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i]), c); - c = _tuple[0]; - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[1]); - _i++; - } - return c; - } - _ref$1 = $subslice(x, 0, z.$length); - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - i$1 = _i$1; - xi = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); - yi = ((i$1 < 0 || i$1 >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i$1]); - zi = (xi + yi >>> 0) + c >>> 0; - ((i$1 < 0 || i$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i$1] = zi); - c = (((((xi & yi) >>> 0) | (((((xi | yi) >>> 0)) & ~zi) >>> 0)) >>> 0)) >>> 31 >>> 0; - _i$1++; - } - return c; - }; - subVV_g = function(z, x, y) { - var $ptr, _i, _i$1, _ref, _ref$1, _tuple, c, i, i$1, x, xi, y, yi, z, zi; - c = 0; - if (false) { - _ref = z; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - _tuple = subWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i]), c); - c = _tuple[0]; - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[1]); - _i++; - } - return c; - } - _ref$1 = $subslice(x, 0, z.$length); - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - i$1 = _i$1; - xi = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); - yi = ((i$1 < 0 || i$1 >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i$1]); - zi = (xi - yi >>> 0) - c >>> 0; - ((i$1 < 0 || i$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i$1] = zi); - c = (((((yi & ~xi) >>> 0) | (((((yi | (~xi >>> 0)) >>> 0)) & zi) >>> 0)) >>> 0)) >>> 31 >>> 0; - _i$1++; - } - return c; - }; - addVW_g = function(z, x, y) { - var $ptr, _i, _i$1, _ref, _ref$1, _tuple, c, i, i$1, x, xi, y, z, zi; - c = 0; - if (false) { - c = y; - _ref = z; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - _tuple = addWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), c, 0); - c = _tuple[0]; - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[1]); - _i++; - } - return c; - } - c = y; - _ref$1 = $subslice(x, 0, z.$length); - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - i$1 = _i$1; - xi = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); - zi = xi + c >>> 0; - ((i$1 < 0 || i$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i$1] = zi); - c = ((xi & ~zi) >>> 0) >>> 31 >>> 0; - _i$1++; - } - return c; - }; - subVW_g = function(z, x, y) { - var $ptr, _i, _i$1, _ref, _ref$1, _tuple, c, i, i$1, x, xi, y, z, zi; - c = 0; - if (false) { - c = y; - _ref = z; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - _tuple = subWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), c, 0); - c = _tuple[0]; - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[1]); - _i++; - } - return c; - } - c = y; - _ref$1 = $subslice(x, 0, z.$length); - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - i$1 = _i$1; - xi = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); - zi = xi - c >>> 0; - ((i$1 < 0 || i$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i$1] = zi); - c = (((zi & ~xi) >>> 0)) >>> 31 >>> 0; - _i$1++; - } - return c; - }; - shlVU_g = function(z, x, s) { - var $C5$9D, $ptr, c, i, n, s, w, w1, x, x$1, x$2, y, y$1, y$2, y$3, z; - c = 0; - n = z.$length; - if (n > 0) { - $C5$9D = 32 - s >>> 0; - w1 = (x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); - c = (y = $C5$9D, y < 32 ? (w1 >>> y) : 0) >>> 0; - i = n - 1 >> 0; - while (true) { - if (!(i > 0)) { break; } - w = w1; - w1 = (x$2 = i - 1 >> 0, ((x$2 < 0 || x$2 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$2])); - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((y$1 = s, y$1 < 32 ? (w << y$1) : 0) >>> 0) | ((y$2 = $C5$9D, y$2 < 32 ? (w1 >>> y$2) : 0) >>> 0)) >>> 0)); - i = i - (1) >> 0; - } - (0 >= z.$length ? $throwRuntimeError("index out of range") : z.$array[z.$offset + 0] = ((y$3 = s, y$3 < 32 ? (w1 << y$3) : 0) >>> 0)); - } - return c; - }; - shrVU_g = function(z, x, s) { - var $C5$9D, $ptr, c, i, n, s, w, w1, x, x$1, x$2, y, y$1, y$2, y$3, z; - c = 0; - n = z.$length; - if (n > 0) { - $C5$9D = 32 - s >>> 0; - w1 = (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0]); - c = (y = $C5$9D, y < 32 ? (w1 << y) : 0) >>> 0; - i = 0; - while (true) { - if (!(i < (n - 1 >> 0))) { break; } - w = w1; - w1 = (x$1 = i + 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((y$1 = s, y$1 < 32 ? (w >>> y$1) : 0) >>> 0) | ((y$2 = $C5$9D, y$2 < 32 ? (w1 << y$2) : 0) >>> 0)) >>> 0)); - i = i + (1) >> 0; - } - (x$2 = n - 1 >> 0, ((x$2 < 0 || x$2 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + x$2] = ((y$3 = s, y$3 < 32 ? (w1 >>> y$3) : 0) >>> 0))); - } - return c; - }; - mulAddVWW_g = function(z, x, y, r) { - var $ptr, _i, _ref, _tuple, c, i, r, x, y, z; - c = 0; - c = r; - _ref = z; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - _tuple = mulAddWWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), y, c); - c = _tuple[0]; - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[1]); - _i++; - } - return c; - }; - addMulVVW_g = function(z, x, y) { - var $ptr, _i, _ref, _tuple, _tuple$1, c, i, x, y, z, z0, z1; - c = 0; - _ref = z; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - _tuple = mulAddWWW_g(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), y, ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i])); - z1 = _tuple[0]; - z0 = _tuple[1]; - _tuple$1 = addWW_g(z0, c, 0); - c = _tuple$1[0]; - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple$1[1]); - c = c + (z1) >>> 0; - _i++; - } - return c; - }; - divWVW_g = function(z, xn, x, y) { - var $ptr, _tuple, i, r, x, xn, y, z; - r = 0; - r = xn; - i = z.$length - 1 >> 0; - while (true) { - if (!(i >= 0)) { break; } - _tuple = divWW_g(r, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), y); - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = _tuple[0]); - r = _tuple[1]; - i = i - (1) >> 0; - } - return r; - }; - Int.ptr.prototype.Sign = function() { - var $ptr, x; - x = this; - if (x.abs.$length === 0) { - return 0; - } - if (x.neg) { - return -1; - } - return 1; - }; - Int.prototype.Sign = function() { return this.$val.Sign(); }; - Int.ptr.prototype.SetInt64 = function(x) { - var $ptr, neg, x, z; - z = this; - neg = false; - if ((x.$high < 0 || (x.$high === 0 && x.$low < 0))) { - neg = true; - x = new $Int64(-x.$high, -x.$low); - } - z.abs = z.abs.setUint64(new $Uint64(x.$high, x.$low)); - z.neg = neg; - return z; - }; - Int.prototype.SetInt64 = function(x) { return this.$val.SetInt64(x); }; - Int.ptr.prototype.SetUint64 = function(x) { - var $ptr, x, z; - z = this; - z.abs = z.abs.setUint64(x); - z.neg = false; - return z; - }; - Int.prototype.SetUint64 = function(x) { return this.$val.SetUint64(x); }; - Int.ptr.prototype.Set = function(x) { - var $ptr, x, z; - z = this; - if (!(z === x)) { - z.abs = z.abs.set(x.abs); - z.neg = x.neg; - } - return z; - }; - Int.prototype.Set = function(x) { return this.$val.Set(x); }; - Int.ptr.prototype.Bits = function() { - var $ptr, x, x$1; - x = this; - return (x$1 = x.abs, $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)); - }; - Int.prototype.Bits = function() { return this.$val.Bits(); }; - Int.ptr.prototype.SetBits = function(abs) { - var $ptr, abs, z; - z = this; - z.abs = $subslice(new nat(abs.$array), abs.$offset, abs.$offset + abs.$length).norm(); - z.neg = false; - return z; - }; - Int.prototype.SetBits = function(abs) { return this.$val.SetBits(abs); }; - Int.ptr.prototype.Abs = function(x) { - var $ptr, x, z; - z = this; - z.Set(x); - z.neg = false; - return z; - }; - Int.prototype.Abs = function(x) { return this.$val.Abs(x); }; - Int.ptr.prototype.Neg = function(x) { - var $ptr, x, z; - z = this; - z.Set(x); - z.neg = z.abs.$length > 0 && !z.neg; - return z; - }; - Int.prototype.Neg = function(x) { return this.$val.Neg(x); }; - Int.ptr.prototype.Add = function(x, y) { - var $ptr, neg, x, y, z; - z = this; - neg = x.neg; - if (x.neg === y.neg) { - z.abs = z.abs.add(x.abs, y.abs); - } else { - if (x.abs.cmp(y.abs) >= 0) { - z.abs = z.abs.sub(x.abs, y.abs); - } else { - neg = !neg; - z.abs = z.abs.sub(y.abs, x.abs); - } - } - z.neg = z.abs.$length > 0 && neg; - return z; - }; - Int.prototype.Add = function(x, y) { return this.$val.Add(x, y); }; - Int.ptr.prototype.Sub = function(x, y) { - var $ptr, neg, x, y, z; - z = this; - neg = x.neg; - if (!(x.neg === y.neg)) { - z.abs = z.abs.add(x.abs, y.abs); - } else { - if (x.abs.cmp(y.abs) >= 0) { - z.abs = z.abs.sub(x.abs, y.abs); - } else { - neg = !neg; - z.abs = z.abs.sub(y.abs, x.abs); - } - } - z.neg = z.abs.$length > 0 && neg; - return z; - }; - Int.prototype.Sub = function(x, y) { return this.$val.Sub(x, y); }; - Int.ptr.prototype.Mul = function(x, y) { - var $ptr, x, y, z; - z = this; - z.abs = z.abs.mul(x.abs, y.abs); - z.neg = z.abs.$length > 0 && !(x.neg === y.neg); - return z; - }; - Int.prototype.Mul = function(x, y) { return this.$val.Mul(x, y); }; - Int.ptr.prototype.MulRange = function(a, b) { - var $ptr, _tmp, _tmp$1, a, b, neg, x, x$1, z; - z = this; - if ((a.$high > b.$high || (a.$high === b.$high && a.$low > b.$low))) { - return z.SetInt64(new $Int64(0, 1)); - } else if ((a.$high < 0 || (a.$high === 0 && a.$low <= 0)) && (b.$high > 0 || (b.$high === 0 && b.$low >= 0))) { - return z.SetInt64(new $Int64(0, 0)); - } - neg = false; - if ((a.$high < 0 || (a.$high === 0 && a.$low < 0))) { - neg = (x = (x$1 = new $Int64(b.$high - a.$high, b.$low - a.$low), new $Int64(x$1.$high & 0, (x$1.$low & 1) >>> 0)), (x.$high === 0 && x.$low === 0)); - _tmp = new $Int64(-b.$high, -b.$low); - _tmp$1 = new $Int64(-a.$high, -a.$low); - a = _tmp; - b = _tmp$1; - } - z.abs = z.abs.mulRange(new $Uint64(a.$high, a.$low), new $Uint64(b.$high, b.$low)); - z.neg = neg; - return z; - }; - Int.prototype.MulRange = function(a, b) { return this.$val.MulRange(a, b); }; - Int.ptr.prototype.Binomial = function(n, k) { - var $ptr, _tmp, _tmp$1, a, b, k, n, x, x$1, z; - z = this; - if ((x = $div64(n, new $Int64(0, 2), false), (x.$high < k.$high || (x.$high === k.$high && x.$low < k.$low))) && (k.$high < n.$high || (k.$high === n.$high && k.$low <= n.$low))) { - k = new $Int64(n.$high - k.$high, n.$low - k.$low); - } - _tmp = new Int.ptr(false, nat.nil); - _tmp$1 = new Int.ptr(false, nat.nil); - a = $clone(_tmp, Int); - b = $clone(_tmp$1, Int); - a.MulRange((x$1 = new $Int64(n.$high - k.$high, n.$low - k.$low), new $Int64(x$1.$high + 0, x$1.$low + 1)), n); - b.MulRange(new $Int64(0, 1), k); - return z.Quo(a, b); - }; - Int.prototype.Binomial = function(n, k) { return this.$val.Binomial(n, k); }; - Int.ptr.prototype.Quo = function(x, y) { - var $ptr, _tuple, x, y, z; - z = this; - _tuple = z.abs.div(nat.nil, x.abs, y.abs); - z.abs = _tuple[0]; - z.neg = z.abs.$length > 0 && !(x.neg === y.neg); - return z; - }; - Int.prototype.Quo = function(x, y) { return this.$val.Quo(x, y); }; - Int.ptr.prototype.Rem = function(x, y) { - var $ptr, _tuple, x, y, z; - z = this; - _tuple = nat.nil.div(z.abs, x.abs, y.abs); - z.abs = _tuple[1]; - z.neg = z.abs.$length > 0 && x.neg; - return z; - }; - Int.prototype.Rem = function(x, y) { return this.$val.Rem(x, y); }; - Int.ptr.prototype.QuoRem = function(x, y, r) { - var $ptr, _tmp, _tmp$1, _tuple, r, x, y, z; - z = this; - _tuple = z.abs.div(r.abs, x.abs, y.abs); - z.abs = _tuple[0]; - r.abs = _tuple[1]; - _tmp = z.abs.$length > 0 && !(x.neg === y.neg); - _tmp$1 = r.abs.$length > 0 && x.neg; - z.neg = _tmp; - r.neg = _tmp$1; - return [z, r]; - }; - Int.prototype.QuoRem = function(x, y, r) { return this.$val.QuoRem(x, y, r); }; - Int.ptr.prototype.Div = function(x, y) { - var $ptr, r, x, y, y_neg, z; - z = this; - y_neg = y.neg; - r = new Int.ptr(false, nat.nil); - z.QuoRem(x, y, r); - if (r.neg) { - if (y_neg) { - z.Add(z, intOne); - } else { - z.Sub(z, intOne); - } - } - return z; - }; - Int.prototype.Div = function(x, y) { return this.$val.Div(x, y); }; - Int.ptr.prototype.Mod = function(x, y) { - var $ptr, q, x, y, y0, z; - z = this; - y0 = y; - if (z === y || alias(z.abs, y.abs)) { - y0 = new Int.ptr(false, nat.nil).Set(y); - } - q = new Int.ptr(false, nat.nil); - q.QuoRem(x, y, z); - if (z.neg) { - if (y0.neg) { - z.Sub(z, y0); - } else { - z.Add(z, y0); - } - } - return z; - }; - Int.prototype.Mod = function(x, y) { return this.$val.Mod(x, y); }; - Int.ptr.prototype.DivMod = function(x, y, m) { - var $ptr, m, x, y, y0, z; - z = this; - y0 = y; - if (z === y || alias(z.abs, y.abs)) { - y0 = new Int.ptr(false, nat.nil).Set(y); - } - z.QuoRem(x, y, m); - if (m.neg) { - if (y0.neg) { - z.Add(z, intOne); - m.Sub(m, y0); - } else { - z.Sub(z, intOne); - m.Add(m, y0); - } - } - return [z, m]; - }; - Int.prototype.DivMod = function(x, y, m) { return this.$val.DivMod(x, y, m); }; - Int.ptr.prototype.Cmp = function(y) { - var $ptr, r, x, y; - r = 0; - x = this; - if (x.neg === y.neg) { - r = x.abs.cmp(y.abs); - if (x.neg) { - r = -r; - } - } else if (x.neg) { - r = -1; - } else { - r = 1; - } - return r; - }; - Int.prototype.Cmp = function(y) { return this.$val.Cmp(y); }; - low64 = function(z) { - var $ptr, v, x, x$1, x$2, z; - if (z.$length === 0) { - return new $Uint64(0, 0); - } - v = (x = (0 >= z.$length ? $throwRuntimeError("index out of range") : z.$array[z.$offset + 0]), new $Uint64(0, x.constructor === Number ? x : 1)); - if (true && z.$length > 1) { - v = (x$1 = $shiftLeft64((x$2 = (1 >= z.$length ? $throwRuntimeError("index out of range") : z.$array[z.$offset + 1]), new $Uint64(0, x$2.constructor === Number ? x$2 : 1)), 32), new $Uint64(v.$high | x$1.$high, (v.$low | x$1.$low) >>> 0)); - } - return v; - }; - Int.ptr.prototype.Int64 = function() { - var $ptr, v, x, x$1; - x = this; - v = (x$1 = low64(x.abs), new $Int64(x$1.$high, x$1.$low)); - if (x.neg) { - v = new $Int64(-v.$high, -v.$low); - } - return v; - }; - Int.prototype.Int64 = function() { return this.$val.Int64(); }; - Int.ptr.prototype.Uint64 = function() { - var $ptr, x; - x = this; - return low64(x.abs); - }; - Int.prototype.Uint64 = function() { return this.$val.Uint64(); }; - Int.ptr.prototype.SetString = function(s, base) { - var $ptr, _r, _tuple, _tuple$1, base, err, r, s, z, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; base = $f.base; err = $f.err; r = $f.r; s = $f.s; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - z = this; - r = strings.NewReader(s); - _r = z.scan(r, base); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - err = _tuple[2]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [ptrType$1.nil, false]; - } - _tuple$1 = r.ReadByte(); - err = _tuple$1[1]; - if (!($interfaceIsEqual(err, io.EOF))) { - return [ptrType$1.nil, false]; - } - return [z, true]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.SetString }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.base = base; $f.err = err; $f.r = r; $f.s = s; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.prototype.SetString = function(s, base) { return this.$val.SetString(s, base); }; - Int.ptr.prototype.SetBytes = function(buf) { - var $ptr, buf, z; - z = this; - z.abs = z.abs.setBytes(buf); - z.neg = false; - return z; - }; - Int.prototype.SetBytes = function(buf) { return this.$val.SetBytes(buf); }; - Int.ptr.prototype.Bytes = function() { - var $ptr, buf, x; - x = this; - buf = $makeSlice(sliceType, ($imul(x.abs.$length, 4))); - return $subslice(buf, x.abs.bytes(buf)); - }; - Int.prototype.Bytes = function() { return this.$val.Bytes(); }; - Int.ptr.prototype.BitLen = function() { - var $ptr, x; - x = this; - return x.abs.bitLen(); - }; - Int.prototype.BitLen = function() { return this.$val.BitLen(); }; - Int.ptr.prototype.Exp = function(x, y, m) { - var $ptr, m, mWords, x, y, yWords, z; - z = this; - yWords = nat.nil; - if (!y.neg) { - yWords = y.abs; - } - mWords = nat.nil; - if (!(m === ptrType$1.nil)) { - mWords = m.abs; - } - z.abs = z.abs.expNN(x.abs, yWords, mWords); - z.neg = z.abs.$length > 0 && x.neg && yWords.$length > 0 && ((((0 >= yWords.$length ? $throwRuntimeError("index out of range") : yWords.$array[yWords.$offset + 0]) & 1) >>> 0) === 1); - if (z.neg && mWords.$length > 0) { - z.abs = z.abs.sub(mWords, z.abs); - z.neg = false; - } - return z; - }; - Int.prototype.Exp = function(x, y, m) { return this.$val.Exp(x, y, m); }; - Int.ptr.prototype.GCD = function(x, y, a, b) { - var $ptr, A, B, X, Y, _tmp, _tmp$1, _tuple, a, b, lastX, lastY, q, r, temp, x, y, z; - z = this; - if (a.Sign() <= 0 || b.Sign() <= 0) { - z.SetInt64(new $Int64(0, 0)); - if (!(x === ptrType$1.nil)) { - x.SetInt64(new $Int64(0, 0)); - } - if (!(y === ptrType$1.nil)) { - y.SetInt64(new $Int64(0, 0)); - } - return z; - } - if (x === ptrType$1.nil && y === ptrType$1.nil) { - return z.binaryGCD(a, b); - } - A = new Int.ptr(false, nat.nil).Set(a); - B = new Int.ptr(false, nat.nil).Set(b); - X = new Int.ptr(false, nat.nil); - Y = new Int.ptr(false, nat.nil).SetInt64(new $Int64(0, 1)); - lastX = new Int.ptr(false, nat.nil).SetInt64(new $Int64(0, 1)); - lastY = new Int.ptr(false, nat.nil); - q = new Int.ptr(false, nat.nil); - temp = new Int.ptr(false, nat.nil); - while (true) { - if (!(B.abs.$length > 0)) { break; } - r = new Int.ptr(false, nat.nil); - _tuple = q.QuoRem(A, B, r); - q = _tuple[0]; - r = _tuple[1]; - _tmp = B; - _tmp$1 = r; - A = _tmp; - B = _tmp$1; - temp.Set(X); - X.Mul(X, q); - X.neg = !X.neg; - X.Add(X, lastX); - lastX.Set(temp); - temp.Set(Y); - Y.Mul(Y, q); - Y.neg = !Y.neg; - Y.Add(Y, lastY); - lastY.Set(temp); - } - if (!(x === ptrType$1.nil)) { - Int.copy(x, lastX); - } - if (!(y === ptrType$1.nil)) { - Int.copy(y, lastY); - } - Int.copy(z, A); - return z; - }; - Int.prototype.GCD = function(x, y, a, b) { return this.$val.GCD(x, y, a, b); }; - Int.ptr.prototype.binaryGCD = function(a, b) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, a, b, k, t, u, v, vk, x, z; - z = this; - u = z; - v = new Int.ptr(false, nat.nil); - if (a.abs.$length > b.abs.$length) { - v.Rem(a, b); - u.Set(b); - } else if (a.abs.$length < b.abs.$length) { - v.Rem(b, a); - u.Set(a); - } else { - v.Set(b); - u.Set(a); - } - if (v.abs.$length === 0) { - return u; - } - k = u.abs.trailingZeroBits(); - vk = v.abs.trailingZeroBits(); - if (vk < k) { - k = vk; - } - u.Rsh(u, k); - v.Rsh(v, k); - t = new Int.ptr(false, nat.nil); - if (!(((((x = u.abs, (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0])) & 1) >>> 0) === 0))) { - t.Neg(v); - } else { - t.Set(u); - } - while (true) { - if (!(t.abs.$length > 0)) { break; } - t.Rsh(t, t.abs.trailingZeroBits()); - if (t.neg) { - _tmp = t; - _tmp$1 = v; - v = _tmp; - t = _tmp$1; - v.neg = v.abs.$length > 0 && !v.neg; - } else { - _tmp$2 = t; - _tmp$3 = u; - u = _tmp$2; - t = _tmp$3; - } - t.Sub(u, v); - } - return z.Lsh(u, k); - }; - Int.prototype.binaryGCD = function(a, b) { return this.$val.binaryGCD(a, b); }; - Int.ptr.prototype.ProbablyPrime = function(n) { - var $ptr, _r, _v, n, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _v = $f._v; n = $f.n; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - x = this; - if (n <= 0) { - $panic(new $String("non-positive n for ProbablyPrime")); - } - if (!(!x.neg)) { _v = false; $s = 1; continue s; } - _r = x.abs.probablyPrime(n); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _v = _r; case 1: - /* */ $s = 3; case 3: - return _v; - /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.ProbablyPrime }; } $f.$ptr = $ptr; $f._r = _r; $f._v = _v; $f.n = n; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.prototype.ProbablyPrime = function(n) { return this.$val.ProbablyPrime(n); }; - Int.ptr.prototype.Rand = function(rnd, n) { - var $ptr, _r, n, rnd, z, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; n = $f.n; rnd = $f.rnd; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - z = this; - z.neg = false; - if (n.neg || (n.abs.$length === 0)) { - z.abs = nat.nil; - return z; - } - _r = z.abs.random(rnd, n.abs, n.abs.bitLen()); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - z.abs = _r; - return z; - /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Rand }; } $f.$ptr = $ptr; $f._r = _r; $f.n = n; $f.rnd = rnd; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.prototype.Rand = function(rnd, n) { return this.$val.Rand(rnd, n); }; - Int.ptr.prototype.ModInverse = function(g, n) { - var $ptr, d, g, n, z; - z = this; - d = new Int.ptr(false, nat.nil); - d.GCD(z, ptrType$1.nil, g, n); - if (z.neg) { - z.Add(z, n); - } - return z; - }; - Int.prototype.ModInverse = function(g, n) { return this.$val.ModInverse(g, n); }; - Jacobi = function(x, y) { - var $ptr, _r, _tmp, _tmp$1, _tmp$2, a, b, bmod8, c, j, s, x, x$1, x$2, x$3, x$4, y, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; a = $f.a; b = $f.b; bmod8 = $f.bmod8; c = $f.c; j = $f.j; s = $f.s; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; x$3 = $f.x$3; x$4 = $f.x$4; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - a = [a]; - b = [b]; - c = [c]; - /* */ if ((y.abs.$length === 0) || ((((x$1 = y.abs, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])) & 1) >>> 0) === 0)) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if ((y.abs.$length === 0) || ((((x$1 = y.abs, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])) & 1) >>> 0) === 0)) { */ case 1: - _r = fmt.Sprintf("big: invalid 2nd argument to Int.Jacobi: need odd integer but got %s", new sliceType$1([y])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $panic(new $String(_r)); - /* } */ case 2: - _tmp = new Int.ptr(false, nat.nil); - _tmp$1 = new Int.ptr(false, nat.nil); - _tmp$2 = new Int.ptr(false, nat.nil); - a[0] = $clone(_tmp, Int); - b[0] = $clone(_tmp$1, Int); - c[0] = $clone(_tmp$2, Int); - a[0].Set(x); - b[0].Set(y); - j = 1; - if (b[0].neg) { - if (a[0].neg) { - j = -1; - } - b[0].neg = false; - } - while (true) { - if (b[0].Cmp(intOne) === 0) { - return j; - } - if (a[0].abs.$length === 0) { - return 0; - } - a[0].Mod(a[0], b[0]); - if (a[0].abs.$length === 0) { - return 0; - } - s = a[0].abs.trailingZeroBits(); - if (!((((s & 1) >>> 0) === 0))) { - bmod8 = ((x$2 = b[0].abs, (0 >= x$2.$length ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + 0])) & 7) >>> 0; - if ((bmod8 === 3) || (bmod8 === 5)) { - j = -j; - } - } - c[0].Rsh(a[0], s); - if (((((x$3 = b[0].abs, (0 >= x$3.$length ? $throwRuntimeError("index out of range") : x$3.$array[x$3.$offset + 0])) & 3) >>> 0) === 3) && ((((x$4 = c[0].abs, (0 >= x$4.$length ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + 0])) & 3) >>> 0) === 3)) { - j = -j; - } - a[0].Set(b[0]); - b[0].Set(c[0]); - } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Jacobi }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f.a = a; $f.b = b; $f.bmod8 = bmod8; $f.c = c; $f.j = j; $f.s = s; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.x$3 = x$3; $f.x$4 = x$4; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Jacobi = Jacobi; - Int.ptr.prototype.modSqrt3Mod4Prime = function(x, p) { - var $ptr, p, x, z; - z = this; - z.Set(p); - z.Add(z, intOne); - z.Rsh(z, 2); - z.Exp(x, z, p); - return z; - }; - Int.prototype.modSqrt3Mod4Prime = function(x, p) { return this.$val.modSqrt3Mod4Prime(x, p); }; - Int.ptr.prototype.modSqrtTonelliShanks = function(x, p) { - var $ptr, _r, _tmp, _tmp$1, _tmp$2, _tmp$3, b, e, g, m, n, p, r, s, t, x, y, z, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; b = $f.b; e = $f.e; g = $f.g; m = $f.m; n = $f.n; p = $f.p; r = $f.r; s = $f.s; t = $f.t; x = $f.x; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - b = [b]; - g = [g]; - n = [n]; - s = [s]; - t = [t]; - y = [y]; - z = this; - s[0] = new Int.ptr(false, nat.nil); - s[0].Sub(p, intOne); - e = s[0].abs.trailingZeroBits(); - s[0].Rsh(s[0], e); - n[0] = new Int.ptr(false, nat.nil); - n[0].SetInt64(new $Int64(0, 2)); - /* while (true) { */ case 1: - _r = Jacobi(n[0], p); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* if (!(!((_r === -1)))) { break; } */ if(!(!((_r === -1)))) { $s = 2; continue; } - n[0].Add(n[0], intOne); - /* } */ $s = 1; continue; case 2: - _tmp = new Int.ptr(false, nat.nil); - _tmp$1 = new Int.ptr(false, nat.nil); - _tmp$2 = new Int.ptr(false, nat.nil); - _tmp$3 = new Int.ptr(false, nat.nil); - y[0] = $clone(_tmp, Int); - b[0] = $clone(_tmp$1, Int); - g[0] = $clone(_tmp$2, Int); - t[0] = $clone(_tmp$3, Int); - y[0].Add(s[0], intOne); - y[0].Rsh(y[0], 1); - y[0].Exp(x, y[0], p); - b[0].Exp(x, s[0], p); - g[0].Exp(n[0], s[0], p); - r = e; - while (true) { - m = 0; - t[0].Set(b[0]); - while (true) { - if (!(!((t[0].Cmp(intOne) === 0)))) { break; } - t[0].Mul(t[0], t[0]).Mod(t[0], p); - m = m + (1) >>> 0; - } - if (m === 0) { - return z.Set(y[0]); - } - t[0].SetInt64(new $Int64(0, 0)).SetBit(t[0], (((r - m >>> 0) - 1 >>> 0) >> 0), 1).Exp(g[0], t[0], p); - g[0].Mul(t[0], t[0]).Mod(g[0], p); - y[0].Mul(y[0], t[0]).Mod(y[0], p); - b[0].Mul(b[0], g[0]).Mod(b[0], p); - r = m; - } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.modSqrtTonelliShanks }; } $f.$ptr = $ptr; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f.b = b; $f.e = e; $f.g = g; $f.m = m; $f.n = n; $f.p = p; $f.r = r; $f.s = s; $f.t = t; $f.x = x; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.prototype.modSqrtTonelliShanks = function(x, p) { return this.$val.modSqrtTonelliShanks(x, p); }; - Int.ptr.prototype.ModSqrt = function(x, p) { - var $ptr, _1, _r, _r$1, _r$2, p, x, x$1, z, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _1 = $f._1; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; p = $f.p; x = $f.x; x$1 = $f.x$1; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - z = this; - _r = Jacobi(x, p); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _1 = _r; - if (_1 === (-1)) { - return ptrType$1.nil; - } else if (_1 === (0)) { - return z.SetInt64(new $Int64(0, 0)); - } else if (_1 === (1)) { - /* break; */ $s = 1; continue; - } - case 1: - if (x.neg || x.Cmp(p) >= 0) { - x = new Int.ptr(false, nat.nil).Mod(x, p); - } - if (p.abs.$length > 0 && ((_r$1 = (x$1 = p.abs, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])) % 4, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 3)) { - return z.modSqrt3Mod4Prime(x, p); - } - _r$2 = z.modSqrtTonelliShanks(x, p); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return _r$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.ModSqrt }; } $f.$ptr = $ptr; $f._1 = _1; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.prototype.ModSqrt = function(x, p) { return this.$val.ModSqrt(x, p); }; - Int.ptr.prototype.Lsh = function(x, n) { - var $ptr, n, x, z; - z = this; - z.abs = z.abs.shl(x.abs, n); - z.neg = x.neg; - return z; - }; - Int.prototype.Lsh = function(x, n) { return this.$val.Lsh(x, n); }; - Int.ptr.prototype.Rsh = function(x, n) { - var $ptr, n, t, x, z; - z = this; - if (x.neg) { - t = z.abs.sub(x.abs, natOne); - t = t.shr(t, n); - z.abs = t.add(t, natOne); - z.neg = true; - return z; - } - z.abs = z.abs.shr(x.abs, n); - z.neg = false; - return z; - }; - Int.prototype.Rsh = function(x, n) { return this.$val.Rsh(x, n); }; - Int.ptr.prototype.Bit = function(i) { - var $ptr, i, t, x, x$1; - x = this; - if (i === 0) { - if (x.abs.$length > 0) { - return ((((x$1 = x.abs, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])) & 1) >>> 0) >>> 0); - } - return 0; - } - if (i < 0) { - $panic(new $String("negative bit index")); - } - if (x.neg) { - t = nat.nil.sub(x.abs, natOne); - return (t.bit((i >>> 0)) ^ 1) >>> 0; - } - return x.abs.bit((i >>> 0)); - }; - Int.prototype.Bit = function(i) { return this.$val.Bit(i); }; - Int.ptr.prototype.SetBit = function(x, i, b) { - var $ptr, b, i, t, x, z; - z = this; - if (i < 0) { - $panic(new $String("negative bit index")); - } - if (x.neg) { - t = z.abs.sub(x.abs, natOne); - t = t.setBit(t, (i >>> 0), (b ^ 1) >>> 0); - z.abs = t.add(t, natOne); - z.neg = z.abs.$length > 0; - return z; - } - z.abs = z.abs.setBit(x.abs, (i >>> 0), b); - z.neg = false; - return z; - }; - Int.prototype.SetBit = function(x, i, b) { return this.$val.SetBit(x, i, b); }; - Int.ptr.prototype.And = function(x, y) { - var $ptr, _tmp, _tmp$1, x, x1, y, y1, y1$1, z; - z = this; - if (x.neg === y.neg) { - if (x.neg) { - x1 = nat.nil.sub(x.abs, natOne); - y1 = nat.nil.sub(y.abs, natOne); - z.abs = z.abs.add(z.abs.or(x1, y1), natOne); - z.neg = true; - return z; - } - z.abs = z.abs.and(x.abs, y.abs); - z.neg = false; - return z; - } - if (x.neg) { - _tmp = y; - _tmp$1 = x; - x = _tmp; - y = _tmp$1; - } - y1$1 = nat.nil.sub(y.abs, natOne); - z.abs = z.abs.andNot(x.abs, y1$1); - z.neg = false; - return z; - }; - Int.prototype.And = function(x, y) { return this.$val.And(x, y); }; - Int.ptr.prototype.AndNot = function(x, y) { - var $ptr, x, x1, x1$1, y, y1, y1$1, z; - z = this; - if (x.neg === y.neg) { - if (x.neg) { - x1 = nat.nil.sub(x.abs, natOne); - y1 = nat.nil.sub(y.abs, natOne); - z.abs = z.abs.andNot(y1, x1); - z.neg = false; - return z; - } - z.abs = z.abs.andNot(x.abs, y.abs); - z.neg = false; - return z; - } - if (x.neg) { - x1$1 = nat.nil.sub(x.abs, natOne); - z.abs = z.abs.add(z.abs.or(x1$1, y.abs), natOne); - z.neg = true; - return z; - } - y1$1 = nat.nil.sub(y.abs, natOne); - z.abs = z.abs.and(x.abs, y1$1); - z.neg = false; - return z; - }; - Int.prototype.AndNot = function(x, y) { return this.$val.AndNot(x, y); }; - Int.ptr.prototype.Or = function(x, y) { - var $ptr, _tmp, _tmp$1, x, x1, y, y1, y1$1, z; - z = this; - if (x.neg === y.neg) { - if (x.neg) { - x1 = nat.nil.sub(x.abs, natOne); - y1 = nat.nil.sub(y.abs, natOne); - z.abs = z.abs.add(z.abs.and(x1, y1), natOne); - z.neg = true; - return z; - } - z.abs = z.abs.or(x.abs, y.abs); - z.neg = false; - return z; - } - if (x.neg) { - _tmp = y; - _tmp$1 = x; - x = _tmp; - y = _tmp$1; - } - y1$1 = nat.nil.sub(y.abs, natOne); - z.abs = z.abs.add(z.abs.andNot(y1$1, x.abs), natOne); - z.neg = true; - return z; - }; - Int.prototype.Or = function(x, y) { return this.$val.Or(x, y); }; - Int.ptr.prototype.Xor = function(x, y) { - var $ptr, _tmp, _tmp$1, x, x1, y, y1, y1$1, z; - z = this; - if (x.neg === y.neg) { - if (x.neg) { - x1 = nat.nil.sub(x.abs, natOne); - y1 = nat.nil.sub(y.abs, natOne); - z.abs = z.abs.xor(x1, y1); - z.neg = false; - return z; - } - z.abs = z.abs.xor(x.abs, y.abs); - z.neg = false; - return z; - } - if (x.neg) { - _tmp = y; - _tmp$1 = x; - x = _tmp; - y = _tmp$1; - } - y1$1 = nat.nil.sub(y.abs, natOne); - z.abs = z.abs.add(z.abs.xor(x.abs, y1$1), natOne); - z.neg = true; - return z; - }; - Int.prototype.Xor = function(x, y) { return this.$val.Xor(x, y); }; - Int.ptr.prototype.Not = function(x) { - var $ptr, x, z; - z = this; - if (x.neg) { - z.abs = z.abs.sub(x.abs, natOne); - z.neg = false; - return z; - } - z.abs = z.abs.add(x.abs, natOne); - z.neg = true; - return z; - }; - Int.prototype.Not = function(x) { return this.$val.Not(x); }; - Int.ptr.prototype.Text = function(base) { - var $ptr, base, x; - x = this; - if (x === ptrType$1.nil) { - return ""; - } - return $bytesToString(x.abs.itoa(x.neg, base)); - }; - Int.prototype.Text = function(base) { return this.$val.Text(base); }; - Int.ptr.prototype.Append = function(buf, base) { - var $ptr, base, buf, x; - x = this; - if (x === ptrType$1.nil) { - return $appendSlice(buf, ""); - } - return $appendSlice(buf, x.abs.itoa(x.neg, base)); - }; - Int.prototype.Append = function(buf, base) { return this.$val.Append(buf, base); }; - Int.ptr.prototype.String = function() { - var $ptr, x; - x = this; - return x.Text(10); - }; - Int.prototype.String = function() { return this.$val.String(); }; - writeMultiple = function(s, text, count) { - var $ptr, _r, b, count, s, text, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; b = $f.b; count = $f.count; s = $f.s; text = $f.text; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ if (text.length > 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (text.length > 0) { */ case 1: - b = new sliceType($stringToBytes(text)); - /* while (true) { */ case 3: - /* if (!(count > 0)) { break; } */ if(!(count > 0)) { $s = 4; continue; } - _r = s.Write(b); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r; - count = count - (1) >> 0; - /* } */ $s = 3; continue; case 4: - /* } */ case 2: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: writeMultiple }; } $f.$ptr = $ptr; $f._r = _r; $f.b = b; $f.count = count; $f.s = s; $f.text = text; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.ptr.prototype.Format = function(s, ch) { - var $ptr, _1, _2, _i, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tuple, _tuple$1, base, ch, d, d$1, digits, i, left, length, precision, precisionSet, prefix, right, s, sign, width, widthSet, x, zeros, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _1 = $f._1; _2 = $f._2; _i = $f._i; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; base = $f.base; ch = $f.ch; d = $f.d; d$1 = $f.d$1; digits = $f.digits; i = $f.i; left = $f.left; length = $f.length; precision = $f.precision; precisionSet = $f.precisionSet; prefix = $f.prefix; right = $f.right; s = $f.s; sign = $f.sign; width = $f.width; widthSet = $f.widthSet; x = $f.x; zeros = $f.zeros; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - x = this; - base = 0; - _1 = ch; - /* */ if (_1 === (98)) { $s = 2; continue; } - /* */ if (_1 === (111)) { $s = 3; continue; } - /* */ if ((_1 === (100)) || (_1 === (115)) || (_1 === (118))) { $s = 4; continue; } - /* */ if ((_1 === (120)) || (_1 === (88))) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (_1 === (98)) { */ case 2: - base = 2; - $s = 7; continue; - /* } else if (_1 === (111)) { */ case 3: - base = 8; - $s = 7; continue; - /* } else if ((_1 === (100)) || (_1 === (115)) || (_1 === (118))) { */ case 4: - base = 10; - $s = 7; continue; - /* } else if ((_1 === (120)) || (_1 === (88))) { */ case 5: - base = 16; - $s = 7; continue; - /* } else { */ case 6: - _r = fmt.Fprintf(s, "%%!%c(big.Int=%s)", new sliceType$1([new $Int32(ch), new $String(x.String())])); /* */ $s = 8; case 8: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r; - return; - /* } */ case 7: - case 1: - /* */ if (x === ptrType$1.nil) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (x === ptrType$1.nil) { */ case 9: - _r$1 = fmt.Fprint(s, new sliceType$1([new $String("")])); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$1; - return; - /* } */ case 10: - sign = ""; - /* */ if (x.neg) { $s = 13; continue; } - _r$2 = s.Flag(43); /* */ $s = 17; case 17: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ if (_r$2) { $s = 14; continue; } - _r$3 = s.Flag(32); /* */ $s = 18; case 18: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (_r$3) { $s = 15; continue; } - /* */ $s = 16; continue; - /* if (x.neg) { */ case 13: - sign = "-"; - $s = 16; continue; - /* } else if (_r$2) { */ case 14: - sign = "+"; - $s = 16; continue; - /* } else if (_r$3) { */ case 15: - sign = " "; - /* } */ case 16: - case 12: - prefix = ""; - _r$4 = s.Flag(35); /* */ $s = 21; case 21: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - /* */ if (_r$4) { $s = 19; continue; } - /* */ $s = 20; continue; - /* if (_r$4) { */ case 19: - _2 = ch; - if (_2 === (111)) { - prefix = "0"; - } else if (_2 === (120)) { - prefix = "0x"; - } else if (_2 === (88)) { - prefix = "0X"; - } - /* } */ case 20: - digits = x.abs.utoa(base); - if (ch === 88) { - _ref = digits; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - d = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (97 <= d && d <= 122) { - ((i < 0 || i >= digits.$length) ? $throwRuntimeError("index out of range") : digits.$array[digits.$offset + i] = (65 + ((d - 97 << 24 >>> 24)) << 24 >>> 24)); - } - _i++; - } - } - left = 0; - zeros = 0; - right = 0; - _r$5 = s.Precision(); /* */ $s = 22; case 22: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _tuple = _r$5; - precision = _tuple[0]; - precisionSet = _tuple[1]; - if (precisionSet) { - if (digits.$length < precision) { - zeros = precision - digits.$length >> 0; - } else if ((digits.$length === 1) && ((0 >= digits.$length ? $throwRuntimeError("index out of range") : digits.$array[digits.$offset + 0]) === 48) && (precision === 0)) { - return; - } - } - length = ((sign.length + prefix.length >> 0) + zeros >> 0) + digits.$length >> 0; - _r$6 = s.Width(); /* */ $s = 23; case 23: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _tuple$1 = _r$6; - width = _tuple$1[0]; - widthSet = _tuple$1[1]; - /* */ if (widthSet && length < width) { $s = 24; continue; } - /* */ $s = 25; continue; - /* if (widthSet && length < width) { */ case 24: - d$1 = width - length >> 0; - _r$7 = s.Flag(45); /* */ $s = 31; case 31: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - /* */ if (_r$7) { $s = 27; continue; } - _r$8 = s.Flag(48); /* */ $s = 32; case 32: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } - /* */ if (_r$8 && !precisionSet) { $s = 28; continue; } - /* */ $s = 29; continue; - /* if (_r$7) { */ case 27: - right = d$1; - $s = 30; continue; - /* } else if (_r$8 && !precisionSet) { */ case 28: - zeros = d$1; - $s = 30; continue; - /* } else { */ case 29: - left = d$1; - /* } */ case 30: - case 26: - /* } */ case 25: - $r = writeMultiple(s, " ", left); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = writeMultiple(s, sign, 1); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = writeMultiple(s, prefix, 1); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = writeMultiple(s, "0", zeros); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _r$9 = s.Write(digits); /* */ $s = 37; case 37: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } - _r$9; - $r = writeMultiple(s, " ", right); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Format }; } $f.$ptr = $ptr; $f._1 = _1; $f._2 = _2; $f._i = _i; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.base = base; $f.ch = ch; $f.d = d; $f.d$1 = d$1; $f.digits = digits; $f.i = i; $f.left = left; $f.length = length; $f.precision = precision; $f.precisionSet = precisionSet; $f.prefix = prefix; $f.right = right; $f.s = s; $f.sign = sign; $f.width = width; $f.widthSet = widthSet; $f.x = x; $f.zeros = zeros; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.prototype.Format = function(s, ch) { return this.$val.Format(s, ch); }; - Int.ptr.prototype.scan = function(r, base) { - var $ptr, _r, _r$1, _tuple, _tuple$1, base, err, neg, r, z, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; base = $f.base; err = $f.err; neg = $f.neg; r = $f.r; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - z = this; - _r = scanSign(r); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - neg = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [ptrType$1.nil, 0, err]; - } - _r$1 = z.abs.scan(r, base, false); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - z.abs = _tuple$1[0]; - base = _tuple$1[1]; - err = _tuple$1[3]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [ptrType$1.nil, base, err]; - } - z.neg = z.abs.$length > 0 && neg; - return [z, base, $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.scan }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.base = base; $f.err = err; $f.neg = neg; $f.r = r; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.prototype.scan = function(r, base) { return this.$val.scan(r, base); }; - scanSign = function(r) { - var $ptr, _3, _r, _r$1, _tmp, _tmp$1, _tuple, ch, err, neg, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _3 = $f._3; _r = $f._r; _r$1 = $f._r$1; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; ch = $f.ch; err = $f.err; neg = $f.neg; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - neg = false; - err = $ifaceNil; - ch = 0; - _r = r.ReadByte(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - ch = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - _tmp = false; - _tmp$1 = err; - neg = _tmp; - err = _tmp$1; - return [neg, err]; - } - _3 = ch; - /* */ if (_3 === (45)) { $s = 3; continue; } - /* */ if (_3 === (43)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_3 === (45)) { */ case 3: - neg = true; - $s = 6; continue; - /* } else if (_3 === (43)) { */ case 4: - $s = 6; continue; - /* } else { */ case 5: - _r$1 = r.UnreadByte(); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$1; - /* } */ case 6: - case 2: - return [neg, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: scanSign }; } $f.$ptr = $ptr; $f._3 = _3; $f._r = _r; $f._r$1 = _r$1; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f.ch = ch; $f.err = err; $f.neg = neg; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - byteReader.ptr.prototype.ReadByte = function() { - var $ptr, _r, _r$1, _tuple, ch, err, r, size, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; ch = $f.ch; err = $f.err; r = $f.r; size = $f.size; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = $clone(this, byteReader); - _r = r.ScanState.ReadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - ch = _tuple[0]; - size = _tuple[1]; - err = _tuple[2]; - /* */ if (!((size === 1)) && $interfaceIsEqual(err, $ifaceNil)) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (!((size === 1)) && $interfaceIsEqual(err, $ifaceNil)) { */ case 2: - _r$1 = fmt.Errorf("invalid rune %#U", new sliceType$1([new $Int32(ch)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - err = _r$1; - /* } */ case 3: - return [(ch << 24 >>> 24), err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: byteReader.ptr.prototype.ReadByte }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.ch = ch; $f.err = err; $f.r = r; $f.size = size; $f.$s = $s; $f.$r = $r; return $f; - }; - byteReader.prototype.ReadByte = function() { return this.$val.ReadByte(); }; - byteReader.ptr.prototype.UnreadByte = function() { - var $ptr, _r, r, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; r = $f.r; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - r = $clone(this, byteReader); - _r = r.ScanState.UnreadRune(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: byteReader.ptr.prototype.UnreadByte }; } $f.$ptr = $ptr; $f._r = _r; $f.r = r; $f.$s = $s; $f.$r = $r; return $f; - }; - byteReader.prototype.UnreadByte = function() { return this.$val.UnreadByte(); }; - Int.ptr.prototype.Scan = function(s, ch) { - var $ptr, _4, _r, _tuple, base, ch, err, s, x, z, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _4 = $f._4; _r = $f._r; _tuple = $f._tuple; base = $f.base; ch = $f.ch; err = $f.err; s = $f.s; x = $f.x; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - z = this; - $r = s.SkipSpace(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - base = 0; - _4 = ch; - if (_4 === (98)) { - base = 2; - } else if (_4 === (111)) { - base = 8; - } else if (_4 === (100)) { - base = 10; - } else if ((_4 === (120)) || (_4 === (88))) { - base = 16; - } else if ((_4 === (115)) || (_4 === (118))) { - } else { - return errors.New("Int.Scan: invalid verb"); - } - _r = z.scan((x = new byteReader.ptr(s), new x.constructor.elem(x)), base); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - err = _tuple[2]; - return err; - /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.Scan }; } $f.$ptr = $ptr; $f._4 = _4; $f._r = _r; $f._tuple = _tuple; $f.base = base; $f.ch = ch; $f.err = err; $f.s = s; $f.x = x; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.prototype.Scan = function(s, ch) { return this.$val.Scan(s, ch); }; - Int.ptr.prototype.GobEncode = function() { - var $ptr, b, buf, i, x; - x = this; - if (x === ptrType$1.nil) { - return [sliceType.nil, $ifaceNil]; - } - buf = $makeSlice(sliceType, (1 + ($imul(x.abs.$length, 4)) >> 0)); - i = x.abs.bytes(buf) - 1 >> 0; - b = 2; - if (x.neg) { - b = (b | (1)) >>> 0; - } - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = b); - return [$subslice(buf, i), $ifaceNil]; - }; - Int.prototype.GobEncode = function() { return this.$val.GobEncode(); }; - Int.ptr.prototype.GobDecode = function(buf) { - var $ptr, _r, b, buf, z, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; b = $f.b; buf = $f.buf; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - z = this; - if (buf.$length === 0) { - Int.copy(z, new Int.ptr(false, nat.nil)); - return $ifaceNil; - } - b = (0 >= buf.$length ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + 0]); - /* */ if (!(((b >>> 1 << 24 >>> 24) === 1))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!(((b >>> 1 << 24 >>> 24) === 1))) { */ case 1: - _r = fmt.Errorf("Int.GobDecode: encoding version %d not supported", new sliceType$1([new $Uint8((b >>> 1 << 24 >>> 24))])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return _r; - /* } */ case 2: - z.neg = !((((b & 1) >>> 0) === 0)); - z.abs = z.abs.setBytes($subslice(buf, 1)); - return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.GobDecode }; } $f.$ptr = $ptr; $f._r = _r; $f.b = b; $f.buf = buf; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.prototype.GobDecode = function(buf) { return this.$val.GobDecode(buf); }; - Int.ptr.prototype.MarshalText = function() { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, err, text, x; - text = sliceType.nil; - err = $ifaceNil; - x = this; - if (x === ptrType$1.nil) { - _tmp = new sliceType($stringToBytes("")); - _tmp$1 = $ifaceNil; - text = _tmp; - err = _tmp$1; - return [text, err]; - } - _tmp$2 = x.abs.itoa(x.neg, 10); - _tmp$3 = $ifaceNil; - text = _tmp$2; - err = _tmp$3; - return [text, err]; - }; - Int.prototype.MarshalText = function() { return this.$val.MarshalText(); }; - Int.ptr.prototype.UnmarshalText = function(text) { - var $ptr, _r, _r$1, _tuple, ok, text, z, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; ok = $f.ok; text = $f.text; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - z = this; - _r = z.SetString($bytesToString(text), 0); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - ok = _tuple[1]; - /* */ if (!ok) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (!ok) { */ case 2: - _r$1 = fmt.Errorf("math/big: cannot unmarshal %q into a *big.Int", new sliceType$1([text])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 5; case 5: - return _r$1; - /* } */ case 3: - return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.UnmarshalText }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.ok = ok; $f.text = text; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.prototype.UnmarshalText = function(text) { return this.$val.UnmarshalText(text); }; - Int.ptr.prototype.MarshalJSON = function() { - var $ptr, x; - x = this; - return x.MarshalText(); - }; - Int.prototype.MarshalJSON = function() { return this.$val.MarshalJSON(); }; - Int.ptr.prototype.UnmarshalJSON = function(text) { - var $ptr, _r, text, z, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; text = $f.text; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - z = this; - _r = z.UnmarshalText(text); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Int.ptr.prototype.UnmarshalJSON }; } $f.$ptr = $ptr; $f._r = _r; $f.text = text; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; - }; - Int.prototype.UnmarshalJSON = function(text) { return this.$val.UnmarshalJSON(text); }; - nat.prototype.clear = function() { - var $ptr, _i, _ref, i, z; - z = this; - _ref = z; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = 0); - _i++; - } - }; - $ptrType(nat).prototype.clear = function() { return this.$get().clear(); }; - nat.prototype.norm = function() { - var $ptr, i, x, z; - z = this; - i = z.$length; - while (true) { - if (!(i > 0 && ((x = i - 1 >> 0, ((x < 0 || x >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + x])) === 0))) { break; } - i = i - (1) >> 0; - } - return $subslice(z, 0, i); - }; - $ptrType(nat).prototype.norm = function() { return this.$get().norm(); }; - nat.prototype.make = function(n) { - var $ptr, n, z; - z = this; - if (n <= z.$capacity) { - return $subslice(z, 0, n); - } - return $makeSlice(nat, n, (n + 4 >> 0)); - }; - $ptrType(nat).prototype.make = function(n) { return this.$get().make(n); }; - nat.prototype.setWord = function(x) { - var $ptr, x, z; - z = this; - if (x === 0) { - return $subslice(z, 0, 0); - } - z = z.make(1); - (0 >= z.$length ? $throwRuntimeError("index out of range") : z.$array[z.$offset + 0] = x); - return z; - }; - $ptrType(nat).prototype.setWord = function(x) { return this.$get().setWord(x); }; - nat.prototype.setUint64 = function(x) { - var $ptr, _i, _ref, i, n, t, w, x, x$1, z; - z = this; - w = (x.$low >>> 0); - if ((x$1 = new $Uint64(0, w.constructor === Number ? w : 1), (x$1.$high === x.$high && x$1.$low === x.$low))) { - return z.setWord(w); - } - n = 0; - t = x; - while (true) { - if (!((t.$high > 0 || (t.$high === 0 && t.$low > 0)))) { break; } - n = n + (1) >> 0; - t = $shiftRightUint64(t, (32)); - } - z = z.make(n); - _ref = z; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = (new $Uint64(x.$high & 0, (x.$low & 4294967295) >>> 0).$low >>> 0)); - x = $shiftRightUint64(x, (32)); - _i++; - } - return z; - }; - $ptrType(nat).prototype.setUint64 = function(x) { return this.$get().setUint64(x); }; - nat.prototype.set = function(x) { - var $ptr, x, z; - z = this; - z = z.make(x.$length); - $copySlice(z, x); - return z; - }; - $ptrType(nat).prototype.set = function(x) { return this.$get().set(x); }; - nat.prototype.add = function(x, y) { - var $ptr, c, m, n, x, x$1, x$2, x$3, y, z; - z = this; - m = x.$length; - n = y.$length; - if (m < n) { - return z.add(y, x); - } else if ((m === 0)) { - return $subslice(z, 0, 0); - } else if ((n === 0)) { - return z.set(x); - } - z = z.make(m + 1 >> 0); - c = addVV((x$1 = $subslice(z, 0, n), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), $subslice(new sliceType$2(y.$array), y.$offset, y.$offset + y.$length)); - if (m > n) { - c = addVW((x$2 = $subslice(z, n, m), $subslice(new sliceType$2(x$2.$array), x$2.$offset, x$2.$offset + x$2.$length)), (x$3 = $subslice(x, n), $subslice(new sliceType$2(x$3.$array), x$3.$offset, x$3.$offset + x$3.$length)), c); - } - ((m < 0 || m >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + m] = c); - return z.norm(); - }; - $ptrType(nat).prototype.add = function(x, y) { return this.$get().add(x, y); }; - nat.prototype.sub = function(x, y) { - var $ptr, c, m, n, x, x$1, x$2, x$3, y, z; - z = this; - m = x.$length; - n = y.$length; - if (m < n) { - $panic(new $String("underflow")); - } else if ((m === 0)) { - return $subslice(z, 0, 0); - } else if ((n === 0)) { - return z.set(x); - } - z = z.make(m); - c = subVV((x$1 = $subslice(z, 0, n), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), $subslice(new sliceType$2(y.$array), y.$offset, y.$offset + y.$length)); - if (m > n) { - c = subVW((x$2 = $subslice(z, n), $subslice(new sliceType$2(x$2.$array), x$2.$offset, x$2.$offset + x$2.$length)), (x$3 = $subslice(x, n), $subslice(new sliceType$2(x$3.$array), x$3.$offset, x$3.$offset + x$3.$length)), c); - } - if (!((c === 0))) { - $panic(new $String("underflow")); - } - return z.norm(); - }; - $ptrType(nat).prototype.sub = function(x, y) { return this.$get().sub(x, y); }; - nat.prototype.cmp = function(y) { - var $ptr, i, m, n, r, x, y; - r = 0; - x = this; - m = x.$length; - n = y.$length; - if (!((m === n)) || (m === 0)) { - if (m < n) { - r = -1; - } else if (m > n) { - r = 1; - } - return r; - } - i = m - 1 >> 0; - while (true) { - if (!(i > 0 && (((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) === ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])))) { break; } - i = i - (1) >> 0; - } - if (((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) < ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) { - r = -1; - } else if (((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) > ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) { - r = 1; - } - return r; - }; - $ptrType(nat).prototype.cmp = function(y) { return this.$get().cmp(y); }; - nat.prototype.mulAddWW = function(x, y, r) { - var $ptr, m, r, x, x$1, y, z; - z = this; - m = x.$length; - if ((m === 0) || (y === 0)) { - return z.setWord(r); - } - z = z.make(m + 1 >> 0); - ((m < 0 || m >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + m] = mulAddVWW((x$1 = $subslice(z, 0, m), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), y, r)); - return z.norm(); - }; - $ptrType(nat).prototype.mulAddWW = function(x, y, r) { return this.$get().mulAddWW(x, y, r); }; - basicMul = function(z, x, y) { - var $ptr, _i, _ref, d, i, x, x$1, x$2, y, z; - $subslice(z, 0, (x.$length + y.$length >> 0)).clear(); - _ref = y; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - d = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (!((d === 0))) { - (x$2 = x.$length + i >> 0, ((x$2 < 0 || x$2 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + x$2] = addMulVVW((x$1 = $subslice(z, i, (i + x.$length >> 0)), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), d))); - } - _i++; - } - }; - nat.prototype.montgomery = function(x, y, m, k, n) { - var $ptr, c, c2, c3, cx, cy, d, i, k, m, n, t, x, x$1, y, z; - z = this; - if (!((x.$length === n)) || !((y.$length === n)) || !((m.$length === n))) { - $panic(new $String("math/big: mismatched montgomery number lengths")); - } - z = z.make(n); - z.clear(); - c = 0; - i = 0; - while (true) { - if (!(i < n)) { break; } - d = ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i]); - c2 = addMulVVW($subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), d); - t = $imul((0 >= z.$length ? $throwRuntimeError("index out of range") : z.$array[z.$offset + 0]), k) >>> 0; - c3 = addMulVVW($subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(m.$array), m.$offset, m.$offset + m.$length), t); - $copySlice(z, $subslice(z, 1)); - cx = c + c2 >>> 0; - cy = cx + c3 >>> 0; - (x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + x$1] = cy)); - if (cx < c2 || cy < c3) { - c = 1; - } else { - c = 0; - } - i = i + (1) >> 0; - } - if (!((c === 0))) { - subVV($subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(m.$array), m.$offset, m.$offset + m.$length)); - } - return z; - }; - $ptrType(nat).prototype.montgomery = function(x, y, m, k, n) { return this.$get().montgomery(x, y, m, k, n); }; - karatsubaAdd = function(z, x, n) { - var $ptr, c, n, x, x$1, x$2, x$3, z; - c = addVV((x$1 = $subslice(z, 0, n), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length)); - if (!((c === 0))) { - addVW((x$2 = $subslice(z, n, (n + (n >> 1 >> 0) >> 0)), $subslice(new sliceType$2(x$2.$array), x$2.$offset, x$2.$offset + x$2.$length)), (x$3 = $subslice(z, n), $subslice(new sliceType$2(x$3.$array), x$3.$offset, x$3.$offset + x$3.$length)), c); - } - }; - karatsubaSub = function(z, x, n) { - var $ptr, c, n, x, x$1, x$2, x$3, z; - c = subVV((x$1 = $subslice(z, 0, n), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length)); - if (!((c === 0))) { - subVW((x$2 = $subslice(z, n, (n + (n >> 1 >> 0) >> 0)), $subslice(new sliceType$2(x$2.$array), x$2.$offset, x$2.$offset + x$2.$length)), (x$3 = $subslice(z, n), $subslice(new sliceType$2(x$3.$array), x$3.$offset, x$3.$offset + x$3.$length)), c); - } - }; - karatsuba = function(z, x, y) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, n, n2, p, r, s, x, x0, x1, xd, y, y0, y1, yd, z; - n = y.$length; - if (!(((n & 1) === 0)) || n < karatsubaThreshold || n < 2) { - basicMul(z, x, y); - return; - } - n2 = n >> 1 >> 0; - _tmp = $subslice(x, n2); - _tmp$1 = $subslice(x, 0, n2); - x1 = _tmp; - x0 = _tmp$1; - _tmp$2 = $subslice(y, n2); - _tmp$3 = $subslice(y, 0, n2); - y1 = _tmp$2; - y0 = _tmp$3; - karatsuba(z, x0, y0); - karatsuba($subslice(z, n), x1, y1); - s = 1; - xd = $subslice(z, ($imul(2, n)), (($imul(2, n)) + n2 >> 0)); - if (!((subVV($subslice(new sliceType$2(xd.$array), xd.$offset, xd.$offset + xd.$length), $subslice(new sliceType$2(x1.$array), x1.$offset, x1.$offset + x1.$length), $subslice(new sliceType$2(x0.$array), x0.$offset, x0.$offset + x0.$length)) === 0))) { - s = -s; - subVV($subslice(new sliceType$2(xd.$array), xd.$offset, xd.$offset + xd.$length), $subslice(new sliceType$2(x0.$array), x0.$offset, x0.$offset + x0.$length), $subslice(new sliceType$2(x1.$array), x1.$offset, x1.$offset + x1.$length)); - } - yd = $subslice(z, (($imul(2, n)) + n2 >> 0), ($imul(3, n))); - if (!((subVV($subslice(new sliceType$2(yd.$array), yd.$offset, yd.$offset + yd.$length), $subslice(new sliceType$2(y0.$array), y0.$offset, y0.$offset + y0.$length), $subslice(new sliceType$2(y1.$array), y1.$offset, y1.$offset + y1.$length)) === 0))) { - s = -s; - subVV($subslice(new sliceType$2(yd.$array), yd.$offset, yd.$offset + yd.$length), $subslice(new sliceType$2(y1.$array), y1.$offset, y1.$offset + y1.$length), $subslice(new sliceType$2(y0.$array), y0.$offset, y0.$offset + y0.$length)); - } - p = $subslice(z, ($imul(n, 3))); - karatsuba(p, xd, yd); - r = $subslice(z, ($imul(n, 4))); - $copySlice(r, $subslice(z, 0, ($imul(n, 2)))); - karatsubaAdd($subslice(z, n2), r, n); - karatsubaAdd($subslice(z, n2), $subslice(r, n), n); - if (s > 0) { - karatsubaAdd($subslice(z, n2), p, n); - } else { - karatsubaSub($subslice(z, n2), p, n); - } - }; - alias = function(x, y) { - var $ptr, x, x$1, x$2, y; - return x.$capacity > 0 && y.$capacity > 0 && (x$1 = $subslice(x, 0, x.$capacity), $indexPtr(x$1.$array, x$1.$offset + (x.$capacity - 1 >> 0), ptrType$3)) === (x$2 = $subslice(y, 0, y.$capacity), $indexPtr(x$2.$array, x$2.$offset + (y.$capacity - 1 >> 0), ptrType$3)); - }; - addAt = function(z, x, i) { - var $ptr, c, i, j, n, x, x$1, x$2, x$3, x$4, z; - n = x.$length; - if (n > 0) { - c = addVV((x$1 = $subslice(z, i, (i + n >> 0)), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), (x$2 = $subslice(z, i), $subslice(new sliceType$2(x$2.$array), x$2.$offset, x$2.$offset + x$2.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length)); - if (!((c === 0))) { - j = i + n >> 0; - if (j < z.$length) { - addVW((x$3 = $subslice(z, j), $subslice(new sliceType$2(x$3.$array), x$3.$offset, x$3.$offset + x$3.$length)), (x$4 = $subslice(z, j), $subslice(new sliceType$2(x$4.$array), x$4.$offset, x$4.$offset + x$4.$length)), c); - } - } - } - }; - max = function(x, y) { - var $ptr, x, y; - if (x > y) { - return x; - } - return y; - }; - karatsubaLen = function(n) { - var $ptr, i, n, y; - i = 0; - while (true) { - if (!(n > karatsubaThreshold)) { break; } - n = (n >> $min((1), 31)) >> 0; - i = i + (1) >>> 0; - } - return (y = i, y < 32 ? (n << y) : 0) >> 0; - }; - nat.prototype.mul = function(x, y) { - var $ptr, i, k, m, n, t, x, x0, x0$1, xi, y, y0, y0$1, y1, z; - z = this; - m = x.$length; - n = y.$length; - if (m < n) { - return z.mul(y, x); - } else if ((m === 0) || (n === 0)) { - return $subslice(z, 0, 0); - } else if ((n === 1)) { - return z.mulAddWW(x, (0 >= y.$length ? $throwRuntimeError("index out of range") : y.$array[y.$offset + 0]), 0); - } - if (alias(z, x) || alias(z, y)) { - z = nat.nil; - } - if (n < karatsubaThreshold) { - z = z.make(m + n >> 0); - basicMul(z, x, y); - return z.norm(); - } - k = karatsubaLen(n); - x0 = $subslice(x, 0, k); - y0 = $subslice(y, 0, k); - z = z.make(max($imul(6, k), m + n >> 0)); - karatsuba(z, x0, y0); - z = $subslice(z, 0, (m + n >> 0)); - $subslice(z, ($imul(2, k))).clear(); - if (k < n || !((m === n))) { - t = nat.nil; - x0$1 = x0.norm(); - y1 = $subslice(y, k); - t = t.mul(x0$1, y1); - addAt(z, t, k); - y0$1 = y0.norm(); - i = k; - while (true) { - if (!(i < x.$length)) { break; } - xi = $subslice(x, i); - if (xi.$length > k) { - xi = $subslice(xi, 0, k); - } - xi = xi.norm(); - t = t.mul(xi, y0$1); - addAt(z, t, i); - t = t.mul(xi, y1); - addAt(z, t, i + k >> 0); - i = i + (k) >> 0; - } - } - return z.norm(); - }; - $ptrType(nat).prototype.mul = function(x, y) { return this.$get().mul(x, y); }; - nat.prototype.mulRange = function(a, b) { - var $ptr, a, b, m, x, z; - z = this; - if ((a.$high === 0 && a.$low === 0)) { - return z.setUint64(new $Uint64(0, 0)); - } else if ((a.$high > b.$high || (a.$high === b.$high && a.$low > b.$low))) { - return z.setUint64(new $Uint64(0, 1)); - } else if ((a.$high === b.$high && a.$low === b.$low)) { - return z.setUint64(a); - } else if ((x = new $Uint64(a.$high + 0, a.$low + 1), (x.$high === b.$high && x.$low === b.$low))) { - return z.mul(nat.nil.setUint64(a), nat.nil.setUint64(b)); - } - m = $div64((new $Uint64(a.$high + b.$high, a.$low + b.$low)), new $Uint64(0, 2), false); - return z.mul(nat.nil.mulRange(a, m), nat.nil.mulRange(new $Uint64(m.$high + 0, m.$low + 1), b)); - }; - $ptrType(nat).prototype.mulRange = function(a, b) { return this.$get().mulRange(a, b); }; - nat.prototype.divW = function(x, y) { - var $ptr, m, q, r, x, y, z; - q = nat.nil; - r = 0; - z = this; - m = x.$length; - if ((y === 0)) { - $panic(new $String("division by zero")); - } else if ((y === 1)) { - q = z.set(x); - return [q, r]; - } else if ((m === 0)) { - q = $subslice(z, 0, 0); - return [q, r]; - } - z = z.make(m); - r = divWVW($subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), 0, $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), y); - q = z.norm(); - return [q, r]; - }; - $ptrType(nat).prototype.divW = function(x, y) { return this.$get().divW(x, y); }; - nat.prototype.div = function(z2, u, v) { - var $ptr, _tuple, _tuple$1, q, r, r2, u, v, z, z2; - q = nat.nil; - r = nat.nil; - z = this; - if (v.$length === 0) { - $panic(new $String("division by zero")); - } - if (u.cmp(v) < 0) { - q = $subslice(z, 0, 0); - r = z2.set(u); - return [q, r]; - } - if (v.$length === 1) { - r2 = 0; - _tuple = z.divW(u, (0 >= v.$length ? $throwRuntimeError("index out of range") : v.$array[v.$offset + 0])); - q = _tuple[0]; - r2 = _tuple[1]; - r = z2.setWord(r2); - return [q, r]; - } - _tuple$1 = z.divLarge(z2, u, v); - q = _tuple$1[0]; - r = _tuple$1[1]; - return [q, r]; - }; - $ptrType(nat).prototype.div = function(z2, u, v) { return this.$get().div(z2, u, v); }; - nat.prototype.divLarge = function(u, uIn, v) { - var $ptr, _index, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, c, c$1, j, m, n, prevRhat, q, qhat, qhatv, r, rhat, shift, u, uIn, v, v1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, x1, x2, z; - q = nat.nil; - r = nat.nil; - z = this; - n = v.$length; - m = uIn.$length - n >> 0; - if (alias(z, uIn) || alias(z, v)) { - z = nat.nil; - } - q = z.make(m + 1 >> 0); - qhatv = $makeSlice(nat, (n + 1 >> 0)); - if (alias(u, uIn) || alias(u, v)) { - u = nat.nil; - } - u = u.make(uIn.$length + 1 >> 0); - u.clear(); - shift = nlz((x = n - 1 >> 0, ((x < 0 || x >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x]))); - if (shift > 0) { - v1 = $makeSlice(nat, n); - shlVU($subslice(new sliceType$2(v1.$array), v1.$offset, v1.$offset + v1.$length), $subslice(new sliceType$2(v.$array), v.$offset, v.$offset + v.$length), shift); - v = v1; - } - (x$2 = uIn.$length, ((x$2 < 0 || x$2 >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + x$2] = shlVU((x$1 = $subslice(u, 0, uIn.$length), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(uIn.$array), uIn.$offset, uIn.$offset + uIn.$length), shift))); - j = m; - while (true) { - if (!(j >= 0)) { break; } - qhat = 4294967295; - if (!(((x$3 = j + n >> 0, ((x$3 < 0 || x$3 >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + x$3])) === (x$4 = n - 1 >> 0, ((x$4 < 0 || x$4 >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x$4]))))) { - rhat = 0; - _tuple = divWW((x$5 = j + n >> 0, ((x$5 < 0 || x$5 >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + x$5])), (x$6 = (j + n >> 0) - 1 >> 0, ((x$6 < 0 || x$6 >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + x$6])), (x$7 = n - 1 >> 0, ((x$7 < 0 || x$7 >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x$7]))); - qhat = _tuple[0]; - rhat = _tuple[1]; - _tuple$1 = mulWW(qhat, (x$8 = n - 2 >> 0, ((x$8 < 0 || x$8 >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x$8]))); - x1 = _tuple$1[0]; - x2 = _tuple$1[1]; - while (true) { - if (!(greaterThan(x1, x2, rhat, (x$9 = (j + n >> 0) - 2 >> 0, ((x$9 < 0 || x$9 >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + x$9]))))) { break; } - qhat = qhat - (1) >>> 0; - prevRhat = rhat; - rhat = rhat + ((x$10 = n - 1 >> 0, ((x$10 < 0 || x$10 >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x$10]))) >>> 0; - if (rhat < prevRhat) { - break; - } - _tuple$2 = mulWW(qhat, (x$11 = n - 2 >> 0, ((x$11 < 0 || x$11 >= v.$length) ? $throwRuntimeError("index out of range") : v.$array[v.$offset + x$11]))); - x1 = _tuple$2[0]; - x2 = _tuple$2[1]; - } - } - ((n < 0 || n >= qhatv.$length) ? $throwRuntimeError("index out of range") : qhatv.$array[qhatv.$offset + n] = mulAddVWW((x$12 = $subslice(qhatv, 0, n), $subslice(new sliceType$2(x$12.$array), x$12.$offset, x$12.$offset + x$12.$length)), $subslice(new sliceType$2(v.$array), v.$offset, v.$offset + v.$length), qhat, 0)); - c = subVV((x$13 = $subslice(u, j, (j + qhatv.$length >> 0)), $subslice(new sliceType$2(x$13.$array), x$13.$offset, x$13.$offset + x$13.$length)), (x$14 = $subslice(u, j), $subslice(new sliceType$2(x$14.$array), x$14.$offset, x$14.$offset + x$14.$length)), $subslice(new sliceType$2(qhatv.$array), qhatv.$offset, qhatv.$offset + qhatv.$length)); - if (!((c === 0))) { - c$1 = addVV((x$15 = $subslice(u, j, (j + n >> 0)), $subslice(new sliceType$2(x$15.$array), x$15.$offset, x$15.$offset + x$15.$length)), (x$16 = $subslice(u, j), $subslice(new sliceType$2(x$16.$array), x$16.$offset, x$16.$offset + x$16.$length)), $subslice(new sliceType$2(v.$array), v.$offset, v.$offset + v.$length)); - _index = j + n >> 0; - ((_index < 0 || _index >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + _index] = (((_index < 0 || _index >= u.$length) ? $throwRuntimeError("index out of range") : u.$array[u.$offset + _index]) + (c$1) >>> 0)); - qhat = qhat - (1) >>> 0; - } - ((j < 0 || j >= q.$length) ? $throwRuntimeError("index out of range") : q.$array[q.$offset + j] = qhat); - j = j - (1) >> 0; - } - q = q.norm(); - shrVU($subslice(new sliceType$2(u.$array), u.$offset, u.$offset + u.$length), $subslice(new sliceType$2(u.$array), u.$offset, u.$offset + u.$length), shift); - r = u.norm(); - _tmp = q; - _tmp$1 = r; - q = _tmp; - r = _tmp$1; - return [q, r]; - }; - $ptrType(nat).prototype.divLarge = function(u, uIn, v) { return this.$get().divLarge(u, uIn, v); }; - nat.prototype.bitLen = function() { - var $ptr, i, x; - x = this; - i = x.$length - 1 >> 0; - if (i >= 0) { - return ($imul(i, 32)) + bitLen(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])) >> 0; - } - return 0; - }; - $ptrType(nat).prototype.bitLen = function() { return this.$get().bitLen(); }; - trailingZeroBits = function(x) { - var $ptr, _1, x, x$1, x$2; - _1 = 32; - if (_1 === (32)) { - return ((x$1 = (($imul((((x & (-x >>> 0)) >>> 0)), 125613361) >>> 0)) >>> 27 >>> 0, ((x$1 < 0 || x$1 >= deBruijn32Lookup.$length) ? $throwRuntimeError("index out of range") : deBruijn32Lookup.$array[deBruijn32Lookup.$offset + x$1])) >>> 0); - } else if (_1 === (64)) { - return ((x$2 = 0, ((x$2 < 0 || x$2 >= deBruijn64Lookup.$length) ? $throwRuntimeError("index out of range") : deBruijn64Lookup.$array[deBruijn64Lookup.$offset + x$2])) >>> 0); - } else { - $panic(new $String("unknown word size")); - } - }; - nat.prototype.trailingZeroBits = function() { - var $ptr, i, x; - x = this; - if (x.$length === 0) { - return 0; - } - i = 0; - while (true) { - if (!(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) === 0)) { break; } - i = i + (1) >>> 0; - } - return (i * 32 >>> 0) + trailingZeroBits(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i])) >>> 0; - }; - $ptrType(nat).prototype.trailingZeroBits = function() { return this.$get().trailingZeroBits(); }; - nat.prototype.shl = function(x, s) { - var $ptr, _q, _r, m, n, s, x, x$1, z; - z = this; - m = x.$length; - if (m === 0) { - return $subslice(z, 0, 0); - } - n = m + ((_q = s / 32, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) >> 0) >> 0; - z = z.make(n + 1 >> 0); - ((n < 0 || n >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + n] = shlVU((x$1 = $subslice(z, (n - m >> 0), n), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), (_r = s % 32, _r === _r ? _r : $throwRuntimeError("integer divide by zero")))); - $subslice(z, 0, (n - m >> 0)).clear(); - return z.norm(); - }; - $ptrType(nat).prototype.shl = function(x, s) { return this.$get().shl(x, s); }; - nat.prototype.shr = function(x, s) { - var $ptr, _q, _r, m, n, s, x, x$1, z; - z = this; - m = x.$length; - n = m - ((_q = s / 32, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) >> 0) >> 0; - if (n <= 0) { - return $subslice(z, 0, 0); - } - z = z.make(n); - shrVU($subslice(new sliceType$2(z.$array), z.$offset, z.$offset + z.$length), (x$1 = $subslice(x, (m - n >> 0)), $subslice(new sliceType$2(x$1.$array), x$1.$offset, x$1.$offset + x$1.$length)), (_r = s % 32, _r === _r ? _r : $throwRuntimeError("integer divide by zero"))); - return z.norm(); - }; - $ptrType(nat).prototype.shr = function(x, s) { return this.$get().shr(x, s); }; - nat.prototype.setBit = function(x, i, b) { - var $ptr, _2, _q, _r, b, i, j, m, n, x, y, z; - z = this; - j = ((_q = i / 32, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) >> 0); - m = (y = ((_r = i % 32, _r === _r ? _r : $throwRuntimeError("integer divide by zero"))), y < 32 ? (1 << y) : 0) >>> 0; - n = x.$length; - _2 = b; - if (_2 === (0)) { - z = z.make(n); - $copySlice(z, x); - if (j >= n) { - return z; - } - ((j < 0 || j >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + j] = ((((j < 0 || j >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + j]) & ~(m)) >>> 0)); - return z.norm(); - } else if (_2 === (1)) { - if (j >= n) { - z = z.make(j + 1 >> 0); - $subslice(z, n).clear(); - } else { - z = z.make(n); - } - $copySlice(z, x); - ((j < 0 || j >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + j] = ((((j < 0 || j >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + j]) | (m)) >>> 0)); - return z; - } - $panic(new $String("set bit is not 0 or 1")); - }; - $ptrType(nat).prototype.setBit = function(x, i, b) { return this.$get().setBit(x, i, b); }; - nat.prototype.bit = function(i) { - var $ptr, _q, _r, i, j, x, y; - x = this; - j = (_q = i / 32, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - if (j >= (x.$length >>> 0)) { - return 0; - } - return (((((y = ((_r = i % 32, _r === _r ? _r : $throwRuntimeError("integer divide by zero"))), y < 32 ? (((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]) >>> y) : 0) >>> 0) & 1) >>> 0) >>> 0); - }; - $ptrType(nat).prototype.bit = function(i) { return this.$get().bit(i); }; - nat.prototype.and = function(x, y) { - var $ptr, i, m, n, x, y, z; - z = this; - m = x.$length; - n = y.$length; - if (m > n) { - m = n; - } - z = z.make(m); - i = 0; - while (true) { - if (!(i < m)) { break; } - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) & ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) >>> 0)); - i = i + (1) >> 0; - } - return z.norm(); - }; - $ptrType(nat).prototype.and = function(x, y) { return this.$get().and(x, y); }; - nat.prototype.andNot = function(x, y) { - var $ptr, i, m, n, x, y, z; - z = this; - m = x.$length; - n = y.$length; - if (n > m) { - n = m; - } - z = z.make(m); - i = 0; - while (true) { - if (!(i < n)) { break; } - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) & ~((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) >>> 0)); - i = i + (1) >> 0; - } - $copySlice($subslice(z, n, m), $subslice(x, n, m)); - return z.norm(); - }; - $ptrType(nat).prototype.andNot = function(x, y) { return this.$get().andNot(x, y); }; - nat.prototype.or = function(x, y) { - var $ptr, _tmp, _tmp$1, i, m, n, s, x, y, z; - z = this; - m = x.$length; - n = y.$length; - s = x; - if (m < n) { - _tmp = m; - _tmp$1 = n; - n = _tmp; - m = _tmp$1; - s = y; - } - z = z.make(m); - i = 0; - while (true) { - if (!(i < n)) { break; } - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) | ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) >>> 0)); - i = i + (1) >> 0; - } - $copySlice($subslice(z, n, m), $subslice(s, n, m)); - return z.norm(); - }; - $ptrType(nat).prototype.or = function(x, y) { return this.$get().or(x, y); }; - nat.prototype.xor = function(x, y) { - var $ptr, _tmp, _tmp$1, i, m, n, s, x, y, z; - z = this; - m = x.$length; - n = y.$length; - s = x; - if (m < n) { - _tmp = m; - _tmp$1 = n; - n = _tmp; - m = _tmp$1; - s = y; - } - z = z.make(m); - i = 0; - while (true) { - if (!(i < n)) { break; } - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = ((((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]) ^ ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i])) >>> 0)); - i = i + (1) >> 0; - } - $copySlice($subslice(z, n, m), $subslice(s, n, m)); - return z.norm(); - }; - $ptrType(nat).prototype.xor = function(x, y) { return this.$get().xor(x, y); }; - greaterThan = function(x1, x2, y1, y2) { - var $ptr, x1, x2, y1, y2; - return x1 > y1 || (x1 === y1) && x2 > y2; - }; - nat.prototype.modW = function(d) { - var $ptr, d, q, r, x; - r = 0; - x = this; - q = nat.nil; - q = q.make(x.$length); - r = divWVW($subslice(new sliceType$2(q.$array), q.$offset, q.$offset + q.$length), 0, $subslice(new sliceType$2(x.$array), x.$offset, x.$offset + x.$length), d); - return r; - }; - $ptrType(nat).prototype.modW = function(d) { return this.$get().modW(d); }; - nat.prototype.random = function(rand$1, limit, n) { - var $ptr, _3, _i, _i$1, _index, _r, _r$1, _r$2, _ref, _ref$1, bitLengthOfMSW, i, i$1, limit, mask, n, rand$1, y, z, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _3 = $f._3; _i = $f._i; _i$1 = $f._i$1; _index = $f._index; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _ref = $f._ref; _ref$1 = $f._ref$1; bitLengthOfMSW = $f.bitLengthOfMSW; i = $f.i; i$1 = $f.i$1; limit = $f.limit; mask = $f.mask; n = $f.n; rand$1 = $f.rand$1; y = $f.y; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - z = this; - if (alias(z, limit)) { - z = nat.nil; - } - z = z.make(limit.$length); - bitLengthOfMSW = ((_r = n % 32, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) >>> 0); - if (bitLengthOfMSW === 0) { - bitLengthOfMSW = 32; - } - mask = ((((y = bitLengthOfMSW, y < 32 ? (1 << y) : 0) >>> 0)) - 1 >>> 0); - /* while (true) { */ case 1: - _3 = 32; - /* */ if (_3 === (32)) { $s = 4; continue; } - /* */ if (_3 === (64)) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (_3 === (32)) { */ case 4: - _ref = z; - _i = 0; - /* while (true) { */ case 8: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 9; continue; } - i = _i; - _r$1 = rand$1.Uint32(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - ((i < 0 || i >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i] = (_r$1 >>> 0)); - _i++; - /* } */ $s = 8; continue; case 9: - $s = 7; continue; - /* } else if (_3 === (64)) { */ case 5: - _ref$1 = z; - _i$1 = 0; - /* while (true) { */ case 11: - /* if (!(_i$1 < _ref$1.$length)) { break; } */ if(!(_i$1 < _ref$1.$length)) { $s = 12; continue; } - i$1 = _i$1; - _r$2 = rand$1.Uint32(); /* */ $s = 13; case 13: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - ((i$1 < 0 || i$1 >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + i$1] = (((_r$2 >>> 0) | 0) >>> 0)); - _i$1++; - /* } */ $s = 11; continue; case 12: - $s = 7; continue; - /* } else { */ case 6: - $panic(new $String("unknown word size")); - /* } */ case 7: - case 3: - _index = limit.$length - 1 >> 0; - ((_index < 0 || _index >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + _index] = ((((_index < 0 || _index >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + _index]) & (mask)) >>> 0)); - if (z.cmp(limit) < 0) { - /* break; */ $s = 2; continue; - } - /* } */ $s = 1; continue; case 2: - return z.norm(); - /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.random }; } $f.$ptr = $ptr; $f._3 = _3; $f._i = _i; $f._i$1 = _i$1; $f._index = _index; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._ref = _ref; $f._ref$1 = _ref$1; $f.bitLengthOfMSW = bitLengthOfMSW; $f.i = i; $f.i$1 = i$1; $f.limit = limit; $f.mask = mask; $f.n = n; $f.rand$1 = rand$1; $f.y = y; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; - }; - $ptrType(nat).prototype.random = function(rand$1, limit, n) { return this.$get().random(rand$1, limit, n); }; - nat.prototype.expNN = function(x, y, m) { - var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, i, j, j$1, m, q, r, shift, v, w, x, x$1, y, y$1, y$2, y$3, z, zz; - z = this; - if (alias(z, x) || alias(z, y)) { - z = nat.nil; - } - if ((m.$length === 1) && ((0 >= m.$length ? $throwRuntimeError("index out of range") : m.$array[m.$offset + 0]) === 1)) { - return z.setWord(0); - } - if (y.$length === 0) { - return z.setWord(1); - } - if ((y.$length === 1) && ((0 >= y.$length ? $throwRuntimeError("index out of range") : y.$array[y.$offset + 0]) === 1) && !((m.$length === 0))) { - _tuple = z.div(z, x, m); - z = _tuple[1]; - return z; - } - if (!((m.$length === 0))) { - z = z.make(m.$length); - } - z = z.set(x); - if (x.$length > 1 && y.$length > 1 && m.$length > 0) { - if ((((0 >= m.$length ? $throwRuntimeError("index out of range") : m.$array[m.$offset + 0]) & 1) >>> 0) === 1) { - return z.expNNMontgomery(x, y, m); - } - return z.expNNWindowed(x, y, m); - } - v = (x$1 = y.$length - 1 >> 0, ((x$1 < 0 || x$1 >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + x$1])); - shift = nlz(v) + 1 >>> 0; - v = (y$1 = (shift), y$1 < 32 ? (v << y$1) : 0) >>> 0; - q = nat.nil; - w = 32 - (shift >> 0) >> 0; - _tmp = nat.nil; - _tmp$1 = nat.nil; - zz = _tmp; - r = _tmp$1; - j = 0; - while (true) { - if (!(j < w)) { break; } - zz = zz.mul(z, z); - _tmp$2 = z; - _tmp$3 = zz; - zz = _tmp$2; - z = _tmp$3; - if (!((((v & 2147483648) >>> 0) === 0))) { - zz = zz.mul(z, x); - _tmp$4 = z; - _tmp$5 = zz; - zz = _tmp$4; - z = _tmp$5; - } - if (!((m.$length === 0))) { - _tuple$1 = zz.div(r, z, m); - zz = _tuple$1[0]; - r = _tuple$1[1]; - _tmp$6 = q; - _tmp$7 = z; - _tmp$8 = zz; - _tmp$9 = r; - zz = _tmp$6; - r = _tmp$7; - q = _tmp$8; - z = _tmp$9; - } - v = (y$2 = (1), y$2 < 32 ? (v << y$2) : 0) >>> 0; - j = j + (1) >> 0; - } - i = y.$length - 2 >> 0; - while (true) { - if (!(i >= 0)) { break; } - v = ((i < 0 || i >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i]); - j$1 = 0; - while (true) { - if (!(j$1 < 32)) { break; } - zz = zz.mul(z, z); - _tmp$10 = z; - _tmp$11 = zz; - zz = _tmp$10; - z = _tmp$11; - if (!((((v & 2147483648) >>> 0) === 0))) { - zz = zz.mul(z, x); - _tmp$12 = z; - _tmp$13 = zz; - zz = _tmp$12; - z = _tmp$13; - } - if (!((m.$length === 0))) { - _tuple$2 = zz.div(r, z, m); - zz = _tuple$2[0]; - r = _tuple$2[1]; - _tmp$14 = q; - _tmp$15 = z; - _tmp$16 = zz; - _tmp$17 = r; - zz = _tmp$14; - r = _tmp$15; - q = _tmp$16; - z = _tmp$17; - } - v = (y$3 = (1), y$3 < 32 ? (v << y$3) : 0) >>> 0; - j$1 = j$1 + (1) >> 0; - } - i = i - (1) >> 0; - } - return z.norm(); - }; - $ptrType(nat).prototype.expNN = function(x, y, m) { return this.$get().expNN(x, y, m); }; - nat.prototype.expNNWindowed = function(x, y, m) { - var $ptr, _q, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$26, _tmp$27, _tmp$28, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, _tuple$6, i, i$1, j, m, p, p1, p2, powers, r, x, x$1, y, y$1, yi, z, zz; - z = this; - _tmp = nat.nil; - _tmp$1 = nat.nil; - zz = _tmp; - r = _tmp$1; - powers = arrayType$1.zero(); - powers[0] = natOne; - powers[1] = x; - i = 2; - while (true) { - if (!(i < 16)) { break; } - _tmp$2 = $indexPtr(powers, (_q = i / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), ptrType$4); - _tmp$3 = $indexPtr(powers, i, ptrType$4); - _tmp$4 = $indexPtr(powers, (i + 1 >> 0), ptrType$4); - p2 = _tmp$2; - p = _tmp$3; - p1 = _tmp$4; - p.$set(p.mul(p2.$get(), p2.$get())); - _tuple = zz.div(r, p.$get(), m); - zz = _tuple[0]; - r = _tuple[1]; - _tmp$5 = r; - _tmp$6 = p.$get(); - p.$set(_tmp$5); - r = _tmp$6; - p1.$set(p1.mul(p.$get(), x)); - _tuple$1 = zz.div(r, p1.$get(), m); - zz = _tuple$1[0]; - r = _tuple$1[1]; - _tmp$7 = r; - _tmp$8 = p1.$get(); - p1.$set(_tmp$7); - r = _tmp$8; - i = i + (2) >> 0; - } - z = z.setWord(1); - i$1 = y.$length - 1 >> 0; - while (true) { - if (!(i$1 >= 0)) { break; } - yi = ((i$1 < 0 || i$1 >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i$1]); - j = 0; - while (true) { - if (!(j < 32)) { break; } - if (!((i$1 === (y.$length - 1 >> 0))) || !((j === 0))) { - zz = zz.mul(z, z); - _tmp$9 = z; - _tmp$10 = zz; - zz = _tmp$9; - z = _tmp$10; - _tuple$2 = zz.div(r, z, m); - zz = _tuple$2[0]; - r = _tuple$2[1]; - _tmp$11 = r; - _tmp$12 = z; - z = _tmp$11; - r = _tmp$12; - zz = zz.mul(z, z); - _tmp$13 = z; - _tmp$14 = zz; - zz = _tmp$13; - z = _tmp$14; - _tuple$3 = zz.div(r, z, m); - zz = _tuple$3[0]; - r = _tuple$3[1]; - _tmp$15 = r; - _tmp$16 = z; - z = _tmp$15; - r = _tmp$16; - zz = zz.mul(z, z); - _tmp$17 = z; - _tmp$18 = zz; - zz = _tmp$17; - z = _tmp$18; - _tuple$4 = zz.div(r, z, m); - zz = _tuple$4[0]; - r = _tuple$4[1]; - _tmp$19 = r; - _tmp$20 = z; - z = _tmp$19; - r = _tmp$20; - zz = zz.mul(z, z); - _tmp$21 = z; - _tmp$22 = zz; - zz = _tmp$21; - z = _tmp$22; - _tuple$5 = zz.div(r, z, m); - zz = _tuple$5[0]; - r = _tuple$5[1]; - _tmp$23 = r; - _tmp$24 = z; - z = _tmp$23; - r = _tmp$24; - } - zz = zz.mul(z, (x$1 = yi >>> 28 >>> 0, ((x$1 < 0 || x$1 >= powers.length) ? $throwRuntimeError("index out of range") : powers[x$1]))); - _tmp$25 = z; - _tmp$26 = zz; - zz = _tmp$25; - z = _tmp$26; - _tuple$6 = zz.div(r, z, m); - zz = _tuple$6[0]; - r = _tuple$6[1]; - _tmp$27 = r; - _tmp$28 = z; - z = _tmp$27; - r = _tmp$28; - yi = (y$1 = (4), y$1 < 32 ? (yi << y$1) : 0) >>> 0; - j = j + (4) >> 0; - } - i$1 = i$1 - (1) >> 0; - } - return z.norm(); - }; - $ptrType(nat).prototype.expNNWindowed = function(x, y, m) { return this.$get().expNNWindowed(x, y, m); }; - nat.prototype.expNNMontgomery = function(x, y, m) { - var $ptr, RR, _tmp, _tmp$1, _tuple, _tuple$1, _tuple$2, i, i$1, i$2, j, k0, m, numWords, one, powers, rr, t, x, x$1, x$2, y, y$1, y$2, yi, z, zz; - z = this; - numWords = m.$length; - if (x.$length > numWords) { - _tuple = nat.nil.div(nat.nil, x, m); - x = _tuple[1]; - } - if (x.$length < numWords) { - rr = $makeSlice(nat, numWords); - $copySlice(rr, x); - x = rr; - } - k0 = 2 - (0 >= m.$length ? $throwRuntimeError("index out of range") : m.$array[m.$offset + 0]) >>> 0; - t = (0 >= m.$length ? $throwRuntimeError("index out of range") : m.$array[m.$offset + 0]) - 1 >>> 0; - i = 1; - while (true) { - if (!(i < 32)) { break; } - t = $imul(t, (t)) >>> 0; - k0 = $imul(k0, (((t + 1 >>> 0)))) >>> 0; - i = (y$1 = (1), y$1 < 32 ? (i << y$1) : 0) >> 0; - } - k0 = -k0 >>> 0; - RR = nat.nil.setWord(1); - zz = nat.nil.shl(RR, (($imul(($imul(2, numWords)), 32)) >>> 0)); - _tuple$1 = RR.div(RR, zz, m); - RR = _tuple$1[1]; - if (RR.$length < numWords) { - zz = zz.make(numWords); - $copySlice(zz, RR); - RR = zz; - } - one = $makeSlice(nat, numWords); - (0 >= one.$length ? $throwRuntimeError("index out of range") : one.$array[one.$offset + 0] = 1); - powers = arrayType$1.zero(); - powers[0] = powers[0].montgomery(one, RR, m, k0, numWords); - powers[1] = powers[1].montgomery(x, RR, m, k0, numWords); - i$1 = 2; - while (true) { - if (!(i$1 < 16)) { break; } - ((i$1 < 0 || i$1 >= powers.length) ? $throwRuntimeError("index out of range") : powers[i$1] = ((i$1 < 0 || i$1 >= powers.length) ? $throwRuntimeError("index out of range") : powers[i$1]).montgomery((x$1 = i$1 - 1 >> 0, ((x$1 < 0 || x$1 >= powers.length) ? $throwRuntimeError("index out of range") : powers[x$1])), powers[1], m, k0, numWords)); - i$1 = i$1 + (1) >> 0; - } - z = z.make(numWords); - $copySlice(z, powers[0]); - zz = zz.make(numWords); - i$2 = y.$length - 1 >> 0; - while (true) { - if (!(i$2 >= 0)) { break; } - yi = ((i$2 < 0 || i$2 >= y.$length) ? $throwRuntimeError("index out of range") : y.$array[y.$offset + i$2]); - j = 0; - while (true) { - if (!(j < 32)) { break; } - if (!((i$2 === (y.$length - 1 >> 0))) || !((j === 0))) { - zz = zz.montgomery(z, z, m, k0, numWords); - z = z.montgomery(zz, zz, m, k0, numWords); - zz = zz.montgomery(z, z, m, k0, numWords); - z = z.montgomery(zz, zz, m, k0, numWords); - } - zz = zz.montgomery(z, (x$2 = yi >>> 28 >>> 0, ((x$2 < 0 || x$2 >= powers.length) ? $throwRuntimeError("index out of range") : powers[x$2])), m, k0, numWords); - _tmp = zz; - _tmp$1 = z; - z = _tmp; - zz = _tmp$1; - yi = (y$2 = (4), y$2 < 32 ? (yi << y$2) : 0) >>> 0; - j = j + (4) >> 0; - } - i$2 = i$2 - (1) >> 0; - } - zz = zz.montgomery(z, one, m, k0, numWords); - if (zz.cmp(m) >= 0) { - zz = zz.sub(zz, m); - if (zz.cmp(m) >= 0) { - _tuple$2 = nat.nil.div(nat.nil, zz, m); - zz = _tuple$2[1]; - } - } - return zz.norm(); - }; - $ptrType(nat).prototype.expNNMontgomery = function(x, y, m) { return this.$get().expNNMontgomery(x, y, m); }; - nat.prototype.probablyPrime = function(reps) { - var $ptr, _4, _5, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _tmp$2, _tuple, i, j, k, n, nm1, nm3, nm3Len, q, quotient, r, rand$1, reps, x, x$1, y, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _4 = $f._4; _5 = $f._5; _r = $f._r; _r$1 = $f._r$1; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tuple = $f._tuple; i = $f.i; j = $f.j; k = $f.k; n = $f.n; nm1 = $f.nm1; nm3 = $f.nm3; nm3Len = $f.nm3Len; q = $f.q; quotient = $f.quotient; r = $f.r; rand$1 = $f.rand$1; reps = $f.reps; x = $f.x; x$1 = $f.x$1; y = $f.y; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = this; - if (n.$length === 0) { - return false; - } - if (n.$length === 1) { - if ((0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]) < 2) { - return false; - } - if ((_r = (0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]) % 2, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) === 0) { - return (0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]) === 2; - } - _4 = (0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]); - if ((_4 === (3)) || (_4 === (5)) || (_4 === (7)) || (_4 === (11)) || (_4 === (13)) || (_4 === (17)) || (_4 === (19)) || (_4 === (23)) || (_4 === (29)) || (_4 === (31)) || (_4 === (37)) || (_4 === (41)) || (_4 === (43)) || (_4 === (47)) || (_4 === (53))) { - return true; - } - } - if ((((0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]) & 1) >>> 0) === 0) { - return false; - } - r = 0; - _5 = 32; - if (_5 === (32)) { - r = n.modW(3234846615); - } else if (_5 === (64)) { - r = n.modW(820596253); - } else { - $panic(new $String("Unknown word size")); - } - if (((_r$1 = r % 3, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$2 = r % 5, _r$2 === _r$2 ? _r$2 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$3 = r % 7, _r$3 === _r$3 ? _r$3 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$4 = r % 11, _r$4 === _r$4 ? _r$4 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$5 = r % 13, _r$5 === _r$5 ? _r$5 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$6 = r % 17, _r$6 === _r$6 ? _r$6 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$7 = r % 19, _r$7 === _r$7 ? _r$7 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$8 = r % 23, _r$8 === _r$8 ? _r$8 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$9 = r % 29, _r$9 === _r$9 ? _r$9 : $throwRuntimeError("integer divide by zero")) === 0)) { - return false; - } - if (false && (((_r$10 = r % 31, _r$10 === _r$10 ? _r$10 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$11 = r % 37, _r$11 === _r$11 ? _r$11 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$12 = r % 41, _r$12 === _r$12 ? _r$12 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$13 = r % 43, _r$13 === _r$13 ? _r$13 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$14 = r % 47, _r$14 === _r$14 ? _r$14 : $throwRuntimeError("integer divide by zero")) === 0) || ((_r$15 = r % 53, _r$15 === _r$15 ? _r$15 : $throwRuntimeError("integer divide by zero")) === 0))) { - return false; - } - nm1 = nat.nil.sub(n, natOne); - k = nm1.trailingZeroBits(); - q = nat.nil.shr(nm1, k); - nm3 = nat.nil.sub(nm1, natTwo); - rand$1 = rand.New(rand.NewSource((x = (0 >= n.$length ? $throwRuntimeError("index out of range") : n.$array[n.$offset + 0]), new $Int64(0, x.constructor === Number ? x : 1)))); - _tmp = nat.nil; - _tmp$1 = nat.nil; - _tmp$2 = nat.nil; - x$1 = _tmp; - y = _tmp$1; - quotient = _tmp$2; - nm3Len = nm3.bitLen(); - i = 0; - /* while (true) { */ case 1: - /* if (!(i < reps)) { break; } */ if(!(i < reps)) { $s = 2; continue; } - _r$16 = x$1.random(rand$1, nm3, nm3Len); /* */ $s = 3; case 3: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } - x$1 = _r$16; - x$1 = x$1.add(x$1, natTwo); - y = y.expNN(x$1, q, n); - if ((y.cmp(natOne) === 0) || (y.cmp(nm1) === 0)) { - i = i + (1) >> 0; - /* continue; */ $s = 1; continue; - } - j = 1; - while (true) { - if (!(j < k)) { break; } - y = y.mul(y, y); - _tuple = quotient.div(y, y, n); - quotient = _tuple[0]; - y = _tuple[1]; - if (y.cmp(nm1) === 0) { - i = i + (1) >> 0; - /* continue NextRandom; */ $s = 1; continue s; - } - if (y.cmp(natOne) === 0) { - return false; - } - j = j + (1) >>> 0; - } - return false; - /* } */ $s = 1; continue; case 2: - return true; - /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.probablyPrime }; } $f.$ptr = $ptr; $f._4 = _4; $f._5 = _5; $f._r = _r; $f._r$1 = _r$1; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tuple = _tuple; $f.i = i; $f.j = j; $f.k = k; $f.n = n; $f.nm1 = nm1; $f.nm3 = nm3; $f.nm3Len = nm3Len; $f.q = q; $f.quotient = quotient; $f.r = r; $f.rand$1 = rand$1; $f.reps = reps; $f.x = x; $f.x$1 = x$1; $f.y = y; $f.$s = $s; $f.$r = $r; return $f; - }; - $ptrType(nat).prototype.probablyPrime = function(reps) { return this.$get().probablyPrime(reps); }; - nat.prototype.bytes = function(buf) { - var $ptr, _i, _ref, buf, d, i, j, y, z; - i = 0; - z = this; - i = buf.$length; - _ref = z; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - d = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - j = 0; - while (true) { - if (!(j < 4)) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i] = (d << 24 >>> 24)); - d = (y = (8), y < 32 ? (d >>> y) : 0) >>> 0; - j = j + (1) >> 0; - } - _i++; - } - while (true) { - if (!(i < buf.$length && (((i < 0 || i >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + i]) === 0))) { break; } - i = i + (1) >> 0; - } - return i; - }; - $ptrType(nat).prototype.bytes = function(buf) { return this.$get().bytes(buf); }; - nat.prototype.setBytes = function(buf) { - var $ptr, _q, buf, d, i, k, s, x, y, z; - z = this; - z = z.make((_q = (((buf.$length + 4 >> 0) - 1 >> 0)) / 4, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))); - k = 0; - s = 0; - d = 0; - i = buf.$length; - while (true) { - if (!(i > 0)) { break; } - d = (d | (((y = s, y < 32 ? (((x = i - 1 >> 0, ((x < 0 || x >= buf.$length) ? $throwRuntimeError("index out of range") : buf.$array[buf.$offset + x])) >>> 0) << y) : 0) >>> 0))) >>> 0; - s = s + (8) >>> 0; - if (s === 32) { - ((k < 0 || k >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + k] = d); - k = k + (1) >> 0; - s = 0; - d = 0; - } - i = i - (1) >> 0; - } - if (k < z.$length) { - ((k < 0 || k >= z.$length) ? $throwRuntimeError("index out of range") : z.$array[z.$offset + k] = d); - } - return z.norm(); - }; - $ptrType(nat).prototype.setBytes = function(buf) { return this.$get().setBytes(buf); }; - maxPow = function(b) { - var $ptr, _q, _tmp, _tmp$1, b, max$1, n, p; - p = 0; - n = 0; - _tmp = b; - _tmp$1 = 1; - p = _tmp; - n = _tmp$1; - max$1 = (_q = 4294967295 / b, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - while (true) { - if (!(p <= max$1)) { break; } - p = $imul(p, (b)) >>> 0; - n = n + (1) >> 0; - } - return [p, n]; - }; - pow = function(x, n) { - var $ptr, n, p, x; - p = 0; - p = 1; - while (true) { - if (!(n > 0)) { break; } - if (!(((n & 1) === 0))) { - p = $imul(p, (x)) >>> 0; - } - x = $imul(x, (x)) >>> 0; - n = (n >> $min((1), 31)) >> 0; - } - return p; - }; - nat.prototype.scan = function(r, base, fracOk) { - var $ptr, _1, _2, _3, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, _tuple$2, _tuple$3, _tuple$4, _tuple$5, b, b1, base, baseOk, bn, ch, count, d1, di, dp, err, fracOk, i, n, r, res, z, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _1 = $f._1; _2 = $f._2; _3 = $f._3; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _tuple$2 = $f._tuple$2; _tuple$3 = $f._tuple$3; _tuple$4 = $f._tuple$4; _tuple$5 = $f._tuple$5; b = $f.b; b1 = $f.b1; base = $f.base; baseOk = $f.baseOk; bn = $f.bn; ch = $f.ch; count = $f.count; d1 = $f.d1; di = $f.di; dp = $f.dp; err = $f.err; fracOk = $f.fracOk; i = $f.i; n = $f.n; r = $f.r; res = $f.res; z = $f.z; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - res = nat.nil; - b = 0; - count = 0; - err = $ifaceNil; - z = this; - baseOk = (base === 0) || !fracOk && 2 <= base && base <= 36 || fracOk && ((base === 2) || (base === 10) || (base === 16)); - /* */ if (!baseOk) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!baseOk) { */ case 1: - _r = fmt.Sprintf("illegal number base %d", new sliceType$1([new $Int(base)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - $panic(new $String(_r)); - /* } */ case 2: - _r$1 = r.ReadByte(); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple = _r$1; - ch = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [res, b, count, err]; - } - b = base; - /* */ if (base === 0) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (base === 0) { */ case 5: - b = 10; - /* */ if (ch === 48) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (ch === 48) { */ case 7: - count = 1; - _r$2 = r.ReadByte(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$1 = _r$2; - ch = _tuple$1[0]; - err = _tuple$1[1]; - _1 = err; - /* */ if ($interfaceIsEqual(_1, $ifaceNil)) { $s = 11; continue; } - /* */ if ($interfaceIsEqual(_1, (io.EOF))) { $s = 12; continue; } - /* */ $s = 13; continue; - /* if ($interfaceIsEqual(_1, $ifaceNil)) { */ case 11: - if (!fracOk) { - b = 8; - } - _2 = ch; - if ((_2 === (120)) || (_2 === (88))) { - b = 16; - } else if ((_2 === (98)) || (_2 === (66))) { - b = 2; - } - _3 = b; - /* */ if ((_3 === (16)) || (_3 === (2))) { $s = 16; continue; } - /* */ if (_3 === (8)) { $s = 17; continue; } - /* */ $s = 18; continue; - /* if ((_3 === (16)) || (_3 === (2))) { */ case 16: - count = 0; - _r$3 = r.ReadByte(); /* */ $s = 19; case 19: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _tuple$2 = _r$3; - ch = _tuple$2[0]; - err = _tuple$2[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [res, b, count, err]; - } - $s = 18; continue; - /* } else if (_3 === (8)) { */ case 17: - count = 0; - /* } */ case 18: - case 15: - $s = 14; continue; - /* } else if ($interfaceIsEqual(_1, (io.EOF))) { */ case 12: - res = $subslice(z, 0, 0); - err = $ifaceNil; - return [res, b, count, err]; - /* } else { */ case 13: - return [res, b, count, err]; - /* } */ case 14: - case 9: - /* } */ case 8: - /* } */ case 6: - z = $subslice(z, 0, 0); - b1 = (b >>> 0); - _tuple$3 = maxPow(b1); - bn = _tuple$3[0]; - n = _tuple$3[1]; - di = 0; - i = 0; - dp = -1; - /* while (true) { */ case 20: - /* */ if (fracOk && (ch === 46)) { $s = 22; continue; } - /* */ $s = 23; continue; - /* if (fracOk && (ch === 46)) { */ case 22: - fracOk = false; - dp = count; - _r$4 = r.ReadByte(); /* */ $s = 24; case 24: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _tuple$4 = _r$4; - ch = _tuple$4[0]; - err = _tuple$4[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - if ($interfaceIsEqual(err, io.EOF)) { - err = $ifaceNil; - /* break; */ $s = 21; continue; - } - return [res, b, count, err]; - } - /* } */ case 23: - d1 = 0; - if (48 <= ch && ch <= 57) { - d1 = ((ch - 48 << 24 >>> 24) >>> 0); - } else if (97 <= ch && ch <= 122) { - d1 = (((ch - 97 << 24 >>> 24) + 10 << 24 >>> 24) >>> 0); - } else if (65 <= ch && ch <= 90) { - d1 = (((ch - 65 << 24 >>> 24) + 10 << 24 >>> 24) >>> 0); - } else { - d1 = 37; - } - /* */ if (d1 >= b1) { $s = 25; continue; } - /* */ $s = 26; continue; - /* if (d1 >= b1) { */ case 25: - _r$5 = r.UnreadByte(); /* */ $s = 27; case 27: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _r$5; - /* break; */ $s = 21; continue; - /* } */ case 26: - count = count + (1) >> 0; - di = ($imul(di, b1) >>> 0) + d1 >>> 0; - i = i + (1) >> 0; - if (i === n) { - z = z.mulAddWW(z, bn, di); - di = 0; - i = 0; - } - _r$6 = r.ReadByte(); /* */ $s = 28; case 28: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _tuple$5 = _r$6; - ch = _tuple$5[0]; - err = _tuple$5[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - if ($interfaceIsEqual(err, io.EOF)) { - err = $ifaceNil; - /* break; */ $s = 21; continue; - } - return [res, b, count, err]; - } - /* } */ $s = 20; continue; case 21: - if (count === 0) { - if ((base === 0) && (b === 8)) { - count = 1; - b = 10; - } else if (!((base === 0)) || !((b === 8))) { - err = errors.New("syntax error scanning number"); - } - return [res, b, count, err]; - } - if (i > 0) { - z = z.mulAddWW(z, pow(b1, i), di); - } - res = z.norm(); - if (dp >= 0) { - count = dp - count >> 0; - } - return [res, b, count, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: nat.prototype.scan }; } $f.$ptr = $ptr; $f._1 = _1; $f._2 = _2; $f._3 = _3; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._tuple$2 = _tuple$2; $f._tuple$3 = _tuple$3; $f._tuple$4 = _tuple$4; $f._tuple$5 = _tuple$5; $f.b = b; $f.b1 = b1; $f.base = base; $f.baseOk = baseOk; $f.bn = bn; $f.ch = ch; $f.count = count; $f.d1 = d1; $f.di = di; $f.dp = dp; $f.err = err; $f.fracOk = fracOk; $f.i = i; $f.n = n; $f.r = r; $f.res = res; $f.z = z; $f.$s = $s; $f.$r = $r; return $f; - }; - $ptrType(nat).prototype.scan = function(r, base, fracOk) { return this.$get().scan(r, base, fracOk); }; - nat.prototype.utoa = function(base) { - var $ptr, base, x; - x = this; - return x.itoa(false, base); - }; - $ptrType(nat).prototype.utoa = function(base) { return this.$get().utoa(base); }; - nat.prototype.itoa = function(neg, base) { - var $ptr, _tuple, b, base, bb, i, k, mask, nbits, ndigits, neg, q, s, shift, table, w, x, y, y$1, y$2, y$3, y$4; - x = this; - if (base < 2 || base > 36) { - $panic(new $String("invalid base")); - } - if (x.$length === 0) { - return new sliceType($stringToBytes("0")); - } - i = (x.bitLen() / math.Log2(base) >> 0) + 1 >> 0; - if (neg) { - i = i + (1) >> 0; - } - s = $makeSlice(sliceType, i); - b = (base >>> 0); - if (b === ((b & (-b >>> 0)) >>> 0)) { - shift = trailingZeroBits(b); - mask = (((y = shift, y < 32 ? (1 << y) : 0) >>> 0) - 1 >>> 0); - w = (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0]); - nbits = 32; - k = 1; - while (true) { - if (!(k < x.$length)) { break; } - while (true) { - if (!(nbits >= shift)) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((w & mask) >>> 0))); - w = (y$1 = (shift), y$1 < 32 ? (w >>> y$1) : 0) >>> 0; - nbits = nbits - (shift) >>> 0; - } - if (nbits === 0) { - w = ((k < 0 || k >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + k]); - nbits = 32; - } else { - w = (w | (((y$2 = nbits, y$2 < 32 ? (((k < 0 || k >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + k]) << y$2) : 0) >>> 0))) >>> 0; - i = i - (1) >> 0; - ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((w & mask) >>> 0))); - w = (y$3 = ((shift - nbits >>> 0)), y$3 < 32 ? (((k < 0 || k >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + k]) >>> y$3) : 0) >>> 0; - nbits = 32 - ((shift - nbits >>> 0)) >>> 0; - } - k = k + (1) >> 0; - } - while (true) { - if (!(!((w === 0)))) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((w & mask) >>> 0))); - w = (y$4 = (shift), y$4 < 32 ? (w >>> y$4) : 0) >>> 0; - } - } else { - _tuple = maxPow(b); - bb = _tuple[0]; - ndigits = _tuple[1]; - table = divisors(x.$length, b, ndigits, bb); - q = nat.nil.set(x); - q.convertWords(s, b, ndigits, bb, table); - i = 0; - while (true) { - if (!(((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i]) === 48)) { break; } - i = i + (1) >> 0; - } - } - if (neg) { - i = i - (1) >> 0; - ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = 45); - } - return $subslice(s, i); - }; - $ptrType(nat).prototype.itoa = function(neg, base) { return this.$get().itoa(neg, base); }; - nat.prototype.convertWords = function(s, b, ndigits, bb, table) { - var $ptr, _q, _q$1, _r, _tuple, _tuple$1, _tuple$2, b, bb, h, i, index, j, j$1, maxLength, minLength, ndigits, q, r, r$1, s, t, table, x; - q = this; - if (!(table === sliceType$3.nil)) { - r = nat.nil; - index = table.$length - 1 >> 0; - while (true) { - if (!(q.$length > leafSize)) { break; } - maxLength = q.bitLen(); - minLength = maxLength >> 1 >> 0; - while (true) { - if (!(index > 0 && (x = index - 1 >> 0, ((x < 0 || x >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + x])).nbits > minLength)) { break; } - index = index - (1) >> 0; - } - if (((index < 0 || index >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + index]).nbits >= maxLength && ((index < 0 || index >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + index]).bbb.cmp(q) >= 0) { - index = index - (1) >> 0; - if (index < 0) { - $panic(new $String("internal inconsistency")); - } - } - _tuple = q.div(r, q, ((index < 0 || index >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + index]).bbb); - q = _tuple[0]; - r = _tuple[1]; - h = s.$length - ((index < 0 || index >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + index]).ndigits >> 0; - r.convertWords($subslice(s, h), b, ndigits, bb, $subslice(table, 0, index)); - s = $subslice(s, 0, h); - } - } - i = s.$length; - r$1 = 0; - if (b === 10) { - while (true) { - if (!(q.$length > 0)) { break; } - _tuple$1 = q.divW(q, bb); - q = _tuple$1[0]; - r$1 = _tuple$1[1]; - j = 0; - while (true) { - if (!(j < ndigits && i > 0)) { break; } - i = i - (1) >> 0; - t = (_q = r$1 / 10, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")); - ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = (48 + ((((r$1 - (t << 3 >>> 0) >>> 0) - t >>> 0) - t >>> 0) << 24 >>> 24) << 24 >>> 24)); - r$1 = t; - j = j + (1) >> 0; - } - } - } else { - while (true) { - if (!(q.$length > 0)) { break; } - _tuple$2 = q.divW(q, bb); - q = _tuple$2[0]; - r$1 = _tuple$2[1]; - j$1 = 0; - while (true) { - if (!(j$1 < ndigits && i > 0)) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = "0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((_r = r$1 % b, _r === _r ? _r : $throwRuntimeError("integer divide by zero")))); - r$1 = (_q$1 = r$1 / (b), (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >>> 0 : $throwRuntimeError("integer divide by zero")); - j$1 = j$1 + (1) >> 0; - } - } - } - while (true) { - if (!(i > 0)) { break; } - i = i - (1) >> 0; - ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i] = 48); - } - }; - $ptrType(nat).prototype.convertWords = function(s, b, ndigits, bb, table) { return this.$get().convertWords(s, b, ndigits, bb, table); }; - nat.prototype.expWW = function(x, y) { - var $ptr, x, y, z; - z = this; - return z.expNN(nat.nil.setWord(x), nat.nil.setWord(y), nat.nil); - }; - $ptrType(nat).prototype.expWW = function(x, y) { return this.$get().expWW(x, y); }; - divisors = function(m, b, ndigits, bb) { - var $ptr, b, bb, i, k, larger, m, ndigits, table, words, x, x$1, x$2, x$3, y; - if ((leafSize === 0) || m <= leafSize) { - return sliceType$3.nil; - } - k = 1; - words = leafSize; - while (true) { - if (!(words < (m >> 1 >> 0) && k < 64)) { break; } - k = k + (1) >> 0; - words = (y = (1), y < 32 ? (words << y) : 0) >> 0; - } - table = sliceType$3.nil; - if (b === 10) { - cacheBase10.Mutex.Lock(); - table = $subslice(new sliceType$3(cacheBase10.table), 0, k); - } else { - table = $makeSlice(sliceType$3, k); - } - if ((x = k - 1 >> 0, ((x < 0 || x >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + x])).ndigits === 0) { - larger = nat.nil; - i = 0; - while (true) { - if (!(i < k)) { break; } - if (((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).ndigits === 0) { - if (i === 0) { - (0 >= table.$length ? $throwRuntimeError("index out of range") : table.$array[table.$offset + 0]).bbb = nat.nil.expWW(bb, (leafSize >>> 0)); - (0 >= table.$length ? $throwRuntimeError("index out of range") : table.$array[table.$offset + 0]).ndigits = $imul(ndigits, leafSize); - } else { - ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).bbb = nat.nil.mul((x$1 = i - 1 >> 0, ((x$1 < 0 || x$1 >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + x$1])).bbb, (x$2 = i - 1 >> 0, ((x$2 < 0 || x$2 >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + x$2])).bbb); - ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).ndigits = $imul(2, (x$3 = i - 1 >> 0, ((x$3 < 0 || x$3 >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + x$3])).ndigits); - } - larger = nat.nil.set(((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).bbb); - while (true) { - if (!(mulAddVWW($subslice(new sliceType$2(larger.$array), larger.$offset, larger.$offset + larger.$length), $subslice(new sliceType$2(larger.$array), larger.$offset, larger.$offset + larger.$length), b, 0) === 0)) { break; } - ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).bbb = ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).bbb.set(larger); - ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).ndigits = ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).ndigits + (1) >> 0; - } - ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).nbits = ((i < 0 || i >= table.$length) ? $throwRuntimeError("index out of range") : table.$array[table.$offset + i]).bbb.bitLen(); - } - i = i + (1) >> 0; - } - } - if (b === 10) { - cacheBase10.Mutex.Unlock(); - } - return table; - }; - ptrType$1.methods = [{prop: "Sign", name: "Sign", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "SetInt64", name: "SetInt64", pkg: "", typ: $funcType([$Int64], [ptrType$1], false)}, {prop: "SetUint64", name: "SetUint64", pkg: "", typ: $funcType([$Uint64], [ptrType$1], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [sliceType$2], false)}, {prop: "SetBits", name: "SetBits", pkg: "", typ: $funcType([sliceType$2], [ptrType$1], false)}, {prop: "Abs", name: "Abs", pkg: "", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "Neg", name: "Neg", pkg: "", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "Add", name: "Add", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Sub", name: "Sub", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Mul", name: "Mul", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "MulRange", name: "MulRange", pkg: "", typ: $funcType([$Int64, $Int64], [ptrType$1], false)}, {prop: "Binomial", name: "Binomial", pkg: "", typ: $funcType([$Int64, $Int64], [ptrType$1], false)}, {prop: "Quo", name: "Quo", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Rem", name: "Rem", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "QuoRem", name: "QuoRem", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "Div", name: "Div", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Mod", name: "Mod", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "DivMod", name: "DivMod", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1], [ptrType$1, ptrType$1], false)}, {prop: "Cmp", name: "Cmp", pkg: "", typ: $funcType([ptrType$1], [$Int], false)}, {prop: "Int64", name: "Int64", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "SetString", name: "SetString", pkg: "", typ: $funcType([$String, $Int], [ptrType$1, $Bool], false)}, {prop: "SetBytes", name: "SetBytes", pkg: "", typ: $funcType([sliceType], [ptrType$1], false)}, {prop: "Bytes", name: "Bytes", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "BitLen", name: "BitLen", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Exp", name: "Exp", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "GCD", name: "GCD", pkg: "", typ: $funcType([ptrType$1, ptrType$1, ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "binaryGCD", name: "binaryGCD", pkg: "math/big", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "ProbablyPrime", name: "ProbablyPrime", pkg: "", typ: $funcType([$Int], [$Bool], false)}, {prop: "Rand", name: "Rand", pkg: "", typ: $funcType([ptrType$6, ptrType$1], [ptrType$1], false)}, {prop: "ModInverse", name: "ModInverse", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "modSqrt3Mod4Prime", name: "modSqrt3Mod4Prime", pkg: "math/big", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "modSqrtTonelliShanks", name: "modSqrtTonelliShanks", pkg: "math/big", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "ModSqrt", name: "ModSqrt", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Lsh", name: "Lsh", pkg: "", typ: $funcType([ptrType$1, $Uint], [ptrType$1], false)}, {prop: "Rsh", name: "Rsh", pkg: "", typ: $funcType([ptrType$1, $Uint], [ptrType$1], false)}, {prop: "Bit", name: "Bit", pkg: "", typ: $funcType([$Int], [$Uint], false)}, {prop: "SetBit", name: "SetBit", pkg: "", typ: $funcType([ptrType$1, $Int, $Uint], [ptrType$1], false)}, {prop: "And", name: "And", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "AndNot", name: "AndNot", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Or", name: "Or", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Xor", name: "Xor", pkg: "", typ: $funcType([ptrType$1, ptrType$1], [ptrType$1], false)}, {prop: "Not", name: "Not", pkg: "", typ: $funcType([ptrType$1], [ptrType$1], false)}, {prop: "Text", name: "Text", pkg: "", typ: $funcType([$Int], [$String], false)}, {prop: "Append", name: "Append", pkg: "", typ: $funcType([sliceType, $Int], [sliceType], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Format", name: "Format", pkg: "", typ: $funcType([fmt.State, $Int32], [], false)}, {prop: "scan", name: "scan", pkg: "math/big", typ: $funcType([io.ByteScanner, $Int], [ptrType$1, $Int, $error], false)}, {prop: "Scan", name: "Scan", pkg: "", typ: $funcType([fmt.ScanState, $Int32], [$error], false)}, {prop: "GobEncode", name: "GobEncode", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "GobDecode", name: "GobDecode", pkg: "", typ: $funcType([sliceType], [$error], false)}, {prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "UnmarshalText", name: "UnmarshalText", pkg: "", typ: $funcType([sliceType], [$error], false)}, {prop: "MarshalJSON", name: "MarshalJSON", pkg: "", typ: $funcType([], [sliceType, $error], false)}, {prop: "UnmarshalJSON", name: "UnmarshalJSON", pkg: "", typ: $funcType([sliceType], [$error], false)}]; - byteReader.methods = [{prop: "ReadByte", name: "ReadByte", pkg: "", typ: $funcType([], [$Uint8, $error], false)}, {prop: "UnreadByte", name: "UnreadByte", pkg: "", typ: $funcType([], [$error], false)}]; - nat.methods = [{prop: "clear", name: "clear", pkg: "math/big", typ: $funcType([], [], false)}, {prop: "norm", name: "norm", pkg: "math/big", typ: $funcType([], [nat], false)}, {prop: "make", name: "make", pkg: "math/big", typ: $funcType([$Int], [nat], false)}, {prop: "setWord", name: "setWord", pkg: "math/big", typ: $funcType([Word], [nat], false)}, {prop: "setUint64", name: "setUint64", pkg: "math/big", typ: $funcType([$Uint64], [nat], false)}, {prop: "set", name: "set", pkg: "math/big", typ: $funcType([nat], [nat], false)}, {prop: "add", name: "add", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "sub", name: "sub", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "cmp", name: "cmp", pkg: "math/big", typ: $funcType([nat], [$Int], false)}, {prop: "mulAddWW", name: "mulAddWW", pkg: "math/big", typ: $funcType([nat, Word, Word], [nat], false)}, {prop: "montgomery", name: "montgomery", pkg: "math/big", typ: $funcType([nat, nat, nat, Word, $Int], [nat], false)}, {prop: "mul", name: "mul", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "mulRange", name: "mulRange", pkg: "math/big", typ: $funcType([$Uint64, $Uint64], [nat], false)}, {prop: "divW", name: "divW", pkg: "math/big", typ: $funcType([nat, Word], [nat, Word], false)}, {prop: "div", name: "div", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat, nat], false)}, {prop: "divLarge", name: "divLarge", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat, nat], false)}, {prop: "bitLen", name: "bitLen", pkg: "math/big", typ: $funcType([], [$Int], false)}, {prop: "trailingZeroBits", name: "trailingZeroBits", pkg: "math/big", typ: $funcType([], [$Uint], false)}, {prop: "shl", name: "shl", pkg: "math/big", typ: $funcType([nat, $Uint], [nat], false)}, {prop: "shr", name: "shr", pkg: "math/big", typ: $funcType([nat, $Uint], [nat], false)}, {prop: "setBit", name: "setBit", pkg: "math/big", typ: $funcType([nat, $Uint, $Uint], [nat], false)}, {prop: "bit", name: "bit", pkg: "math/big", typ: $funcType([$Uint], [$Uint], false)}, {prop: "sticky", name: "sticky", pkg: "math/big", typ: $funcType([$Uint], [$Uint], false)}, {prop: "and", name: "and", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "andNot", name: "andNot", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "or", name: "or", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "xor", name: "xor", pkg: "math/big", typ: $funcType([nat, nat], [nat], false)}, {prop: "modW", name: "modW", pkg: "math/big", typ: $funcType([Word], [Word], false)}, {prop: "random", name: "random", pkg: "math/big", typ: $funcType([ptrType$6, nat, $Int], [nat], false)}, {prop: "expNN", name: "expNN", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat], false)}, {prop: "expNNWindowed", name: "expNNWindowed", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat], false)}, {prop: "expNNMontgomery", name: "expNNMontgomery", pkg: "math/big", typ: $funcType([nat, nat, nat], [nat], false)}, {prop: "probablyPrime", name: "probablyPrime", pkg: "math/big", typ: $funcType([$Int], [$Bool], false)}, {prop: "bytes", name: "bytes", pkg: "math/big", typ: $funcType([sliceType], [$Int], false)}, {prop: "setBytes", name: "setBytes", pkg: "math/big", typ: $funcType([sliceType], [nat], false)}, {prop: "scan", name: "scan", pkg: "math/big", typ: $funcType([io.ByteScanner, $Int, $Bool], [nat, $Int, $Int, $error], false)}, {prop: "utoa", name: "utoa", pkg: "math/big", typ: $funcType([$Int], [sliceType], false)}, {prop: "itoa", name: "itoa", pkg: "math/big", typ: $funcType([$Bool, $Int], [sliceType], false)}, {prop: "convertWords", name: "convertWords", pkg: "math/big", typ: $funcType([sliceType, Word, $Int, Word, sliceType$3], [], false)}, {prop: "expWW", name: "expWW", pkg: "math/big", typ: $funcType([Word, Word], [nat], false)}]; - Int.init([{prop: "neg", name: "neg", pkg: "math/big", typ: $Bool, tag: ""}, {prop: "abs", name: "abs", pkg: "math/big", typ: nat, tag: ""}]); - byteReader.init([{prop: "ScanState", name: "", pkg: "", typ: fmt.ScanState, tag: ""}]); - nat.init(Word); - divisor.init([{prop: "bbb", name: "bbb", pkg: "math/big", typ: nat, tag: ""}, {prop: "nbits", name: "nbits", pkg: "math/big", typ: $Int, tag: ""}, {prop: "ndigits", name: "ndigits", pkg: "math/big", typ: $Int, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = binary.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = errors.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = fmt.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = nosync.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = math.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = rand.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strconv.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strings.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - cacheBase10 = new structType.ptr(new nosync.Mutex.ptr(false), arrayType.zero()); - natOne = new nat([1]); - intOne = new Int.ptr(false, natOne); - natTwo = new nat([2]); - karatsubaThreshold = 40; - deBruijn32Lookup = new sliceType([0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9]); - deBruijn64Lookup = new sliceType([0, 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4, 62, 47, 59, 36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5, 63, 55, 48, 27, 60, 41, 37, 16, 46, 35, 44, 21, 52, 32, 23, 11, 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6]); - leafSize = 8; - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["crypto/rand"] = (function() { - var $pkg = {}, $init, errors, js, io, big, rngReader, sliceType, ptrType$1, smallPrimesProduct, init, Read; - errors = $packages["errors"]; - js = $packages["github.com/gopherjs/gopherjs/js"]; - io = $packages["io"]; - big = $packages["math/big"]; - rngReader = $pkg.rngReader = $newType(0, $kindStruct, "rand.rngReader", "rngReader", "crypto/rand", function() { - this.$val = this; - if (arguments.length === 0) { - return; - } - }); - sliceType = $sliceType($Uint8); - ptrType$1 = $ptrType(rngReader); - init = function() { - var $ptr; - $pkg.Reader = new rngReader.ptr(); - }; - rngReader.ptr.prototype.Read = function(b) { - var $ptr, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, array, b, crypto, err, n, offset, r, randomBytes, require; - n = 0; - err = $ifaceNil; - r = this; - array = b.$array; - offset = $parseInt(b.$offset) >> 0; - crypto = $global.crypto; - if (crypto === undefined) { - crypto = $global.msCrypto; - } - if (!(crypto === undefined)) { - if (!(crypto.getRandomValues === undefined)) { - n = b.$length; - if (n > 65536) { - n = 65536; - } - crypto.getRandomValues(array.subarray(offset, offset + n >> 0)); - _tmp = n; - _tmp$1 = $ifaceNil; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - } - require = $global.require; - if (!(require === undefined)) { - randomBytes = require($externalize("crypto", $String)).randomBytes; - if (!(randomBytes === undefined)) { - array.set(randomBytes(b.$length), offset); - _tmp$2 = b.$length; - _tmp$3 = $ifaceNil; - n = _tmp$2; - err = _tmp$3; - return [n, err]; - } - } - _tmp$4 = 0; - _tmp$5 = errors.New("crypto/rand not available in this environment"); - n = _tmp$4; - err = _tmp$5; - return [n, err]; - }; - rngReader.prototype.Read = function(b) { return this.$val.Read(b); }; - Read = function(b) { - var $ptr, _r, _tuple, b, err, n, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; b = $f.b; err = $f.err; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - _r = io.ReadFull($pkg.Reader, b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - n = _tuple[0]; - err = _tuple[1]; - /* */ $s = 2; case 2: - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Read }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.b = b; $f.err = err; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Read = Read; - ptrType$1.methods = [{prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]; - rngReader.init([]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = js.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = big.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $pkg.Reader = $ifaceNil; - smallPrimesProduct = new big.Int.ptr(false, big.nat.nil).SetUint64(new $Uint64(3793877372, 820596253)); - init(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["hash"] = (function() { - var $pkg = {}, $init, io, Hash, sliceType; - io = $packages["io"]; - Hash = $pkg.Hash = $newType(8, $kindInterface, "hash.Hash", "Hash", "hash", null); - sliceType = $sliceType($Uint8); - Hash.init([{prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType], [sliceType], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = io.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["crypto"] = (function() { - var $pkg = {}, $init, hash, io, strconv, funcType, sliceType$1, hashes, RegisterHash; - hash = $packages["hash"]; - io = $packages["io"]; - strconv = $packages["strconv"]; - funcType = $funcType([], [hash.Hash], false); - sliceType$1 = $sliceType(funcType); - RegisterHash = function(h, f) { - var $ptr, f, h; - if (h >= 16) { - $panic(new $String("crypto: RegisterHash of unknown hash function")); - } - ((h < 0 || h >= hashes.$length) ? $throwRuntimeError("index out of range") : hashes.$array[hashes.$offset + h] = f); - }; - $pkg.RegisterHash = RegisterHash; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = hash.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strconv.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - hashes = $makeSlice(sliceType$1, 16); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["crypto/sha256"] = (function() { - var $pkg = {}, $init, crypto, hash, digest, sliceType, arrayType, arrayType$1, sliceType$1, arrayType$2, arrayType$4, ptrType, _K, init, New, New224, Sum256, block; - crypto = $packages["crypto"]; - hash = $packages["hash"]; - digest = $pkg.digest = $newType(0, $kindStruct, "sha256.digest", "digest", "crypto/sha256", function(h_, x_, nx_, len_, is224_) { - this.$val = this; - if (arguments.length === 0) { - this.h = arrayType.zero(); - this.x = arrayType$1.zero(); - this.nx = 0; - this.len = new $Uint64(0, 0); - this.is224 = false; - return; - } - this.h = h_; - this.x = x_; - this.nx = nx_; - this.len = len_; - this.is224 = is224_; - }); - sliceType = $sliceType($Uint32); - arrayType = $arrayType($Uint32, 8); - arrayType$1 = $arrayType($Uint8, 64); - sliceType$1 = $sliceType($Uint8); - arrayType$2 = $arrayType($Uint8, 32); - arrayType$4 = $arrayType($Uint32, 64); - ptrType = $ptrType(digest); - init = function() { - var $ptr; - crypto.RegisterHash(4, New224); - crypto.RegisterHash(5, New); - }; - digest.ptr.prototype.Reset = function() { - var $ptr, d; - d = this; - if (!d.is224) { - d.h[0] = 1779033703; - d.h[1] = 3144134277; - d.h[2] = 1013904242; - d.h[3] = 2773480762; - d.h[4] = 1359893119; - d.h[5] = 2600822924; - d.h[6] = 528734635; - d.h[7] = 1541459225; - } else { - d.h[0] = 3238371032; - d.h[1] = 914150663; - d.h[2] = 812702999; - d.h[3] = 4144912697; - d.h[4] = 4290775857; - d.h[5] = 1750603025; - d.h[6] = 1694076839; - d.h[7] = 3204075428; - } - d.nx = 0; - d.len = new $Uint64(0, 0); - }; - digest.prototype.Reset = function() { return this.$val.Reset(); }; - New = function() { - var $ptr, d; - d = new digest.ptr(arrayType.zero(), arrayType$1.zero(), 0, new $Uint64(0, 0), false); - d.Reset(); - return d; - }; - $pkg.New = New; - New224 = function() { - var $ptr, d; - d = new digest.ptr(arrayType.zero(), arrayType$1.zero(), 0, new $Uint64(0, 0), false); - d.is224 = true; - d.Reset(); - return d; - }; - $pkg.New224 = New224; - digest.ptr.prototype.Size = function() { - var $ptr, d; - d = this; - if (!d.is224) { - return 32; - } - return 28; - }; - digest.prototype.Size = function() { return this.$val.Size(); }; - digest.ptr.prototype.BlockSize = function() { - var $ptr, d; - d = this; - return 64; - }; - digest.prototype.BlockSize = function() { return this.$val.BlockSize(); }; - digest.ptr.prototype.Write = function(p) { - var $ptr, d, err, n, n$1, nn, p, x, x$1; - nn = 0; - err = $ifaceNil; - d = this; - nn = p.$length; - d.len = (x = d.len, x$1 = new $Uint64(0, nn), new $Uint64(x.$high + x$1.$high, x.$low + x$1.$low)); - if (d.nx > 0) { - n = $copySlice($subslice(new sliceType$1(d.x), d.nx), p); - d.nx = d.nx + (n) >> 0; - if (d.nx === 64) { - block(d, new sliceType$1(d.x)); - d.nx = 0; - } - p = $subslice(p, n); - } - if (p.$length >= 64) { - n$1 = (p.$length & ~63) >> 0; - block(d, $subslice(p, 0, n$1)); - p = $subslice(p, n$1); - } - if (p.$length > 0) { - d.nx = $copySlice(new sliceType$1(d.x), p); - } - return [nn, err]; - }; - digest.prototype.Write = function(p) { return this.$val.Write(p); }; - digest.ptr.prototype.Sum = function(in$1) { - var $ptr, d, d0, hash$1, in$1; - d0 = this; - d = $clone(d0, digest); - hash$1 = $clone(d.checkSum(), arrayType$2); - if (d.is224) { - return $appendSlice(in$1, $subslice(new sliceType$1(hash$1), 0, 28)); - } - return $appendSlice(in$1, new sliceType$1(hash$1)); - }; - digest.prototype.Sum = function(in$1) { return this.$val.Sum(in$1); }; - digest.ptr.prototype.checkSum = function() { - var $ptr, _i, _ref, d, digest$1, h, i, i$1, len, s, tmp, x, x$1, x$2, x$3, x$4, x$5, x$6; - d = this; - len = d.len; - tmp = arrayType$1.zero(); - tmp[0] = 128; - if ((x = $div64(len, new $Uint64(0, 64), true), (x.$high < 0 || (x.$high === 0 && x.$low < 56)))) { - d.Write($subslice(new sliceType$1(tmp), 0, $flatten64((x$1 = $div64(len, new $Uint64(0, 64), true), new $Uint64(0 - x$1.$high, 56 - x$1.$low))))); - } else { - d.Write($subslice(new sliceType$1(tmp), 0, $flatten64((x$2 = $div64(len, new $Uint64(0, 64), true), new $Uint64(0 - x$2.$high, 120 - x$2.$low))))); - } - len = $shiftLeft64(len, (3)); - i = 0; - while (true) { - if (!(i < 8)) { break; } - ((i < 0 || i >= tmp.length) ? $throwRuntimeError("index out of range") : tmp[i] = ($shiftRightUint64(len, ((56 - (8 * i >>> 0) >>> 0))).$low << 24 >>> 24)); - i = i + (1) >>> 0; - } - d.Write($subslice(new sliceType$1(tmp), 0, 8)); - if (!((d.nx === 0))) { - $panic(new $String("d.nx != 0")); - } - h = new sliceType(d.h); - if (d.is224) { - h = $subslice(new sliceType(d.h), 0, 7); - } - digest$1 = arrayType$2.zero(); - _ref = h; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i$1 = _i; - s = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - (x$3 = $imul(i$1, 4), ((x$3 < 0 || x$3 >= digest$1.length) ? $throwRuntimeError("index out of range") : digest$1[x$3] = ((s >>> 24 >>> 0) << 24 >>> 24))); - (x$4 = ($imul(i$1, 4)) + 1 >> 0, ((x$4 < 0 || x$4 >= digest$1.length) ? $throwRuntimeError("index out of range") : digest$1[x$4] = ((s >>> 16 >>> 0) << 24 >>> 24))); - (x$5 = ($imul(i$1, 4)) + 2 >> 0, ((x$5 < 0 || x$5 >= digest$1.length) ? $throwRuntimeError("index out of range") : digest$1[x$5] = ((s >>> 8 >>> 0) << 24 >>> 24))); - (x$6 = ($imul(i$1, 4)) + 3 >> 0, ((x$6 < 0 || x$6 >= digest$1.length) ? $throwRuntimeError("index out of range") : digest$1[x$6] = (s << 24 >>> 24))); - _i++; - } - return digest$1; - }; - digest.prototype.checkSum = function() { return this.$val.checkSum(); }; - Sum256 = function(data) { - var $ptr, d, data; - d = new digest.ptr(arrayType.zero(), arrayType$1.zero(), 0, new $Uint64(0, 0), false); - d.Reset(); - d.Write(data); - return d.checkSum(); - }; - $pkg.Sum256 = Sum256; - block = function(dig, p) { - var $ptr, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, a, b, c, d, dig, e, f, g, h, h0, h1, h2, h3, h4, h5, h6, h7, i, i$1, i$2, j, p, t1, t1$1, t2, t2$1, v1, v2, w, x, x$1, x$2, x$3, x$4, x$5, x$6; - w = arrayType$4.zero(); - _tmp = dig.h[0]; - _tmp$1 = dig.h[1]; - _tmp$2 = dig.h[2]; - _tmp$3 = dig.h[3]; - _tmp$4 = dig.h[4]; - _tmp$5 = dig.h[5]; - _tmp$6 = dig.h[6]; - _tmp$7 = dig.h[7]; - h0 = _tmp; - h1 = _tmp$1; - h2 = _tmp$2; - h3 = _tmp$3; - h4 = _tmp$4; - h5 = _tmp$5; - h6 = _tmp$6; - h7 = _tmp$7; - while (true) { - if (!(p.$length >= 64)) { break; } - i = 0; - while (true) { - if (!(i < 16)) { break; } - j = $imul(i, 4); - ((i < 0 || i >= w.length) ? $throwRuntimeError("index out of range") : w[i] = ((((((((((j < 0 || j >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + j]) >>> 0) << 24 >>> 0) | (((x = j + 1 >> 0, ((x < 0 || x >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x])) >>> 0) << 16 >>> 0)) >>> 0) | (((x$1 = j + 2 >> 0, ((x$1 < 0 || x$1 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x$1])) >>> 0) << 8 >>> 0)) >>> 0) | ((x$2 = j + 3 >> 0, ((x$2 < 0 || x$2 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + x$2])) >>> 0)) >>> 0)); - i = i + (1) >> 0; - } - i$1 = 16; - while (true) { - if (!(i$1 < 64)) { break; } - v1 = (x$3 = i$1 - 2 >> 0, ((x$3 < 0 || x$3 >= w.length) ? $throwRuntimeError("index out of range") : w[x$3])); - t1 = (((((((v1 >>> 17 >>> 0) | (v1 << 15 >>> 0)) >>> 0)) ^ ((((v1 >>> 19 >>> 0) | (v1 << 13 >>> 0)) >>> 0))) >>> 0) ^ ((v1 >>> 10 >>> 0))) >>> 0; - v2 = (x$4 = i$1 - 15 >> 0, ((x$4 < 0 || x$4 >= w.length) ? $throwRuntimeError("index out of range") : w[x$4])); - t2 = (((((((v2 >>> 7 >>> 0) | (v2 << 25 >>> 0)) >>> 0)) ^ ((((v2 >>> 18 >>> 0) | (v2 << 14 >>> 0)) >>> 0))) >>> 0) ^ ((v2 >>> 3 >>> 0))) >>> 0; - ((i$1 < 0 || i$1 >= w.length) ? $throwRuntimeError("index out of range") : w[i$1] = (((t1 + (x$5 = i$1 - 7 >> 0, ((x$5 < 0 || x$5 >= w.length) ? $throwRuntimeError("index out of range") : w[x$5])) >>> 0) + t2 >>> 0) + (x$6 = i$1 - 16 >> 0, ((x$6 < 0 || x$6 >= w.length) ? $throwRuntimeError("index out of range") : w[x$6])) >>> 0)); - i$1 = i$1 + (1) >> 0; - } - _tmp$8 = h0; - _tmp$9 = h1; - _tmp$10 = h2; - _tmp$11 = h3; - _tmp$12 = h4; - _tmp$13 = h5; - _tmp$14 = h6; - _tmp$15 = h7; - a = _tmp$8; - b = _tmp$9; - c = _tmp$10; - d = _tmp$11; - e = _tmp$12; - f = _tmp$13; - g = _tmp$14; - h = _tmp$15; - i$2 = 0; - while (true) { - if (!(i$2 < 64)) { break; } - t1$1 = (((h + (((((((((e >>> 6 >>> 0) | (e << 26 >>> 0)) >>> 0)) ^ ((((e >>> 11 >>> 0) | (e << 21 >>> 0)) >>> 0))) >>> 0) ^ ((((e >>> 25 >>> 0) | (e << 7 >>> 0)) >>> 0))) >>> 0)) >>> 0) + ((((((e & f) >>> 0)) ^ ((((~e >>> 0) & g) >>> 0))) >>> 0)) >>> 0) + ((i$2 < 0 || i$2 >= _K.$length) ? $throwRuntimeError("index out of range") : _K.$array[_K.$offset + i$2]) >>> 0) + ((i$2 < 0 || i$2 >= w.length) ? $throwRuntimeError("index out of range") : w[i$2]) >>> 0; - t2$1 = (((((((((a >>> 2 >>> 0) | (a << 30 >>> 0)) >>> 0)) ^ ((((a >>> 13 >>> 0) | (a << 19 >>> 0)) >>> 0))) >>> 0) ^ ((((a >>> 22 >>> 0) | (a << 10 >>> 0)) >>> 0))) >>> 0)) + ((((((((a & b) >>> 0)) ^ (((a & c) >>> 0))) >>> 0) ^ (((b & c) >>> 0))) >>> 0)) >>> 0; - h = g; - g = f; - f = e; - e = d + t1$1 >>> 0; - d = c; - c = b; - b = a; - a = t1$1 + t2$1 >>> 0; - i$2 = i$2 + (1) >> 0; - } - h0 = h0 + (a) >>> 0; - h1 = h1 + (b) >>> 0; - h2 = h2 + (c) >>> 0; - h3 = h3 + (d) >>> 0; - h4 = h4 + (e) >>> 0; - h5 = h5 + (f) >>> 0; - h6 = h6 + (g) >>> 0; - h7 = h7 + (h) >>> 0; - p = $subslice(p, 64); - } - _tmp$16 = h0; - _tmp$17 = h1; - _tmp$18 = h2; - _tmp$19 = h3; - _tmp$20 = h4; - _tmp$21 = h5; - _tmp$22 = h6; - _tmp$23 = h7; - dig.h[0] = _tmp$16; - dig.h[1] = _tmp$17; - dig.h[2] = _tmp$18; - dig.h[3] = _tmp$19; - dig.h[4] = _tmp$20; - dig.h[5] = _tmp$21; - dig.h[6] = _tmp$22; - dig.h[7] = _tmp$23; - }; - ptrType.methods = [{prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}, {prop: "Size", name: "Size", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "BlockSize", name: "BlockSize", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$Int, $error], false)}, {prop: "Sum", name: "Sum", pkg: "", typ: $funcType([sliceType$1], [sliceType$1], false)}, {prop: "checkSum", name: "checkSum", pkg: "crypto/sha256", typ: $funcType([], [arrayType$2], false)}]; - digest.init([{prop: "h", name: "h", pkg: "crypto/sha256", typ: arrayType, tag: ""}, {prop: "x", name: "x", pkg: "crypto/sha256", typ: arrayType$1, tag: ""}, {prop: "nx", name: "nx", pkg: "crypto/sha256", typ: $Int, tag: ""}, {prop: "len", name: "len", pkg: "crypto/sha256", typ: $Uint64, tag: ""}, {prop: "is224", name: "is224", pkg: "crypto/sha256", typ: $Bool, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = crypto.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = hash.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _K = new sliceType([1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298]); - init(); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["encoding/base64"] = (function() { - var $pkg = {}, $init, io, strconv, Encoding, encoder, CorruptInputError, arrayType, arrayType$1, sliceType, ptrType, arrayType$2, arrayType$3, arrayType$4, ptrType$1, NewEncoding, NewEncoder; - io = $packages["io"]; - strconv = $packages["strconv"]; - Encoding = $pkg.Encoding = $newType(0, $kindStruct, "base64.Encoding", "Encoding", "encoding/base64", function(encode_, decodeMap_, padChar_) { - this.$val = this; - if (arguments.length === 0) { - this.encode = arrayType.zero(); - this.decodeMap = arrayType$1.zero(); - this.padChar = 0; - return; - } - this.encode = encode_; - this.decodeMap = decodeMap_; - this.padChar = padChar_; - }); - encoder = $pkg.encoder = $newType(0, $kindStruct, "base64.encoder", "encoder", "encoding/base64", function(err_, enc_, w_, buf_, nbuf_, out_) { - this.$val = this; - if (arguments.length === 0) { - this.err = $ifaceNil; - this.enc = ptrType.nil; - this.w = $ifaceNil; - this.buf = arrayType$2.zero(); - this.nbuf = 0; - this.out = arrayType$3.zero(); - return; - } - this.err = err_; - this.enc = enc_; - this.w = w_; - this.buf = buf_; - this.nbuf = nbuf_; - this.out = out_; - }); - CorruptInputError = $pkg.CorruptInputError = $newType(8, $kindInt64, "base64.CorruptInputError", "CorruptInputError", "encoding/base64", null); - arrayType = $arrayType($Uint8, 64); - arrayType$1 = $arrayType($Uint8, 256); - sliceType = $sliceType($Uint8); - ptrType = $ptrType(Encoding); - arrayType$2 = $arrayType($Uint8, 3); - arrayType$3 = $arrayType($Uint8, 1024); - arrayType$4 = $arrayType($Uint8, 4); - ptrType$1 = $ptrType(encoder); - NewEncoding = function(encoder$1) { - var $ptr, e, encoder$1, i, i$1, x, x$1, x$2; - if (!((encoder$1.length === 64))) { - $panic(new $String("encoding alphabet is not 64-bytes long")); - } - e = new Encoding.ptr(arrayType.zero(), arrayType$1.zero(), 0); - e.padChar = 61; - $copyString(new sliceType(e.encode), encoder$1); - i = 0; - while (true) { - if (!(i < 256)) { break; } - (x = e.decodeMap, ((i < 0 || i >= x.length) ? $throwRuntimeError("index out of range") : x[i] = 255)); - i = i + (1) >> 0; - } - i$1 = 0; - while (true) { - if (!(i$1 < encoder$1.length)) { break; } - (x$1 = e.decodeMap, x$2 = encoder$1.charCodeAt(i$1), ((x$2 < 0 || x$2 >= x$1.length) ? $throwRuntimeError("index out of range") : x$1[x$2] = (i$1 << 24 >>> 24))); - i$1 = i$1 + (1) >> 0; - } - return e; - }; - $pkg.NewEncoding = NewEncoding; - Encoding.ptr.prototype.WithPadding = function(padding) { - var $ptr, enc, padding; - enc = $clone(this, Encoding); - enc.padChar = padding; - return enc; - }; - Encoding.prototype.WithPadding = function(padding) { return this.$val.WithPadding(padding); }; - Encoding.ptr.prototype.Encode = function(dst, src) { - var $ptr, _1, _q, _tmp, _tmp$1, di, dst, enc, n, remain, si, src, val, val$1, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$22, x$23, x$24, x$25, x$26, x$27, x$28, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - enc = this; - if (src.$length === 0) { - return; - } - _tmp = 0; - _tmp$1 = 0; - di = _tmp; - si = _tmp$1; - n = $imul(((_q = src.$length / 3, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"))), 3); - while (true) { - if (!(si < n)) { break; } - val = ((((((x = si + 0 >> 0, ((x < 0 || x >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x])) >>> 0) << 16 >>> 0) | (((x$1 = si + 1 >> 0, ((x$1 < 0 || x$1 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$1])) >>> 0) << 8 >>> 0)) >>> 0) | ((x$2 = si + 2 >> 0, ((x$2 < 0 || x$2 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$2])) >>> 0)) >>> 0; - (x$5 = di + 0 >> 0, ((x$5 < 0 || x$5 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$5] = (x$3 = enc.encode, x$4 = ((val >>> 18 >>> 0) & 63) >>> 0, ((x$4 < 0 || x$4 >= x$3.length) ? $throwRuntimeError("index out of range") : x$3[x$4])))); - (x$8 = di + 1 >> 0, ((x$8 < 0 || x$8 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$8] = (x$6 = enc.encode, x$7 = ((val >>> 12 >>> 0) & 63) >>> 0, ((x$7 < 0 || x$7 >= x$6.length) ? $throwRuntimeError("index out of range") : x$6[x$7])))); - (x$11 = di + 2 >> 0, ((x$11 < 0 || x$11 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$11] = (x$9 = enc.encode, x$10 = ((val >>> 6 >>> 0) & 63) >>> 0, ((x$10 < 0 || x$10 >= x$9.length) ? $throwRuntimeError("index out of range") : x$9[x$10])))); - (x$14 = di + 3 >> 0, ((x$14 < 0 || x$14 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$14] = (x$12 = enc.encode, x$13 = (val & 63) >>> 0, ((x$13 < 0 || x$13 >= x$12.length) ? $throwRuntimeError("index out of range") : x$12[x$13])))); - si = si + (3) >> 0; - di = di + (4) >> 0; - } - remain = src.$length - si >> 0; - if (remain === 0) { - return; - } - val$1 = ((x$15 = si + 0 >> 0, ((x$15 < 0 || x$15 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$15])) >>> 0) << 16 >>> 0; - if (remain === 2) { - val$1 = (val$1 | ((((x$16 = si + 1 >> 0, ((x$16 < 0 || x$16 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$16])) >>> 0) << 8 >>> 0))) >>> 0; - } - (x$19 = di + 0 >> 0, ((x$19 < 0 || x$19 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$19] = (x$17 = enc.encode, x$18 = ((val$1 >>> 18 >>> 0) & 63) >>> 0, ((x$18 < 0 || x$18 >= x$17.length) ? $throwRuntimeError("index out of range") : x$17[x$18])))); - (x$22 = di + 1 >> 0, ((x$22 < 0 || x$22 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$22] = (x$20 = enc.encode, x$21 = ((val$1 >>> 12 >>> 0) & 63) >>> 0, ((x$21 < 0 || x$21 >= x$20.length) ? $throwRuntimeError("index out of range") : x$20[x$21])))); - _1 = remain; - if (_1 === (2)) { - (x$25 = di + 2 >> 0, ((x$25 < 0 || x$25 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$25] = (x$23 = enc.encode, x$24 = ((val$1 >>> 6 >>> 0) & 63) >>> 0, ((x$24 < 0 || x$24 >= x$23.length) ? $throwRuntimeError("index out of range") : x$23[x$24])))); - if (!((enc.padChar === -1))) { - (x$26 = di + 3 >> 0, ((x$26 < 0 || x$26 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$26] = (enc.padChar << 24 >>> 24))); - } - } else if (_1 === (1)) { - if (!((enc.padChar === -1))) { - (x$27 = di + 2 >> 0, ((x$27 < 0 || x$27 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$27] = (enc.padChar << 24 >>> 24))); - (x$28 = di + 3 >> 0, ((x$28 < 0 || x$28 >= dst.$length) ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + x$28] = (enc.padChar << 24 >>> 24))); - } - } - }; - Encoding.prototype.Encode = function(dst, src) { return this.$val.Encode(dst, src); }; - Encoding.ptr.prototype.EncodeToString = function(src) { - var $ptr, buf, enc, src; - enc = this; - buf = $makeSlice(sliceType, enc.EncodedLen(src.$length)); - enc.Encode(buf, src); - return $bytesToString(buf); - }; - Encoding.prototype.EncodeToString = function(src) { return this.$val.EncodeToString(src); }; - encoder.ptr.prototype.Write = function(p) { - var $ptr, _q, _r, _r$1, _r$2, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, e, err, i, i$1, n, nn, p, x, x$1, x$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; e = $f.e; err = $f.err; i = $f.i; i$1 = $f.i$1; n = $f.n; nn = $f.nn; p = $f.p; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - n = 0; - err = $ifaceNil; - e = this; - if (!($interfaceIsEqual(e.err, $ifaceNil))) { - _tmp = 0; - _tmp$1 = e.err; - n = _tmp; - err = _tmp$1; - return [n, err]; - } - /* */ if (e.nbuf > 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (e.nbuf > 0) { */ case 1: - i = 0; - i = 0; - while (true) { - if (!(i < p.$length && e.nbuf < 3)) { break; } - (x = e.buf, x$1 = e.nbuf, ((x$1 < 0 || x$1 >= x.length) ? $throwRuntimeError("index out of range") : x[x$1] = ((i < 0 || i >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i]))); - e.nbuf = e.nbuf + (1) >> 0; - i = i + (1) >> 0; - } - n = n + (i) >> 0; - p = $subslice(p, i); - if (e.nbuf < 3) { - return [n, err]; - } - e.enc.Encode(new sliceType(e.out), new sliceType(e.buf)); - _r = e.w.Write($subslice(new sliceType(e.out), 0, 4)); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - e.err = _tuple[1]; - if (!($interfaceIsEqual(e.err, $ifaceNil))) { - _tmp$2 = n; - _tmp$3 = e.err; - n = _tmp$2; - err = _tmp$3; - return [n, err]; - } - e.nbuf = 0; - /* } */ case 2: - /* while (true) { */ case 4: - /* if (!(p.$length >= 3)) { break; } */ if(!(p.$length >= 3)) { $s = 5; continue; } - nn = 768; - if (nn > p.$length) { - nn = p.$length; - nn = nn - ((_r$1 = nn % 3, _r$1 === _r$1 ? _r$1 : $throwRuntimeError("integer divide by zero"))) >> 0; - } - e.enc.Encode(new sliceType(e.out), $subslice(p, 0, nn)); - _r$2 = e.w.Write($subslice(new sliceType(e.out), 0, ($imul((_q = nn / 3, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")), 4)))); /* */ $s = 6; case 6: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _tuple$1 = _r$2; - e.err = _tuple$1[1]; - if (!($interfaceIsEqual(e.err, $ifaceNil))) { - _tmp$4 = n; - _tmp$5 = e.err; - n = _tmp$4; - err = _tmp$5; - return [n, err]; - } - n = n + (nn) >> 0; - p = $subslice(p, nn); - /* } */ $s = 4; continue; case 5: - i$1 = 0; - while (true) { - if (!(i$1 < p.$length)) { break; } - (x$2 = e.buf, ((i$1 < 0 || i$1 >= x$2.length) ? $throwRuntimeError("index out of range") : x$2[i$1] = ((i$1 < 0 || i$1 >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i$1]))); - i$1 = i$1 + (1) >> 0; - } - e.nbuf = p.$length; - n = n + (p.$length) >> 0; - return [n, err]; - /* */ } return; } if ($f === undefined) { $f = { $blk: encoder.ptr.prototype.Write }; } $f.$ptr = $ptr; $f._q = _q; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.e = e; $f.err = err; $f.i = i; $f.i$1 = i$1; $f.n = n; $f.nn = nn; $f.p = p; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; - }; - encoder.prototype.Write = function(p) { return this.$val.Write(p); }; - encoder.ptr.prototype.Close = function() { - var $ptr, _r, _tuple, e, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _tuple = $f._tuple; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - /* */ if ($interfaceIsEqual(e.err, $ifaceNil) && e.nbuf > 0) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if ($interfaceIsEqual(e.err, $ifaceNil) && e.nbuf > 0) { */ case 1: - e.enc.Encode(new sliceType(e.out), $subslice(new sliceType(e.buf), 0, e.nbuf)); - _r = e.w.Write($subslice(new sliceType(e.out), 0, e.enc.EncodedLen(e.nbuf))); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - e.err = _tuple[1]; - e.nbuf = 0; - /* } */ case 2: - return e.err; - /* */ } return; } if ($f === undefined) { $f = { $blk: encoder.ptr.prototype.Close }; } $f.$ptr = $ptr; $f._r = _r; $f._tuple = _tuple; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; - }; - encoder.prototype.Close = function() { return this.$val.Close(); }; - NewEncoder = function(enc, w) { - var $ptr, enc, w; - return new encoder.ptr($ifaceNil, enc, w, arrayType$2.zero(), 0, arrayType$3.zero()); - }; - $pkg.NewEncoder = NewEncoder; - Encoding.ptr.prototype.EncodedLen = function(n) { - var $ptr, _q, _q$1, enc, n; - enc = this; - if (enc.padChar === -1) { - return (_q = ((($imul(n, 8)) + 5 >> 0)) / 6, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - } - return $imul((_q$1 = ((n + 2 >> 0)) / 3, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), 4); - }; - Encoding.prototype.EncodedLen = function(n) { return this.$val.EncodedLen(n); }; - CorruptInputError.prototype.Error = function() { - var $ptr, e; - e = this; - return "illegal base64 data at input byte " + strconv.FormatInt(new $Int64(e.$high, e.$low), 10); - }; - $ptrType(CorruptInputError).prototype.Error = function() { return this.$get().Error(); }; - Encoding.ptr.prototype.decode = function(dst, src) { - var $ptr, _2, _3, _i, _ref, _tmp, _tmp$1, _tmp$10, _tmp$11, _tmp$12, _tmp$13, _tmp$14, _tmp$15, _tmp$16, _tmp$17, _tmp$18, _tmp$19, _tmp$2, _tmp$20, _tmp$21, _tmp$22, _tmp$23, _tmp$24, _tmp$25, _tmp$3, _tmp$4, _tmp$5, _tmp$6, _tmp$7, _tmp$8, _tmp$9, dbuf, dinc, dlen, dst, enc, end, err, in$1, j, n, si, src, val, x; - n = 0; - end = false; - err = $ifaceNil; - enc = this; - si = 0; - while (true) { - if (!(si < src.$length && ((((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 10) || (((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 13)))) { break; } - si = si + (1) >> 0; - } - while (true) { - if (!(si < src.$length && !end)) { break; } - dbuf = arrayType$4.zero(); - _tmp = 3; - _tmp$1 = 4; - dinc = _tmp; - dlen = _tmp$1; - _ref = dbuf; - _i = 0; - while (true) { - if (!(_i < 4)) { break; } - j = _i; - if (src.$length === si) { - if (!((enc.padChar === -1)) || j < 2) { - _tmp$2 = n; - _tmp$3 = false; - _tmp$4 = new CorruptInputError(0, (si - j >> 0)); - n = _tmp$2; - end = _tmp$3; - err = _tmp$4; - return [n, end, err]; - } - _tmp$5 = j - 1 >> 0; - _tmp$6 = j; - _tmp$7 = true; - dinc = _tmp$5; - dlen = _tmp$6; - end = _tmp$7; - break; - } - in$1 = ((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]); - si = si + (1) >> 0; - while (true) { - if (!(si < src.$length && ((((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 10) || (((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 13)))) { break; } - si = si + (1) >> 0; - } - if ((in$1 >> 0) === enc.padChar) { - _2 = j; - if ((_2 === (0)) || (_2 === (1))) { - _tmp$8 = n; - _tmp$9 = false; - _tmp$10 = new CorruptInputError(0, (si - 1 >> 0)); - n = _tmp$8; - end = _tmp$9; - err = _tmp$10; - return [n, end, err]; - } else if (_2 === (2)) { - if (si === src.$length) { - _tmp$11 = n; - _tmp$12 = false; - _tmp$13 = new CorruptInputError(0, src.$length); - n = _tmp$11; - end = _tmp$12; - err = _tmp$13; - return [n, end, err]; - } - if (!(((((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) >> 0) === enc.padChar))) { - _tmp$14 = n; - _tmp$15 = false; - _tmp$16 = new CorruptInputError(0, (si - 1 >> 0)); - n = _tmp$14; - end = _tmp$15; - err = _tmp$16; - return [n, end, err]; - } - si = si + (1) >> 0; - while (true) { - if (!(si < src.$length && ((((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 10) || (((si < 0 || si >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + si]) === 13)))) { break; } - si = si + (1) >> 0; - } - } - if (si < src.$length) { - err = new CorruptInputError(0, si); - } - _tmp$17 = 3; - _tmp$18 = j; - _tmp$19 = true; - dinc = _tmp$17; - dlen = _tmp$18; - end = _tmp$19; - break; - } - ((j < 0 || j >= dbuf.length) ? $throwRuntimeError("index out of range") : dbuf[j] = (x = enc.decodeMap, ((in$1 < 0 || in$1 >= x.length) ? $throwRuntimeError("index out of range") : x[in$1]))); - if (((j < 0 || j >= dbuf.length) ? $throwRuntimeError("index out of range") : dbuf[j]) === 255) { - _tmp$20 = n; - _tmp$21 = false; - _tmp$22 = new CorruptInputError(0, (si - 1 >> 0)); - n = _tmp$20; - end = _tmp$21; - err = _tmp$22; - return [n, end, err]; - } - _i++; - } - val = (((((((dbuf[0] >>> 0) << 18 >>> 0) | ((dbuf[1] >>> 0) << 12 >>> 0)) >>> 0) | ((dbuf[2] >>> 0) << 6 >>> 0)) >>> 0) | (dbuf[3] >>> 0)) >>> 0; - _3 = dlen; - if (_3 === (4)) { - (2 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 2] = ((val >>> 0 >>> 0) << 24 >>> 24)); - (1 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 1] = ((val >>> 8 >>> 0) << 24 >>> 24)); - (0 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 0] = ((val >>> 16 >>> 0) << 24 >>> 24)); - } else if (_3 === (3)) { - (1 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 1] = ((val >>> 8 >>> 0) << 24 >>> 24)); - (0 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 0] = ((val >>> 16 >>> 0) << 24 >>> 24)); - } else if (_3 === (2)) { - (0 >= dst.$length ? $throwRuntimeError("index out of range") : dst.$array[dst.$offset + 0] = ((val >>> 16 >>> 0) << 24 >>> 24)); - } - dst = $subslice(dst, dinc); - n = n + ((dlen - 1 >> 0)) >> 0; - } - _tmp$23 = n; - _tmp$24 = end; - _tmp$25 = err; - n = _tmp$23; - end = _tmp$24; - err = _tmp$25; - return [n, end, err]; - }; - Encoding.prototype.decode = function(dst, src) { return this.$val.decode(dst, src); }; - Encoding.ptr.prototype.Decode = function(dst, src) { - var $ptr, _tuple, dst, enc, err, n, src; - n = 0; - err = $ifaceNil; - enc = this; - _tuple = enc.decode(dst, src); - n = _tuple[0]; - err = _tuple[2]; - return [n, err]; - }; - Encoding.prototype.Decode = function(dst, src) { return this.$val.Decode(dst, src); }; - Encoding.ptr.prototype.DecodeString = function(s) { - var $ptr, _tuple, dbuf, enc, err, n, s; - enc = this; - dbuf = $makeSlice(sliceType, enc.DecodedLen(s.length)); - _tuple = enc.decode(dbuf, new sliceType($stringToBytes(s))); - n = _tuple[0]; - err = _tuple[2]; - return [$subslice(dbuf, 0, n), err]; - }; - Encoding.prototype.DecodeString = function(s) { return this.$val.DecodeString(s); }; - Encoding.ptr.prototype.DecodedLen = function(n) { - var $ptr, _q, _q$1, enc, n; - enc = this; - if (enc.padChar === -1) { - return (_q = ((($imul(n, 6)) + 7 >> 0)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - } - return $imul((_q$1 = n / 4, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")), 3); - }; - Encoding.prototype.DecodedLen = function(n) { return this.$val.DecodedLen(n); }; - Encoding.methods = [{prop: "WithPadding", name: "WithPadding", pkg: "", typ: $funcType([$Int32], [ptrType], false)}]; - ptrType.methods = [{prop: "Encode", name: "Encode", pkg: "", typ: $funcType([sliceType, sliceType], [], false)}, {prop: "EncodeToString", name: "EncodeToString", pkg: "", typ: $funcType([sliceType], [$String], false)}, {prop: "EncodedLen", name: "EncodedLen", pkg: "", typ: $funcType([$Int], [$Int], false)}, {prop: "decode", name: "decode", pkg: "encoding/base64", typ: $funcType([sliceType, sliceType], [$Int, $Bool, $error], false)}, {prop: "Decode", name: "Decode", pkg: "", typ: $funcType([sliceType, sliceType], [$Int, $error], false)}, {prop: "DecodeString", name: "DecodeString", pkg: "", typ: $funcType([$String], [sliceType, $error], false)}, {prop: "DecodedLen", name: "DecodedLen", pkg: "", typ: $funcType([$Int], [$Int], false)}]; - ptrType$1.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}]; - CorruptInputError.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - Encoding.init([{prop: "encode", name: "encode", pkg: "encoding/base64", typ: arrayType, tag: ""}, {prop: "decodeMap", name: "decodeMap", pkg: "encoding/base64", typ: arrayType$1, tag: ""}, {prop: "padChar", name: "padChar", pkg: "encoding/base64", typ: $Int32, tag: ""}]); - encoder.init([{prop: "err", name: "err", pkg: "encoding/base64", typ: $error, tag: ""}, {prop: "enc", name: "enc", pkg: "encoding/base64", typ: ptrType, tag: ""}, {prop: "w", name: "w", pkg: "encoding/base64", typ: io.Writer, tag: ""}, {prop: "buf", name: "buf", pkg: "encoding/base64", typ: arrayType$2, tag: ""}, {prop: "nbuf", name: "nbuf", pkg: "encoding/base64", typ: $Int, tag: ""}, {prop: "out", name: "out", pkg: "encoding/base64", typ: arrayType$3, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = io.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strconv.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $pkg.StdEncoding = NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"); - $pkg.URLEncoding = NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"); - $pkg.RawStdEncoding = $pkg.StdEncoding.WithPadding(-1); - $pkg.RawURLEncoding = $pkg.URLEncoding.WithPadding(-1); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["encoding"] = (function() { - var $pkg = {}, $init, TextMarshaler, sliceType; - TextMarshaler = $pkg.TextMarshaler = $newType(8, $kindInterface, "encoding.TextMarshaler", "TextMarshaler", "encoding", null); - sliceType = $sliceType($Uint8); - TextMarshaler.init([{prop: "MarshalText", name: "MarshalText", pkg: "", typ: $funcType([], [sliceType, $error], false)}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["sort"] = (function() { - var $pkg = {}, $init, StringSlice, sliceType$2, Search, SearchStrings, insertionSort, siftDown, heapSort, medianOfThree, doPivot, quickSort, Sort; - StringSlice = $pkg.StringSlice = $newType(12, $kindSlice, "sort.StringSlice", "StringSlice", "sort", null); - sliceType$2 = $sliceType($String); - Search = function(n, f) { - var $ptr, _q, _r, _tmp, _tmp$1, f, h, i, j, n, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _r = $f._r; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; f = $f.f; h = $f.h; i = $f.i; j = $f.j; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _tmp = 0; - _tmp$1 = n; - i = _tmp; - j = _tmp$1; - /* while (true) { */ case 1: - /* if (!(i < j)) { break; } */ if(!(i < j)) { $s = 2; continue; } - h = i + (_q = ((j - i >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - _r = f(h); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (!_r) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (!_r) { */ case 3: - i = h + 1 >> 0; - $s = 5; continue; - /* } else { */ case 4: - j = h; - /* } */ case 5: - /* } */ $s = 1; continue; case 2: - return i; - /* */ } return; } if ($f === undefined) { $f = { $blk: Search }; } $f.$ptr = $ptr; $f._q = _q; $f._r = _r; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f.f = f; $f.h = h; $f.i = i; $f.j = j; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Search = Search; - SearchStrings = function(a, x) { - var $ptr, _r, a, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; a = $f.a; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - a = [a]; - x = [x]; - _r = Search(a[0].$length, (function(a, x) { return function(i) { - var $ptr, i; - return ((i < 0 || i >= a[0].$length) ? $throwRuntimeError("index out of range") : a[0].$array[a[0].$offset + i]) >= x[0]; - }; })(a, x)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: SearchStrings }; } $f.$ptr = $ptr; $f._r = _r; $f.a = a; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.SearchStrings = SearchStrings; - StringSlice.prototype.Search = function(x) { - var $ptr, _r, p, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; p = $f.p; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - _r = SearchStrings($subslice(new sliceType$2(p.$array), p.$offset, p.$offset + p.$length), x); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: StringSlice.prototype.Search }; } $f.$ptr = $ptr; $f._r = _r; $f.p = p; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - $ptrType(StringSlice).prototype.Search = function(x) { return this.$get().Search(x); }; - insertionSort = function(data, a, b) { - var $ptr, _r, _v, a, b, data, i, j, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _v = $f._v; a = $f.a; b = $f.b; data = $f.data; i = $f.i; j = $f.j; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - i = a + 1 >> 0; - /* while (true) { */ case 1: - /* if (!(i < b)) { break; } */ if(!(i < b)) { $s = 2; continue; } - j = i; - /* while (true) { */ case 3: - if (!(j > a)) { _v = false; $s = 5; continue s; } - _r = data.Less(j, j - 1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _v = _r; case 5: - /* if (!(_v)) { break; } */ if(!(_v)) { $s = 4; continue; } - $r = data.Swap(j, j - 1 >> 0); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - j = j - (1) >> 0; - /* } */ $s = 3; continue; case 4: - i = i + (1) >> 0; - /* } */ $s = 1; continue; case 2: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: insertionSort }; } $f.$ptr = $ptr; $f._r = _r; $f._v = _v; $f.a = a; $f.b = b; $f.data = data; $f.i = i; $f.j = j; $f.$s = $s; $f.$r = $r; return $f; - }; - siftDown = function(data, lo, hi, first) { - var $ptr, _r, _r$1, _v, child, data, first, hi, lo, root, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _v = $f._v; child = $f.child; data = $f.data; first = $f.first; hi = $f.hi; lo = $f.lo; root = $f.root; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - root = lo; - /* while (true) { */ case 1: - child = ($imul(2, root)) + 1 >> 0; - if (child >= hi) { - /* break; */ $s = 2; continue; - } - if (!((child + 1 >> 0) < hi)) { _v = false; $s = 5; continue s; } - _r = data.Less(first + child >> 0, (first + child >> 0) + 1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _v = _r; case 5: - /* */ if (_v) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (_v) { */ case 3: - child = child + (1) >> 0; - /* } */ case 4: - _r$1 = data.Less(first + root >> 0, first + child >> 0); /* */ $s = 9; case 9: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ if (!_r$1) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (!_r$1) { */ case 7: - return; - /* } */ case 8: - $r = data.Swap(first + root >> 0, first + child >> 0); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - root = child; - /* } */ $s = 1; continue; case 2: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: siftDown }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._v = _v; $f.child = child; $f.data = data; $f.first = first; $f.hi = hi; $f.lo = lo; $f.root = root; $f.$s = $s; $f.$r = $r; return $f; - }; - heapSort = function(data, a, b) { - var $ptr, _q, a, b, data, first, hi, i, i$1, lo, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; a = $f.a; b = $f.b; data = $f.data; first = $f.first; hi = $f.hi; i = $f.i; i$1 = $f.i$1; lo = $f.lo; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - first = a; - lo = 0; - hi = b - a >> 0; - i = (_q = ((hi - 1 >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")); - /* while (true) { */ case 1: - /* if (!(i >= 0)) { break; } */ if(!(i >= 0)) { $s = 2; continue; } - $r = siftDown(data, i, hi, first); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - i = i - (1) >> 0; - /* } */ $s = 1; continue; case 2: - i$1 = hi - 1 >> 0; - /* while (true) { */ case 4: - /* if (!(i$1 >= 0)) { break; } */ if(!(i$1 >= 0)) { $s = 5; continue; } - $r = data.Swap(first, first + i$1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = siftDown(data, lo, i$1, first); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - i$1 = i$1 - (1) >> 0; - /* } */ $s = 4; continue; case 5: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: heapSort }; } $f.$ptr = $ptr; $f._q = _q; $f.a = a; $f.b = b; $f.data = data; $f.first = first; $f.hi = hi; $f.i = i; $f.i$1 = i$1; $f.lo = lo; $f.$s = $s; $f.$r = $r; return $f; - }; - medianOfThree = function(data, m1, m0, m2) { - var $ptr, _r, _r$1, _r$2, data, m0, m1, m2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; data = $f.data; m0 = $f.m0; m1 = $f.m1; m2 = $f.m2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = data.Less(m1, m0); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ if (_r) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (_r) { */ case 1: - $r = data.Swap(m1, m0); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 2: - _r$1 = data.Less(m2, m1); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ if (_r$1) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (_r$1) { */ case 5: - $r = data.Swap(m2, m1); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _r$2 = data.Less(m1, m0); /* */ $s = 11; case 11: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ if (_r$2) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (_r$2) { */ case 9: - $r = data.Swap(m1, m0); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 10: - /* } */ case 6: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: medianOfThree }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f.data = data; $f.m0 = m0; $f.m1 = m1; $f.m2 = m2; $f.$s = $s; $f.$r = $r; return $f; - }; - doPivot = function(data, lo, hi) { - var $ptr, _q, _q$1, _q$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tmp, _tmp$1, _tmp$2, _tmp$3, _v, _v$1, _v$2, _v$3, _v$4, a, b, c, data, dups, hi, lo, m, midhi, midlo, pivot, protect, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _q = $f._q; _q$1 = $f._q$1; _q$2 = $f._q$2; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _v = $f._v; _v$1 = $f._v$1; _v$2 = $f._v$2; _v$3 = $f._v$3; _v$4 = $f._v$4; a = $f.a; b = $f.b; c = $f.c; data = $f.data; dups = $f.dups; hi = $f.hi; lo = $f.lo; m = $f.m; midhi = $f.midhi; midlo = $f.midlo; pivot = $f.pivot; protect = $f.protect; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - midlo = 0; - midhi = 0; - m = lo + (_q = ((hi - lo >> 0)) / 2, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0; - /* */ if ((hi - lo >> 0) > 40) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if ((hi - lo >> 0) > 40) { */ case 1: - s = (_q$1 = ((hi - lo >> 0)) / 8, (_q$1 === _q$1 && _q$1 !== 1/0 && _q$1 !== -1/0) ? _q$1 >> 0 : $throwRuntimeError("integer divide by zero")); - $r = medianOfThree(data, lo, lo + s >> 0, lo + ($imul(2, s)) >> 0); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = medianOfThree(data, m, m - s >> 0, m + s >> 0); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = medianOfThree(data, hi - 1 >> 0, (hi - 1 >> 0) - s >> 0, (hi - 1 >> 0) - ($imul(2, s)) >> 0); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 2: - $r = medianOfThree(data, lo, m, hi - 1 >> 0); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - pivot = lo; - _tmp = lo + 1 >> 0; - _tmp$1 = hi - 1 >> 0; - a = _tmp; - c = _tmp$1; - /* while (true) { */ case 7: - if (!(!((a === c)))) { _v = false; $s = 9; continue s; } - _r = data.Less(a, pivot); /* */ $s = 10; case 10: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _v = _r; case 9: - /* if (!(_v)) { break; } */ if(!(_v)) { $s = 8; continue; } - a = a + (1) >> 0; - /* } */ $s = 7; continue; case 8: - b = a; - /* while (true) { */ case 11: - /* while (true) { */ case 13: - if (!(!((b === c)))) { _v$1 = false; $s = 15; continue s; } - _r$1 = data.Less(pivot, b); /* */ $s = 16; case 16: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _v$1 = !_r$1; case 15: - /* if (!(_v$1)) { break; } */ if(!(_v$1)) { $s = 14; continue; } - b = b + (1) >> 0; - /* } */ $s = 13; continue; case 14: - /* while (true) { */ case 17: - if (!(!((b === c)))) { _v$2 = false; $s = 19; continue s; } - _r$2 = data.Less(pivot, c - 1 >> 0); /* */ $s = 20; case 20: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _v$2 = _r$2; case 19: - /* if (!(_v$2)) { break; } */ if(!(_v$2)) { $s = 18; continue; } - c = c - (1) >> 0; - /* } */ $s = 17; continue; case 18: - if (b === c) { - /* break; */ $s = 12; continue; - } - $r = data.Swap(b, c - 1 >> 0); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - b = b + (1) >> 0; - c = c - (1) >> 0; - /* } */ $s = 11; continue; case 12: - protect = (hi - c >> 0) < 5; - /* */ if (!protect && (hi - c >> 0) < (_q$2 = ((hi - lo >> 0)) / 4, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero"))) { $s = 22; continue; } - /* */ $s = 23; continue; - /* if (!protect && (hi - c >> 0) < (_q$2 = ((hi - lo >> 0)) / 4, (_q$2 === _q$2 && _q$2 !== 1/0 && _q$2 !== -1/0) ? _q$2 >> 0 : $throwRuntimeError("integer divide by zero"))) { */ case 22: - dups = 0; - _r$3 = data.Less(pivot, hi - 1 >> 0); /* */ $s = 26; case 26: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (!_r$3) { $s = 24; continue; } - /* */ $s = 25; continue; - /* if (!_r$3) { */ case 24: - $r = data.Swap(c, hi - 1 >> 0); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - c = c + (1) >> 0; - dups = dups + (1) >> 0; - /* } */ case 25: - _r$4 = data.Less(b - 1 >> 0, pivot); /* */ $s = 30; case 30: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - /* */ if (!_r$4) { $s = 28; continue; } - /* */ $s = 29; continue; - /* if (!_r$4) { */ case 28: - b = b - (1) >> 0; - dups = dups + (1) >> 0; - /* } */ case 29: - _r$5 = data.Less(m, pivot); /* */ $s = 33; case 33: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - /* */ if (!_r$5) { $s = 31; continue; } - /* */ $s = 32; continue; - /* if (!_r$5) { */ case 31: - $r = data.Swap(m, b - 1 >> 0); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - b = b - (1) >> 0; - dups = dups + (1) >> 0; - /* } */ case 32: - protect = dups > 1; - /* } */ case 23: - /* */ if (protect) { $s = 35; continue; } - /* */ $s = 36; continue; - /* if (protect) { */ case 35: - /* while (true) { */ case 37: - /* while (true) { */ case 39: - if (!(!((a === b)))) { _v$3 = false; $s = 41; continue s; } - _r$6 = data.Less(b - 1 >> 0, pivot); /* */ $s = 42; case 42: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _v$3 = !_r$6; case 41: - /* if (!(_v$3)) { break; } */ if(!(_v$3)) { $s = 40; continue; } - b = b - (1) >> 0; - /* } */ $s = 39; continue; case 40: - /* while (true) { */ case 43: - if (!(!((a === b)))) { _v$4 = false; $s = 45; continue s; } - _r$7 = data.Less(a, pivot); /* */ $s = 46; case 46: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - _v$4 = _r$7; case 45: - /* if (!(_v$4)) { break; } */ if(!(_v$4)) { $s = 44; continue; } - a = a + (1) >> 0; - /* } */ $s = 43; continue; case 44: - if (a === b) { - /* break; */ $s = 38; continue; - } - $r = data.Swap(a, b - 1 >> 0); /* */ $s = 47; case 47: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - a = a + (1) >> 0; - b = b - (1) >> 0; - /* } */ $s = 37; continue; case 38: - /* } */ case 36: - $r = data.Swap(pivot, b - 1 >> 0); /* */ $s = 48; case 48: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _tmp$2 = b - 1 >> 0; - _tmp$3 = c; - midlo = _tmp$2; - midhi = _tmp$3; - return [midlo, midhi]; - /* */ } return; } if ($f === undefined) { $f = { $blk: doPivot }; } $f.$ptr = $ptr; $f._q = _q; $f._q$1 = _q$1; $f._q$2 = _q$2; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._v = _v; $f._v$1 = _v$1; $f._v$2 = _v$2; $f._v$3 = _v$3; $f._v$4 = _v$4; $f.a = a; $f.b = b; $f.c = c; $f.data = data; $f.dups = dups; $f.hi = hi; $f.lo = lo; $f.m = m; $f.midhi = midhi; $f.midlo = midlo; $f.pivot = pivot; $f.protect = protect; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - quickSort = function(data, a, b, maxDepth) { - var $ptr, _r, _r$1, _tuple, a, b, data, i, maxDepth, mhi, mlo, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; a = $f.a; b = $f.b; data = $f.data; i = $f.i; maxDepth = $f.maxDepth; mhi = $f.mhi; mlo = $f.mlo; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* while (true) { */ case 1: - /* if (!((b - a >> 0) > 12)) { break; } */ if(!((b - a >> 0) > 12)) { $s = 2; continue; } - /* */ if (maxDepth === 0) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (maxDepth === 0) { */ case 3: - $r = heapSort(data, a, b); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return; - /* } */ case 4: - maxDepth = maxDepth - (1) >> 0; - _r = doPivot(data, a, b); /* */ $s = 6; case 6: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - mlo = _tuple[0]; - mhi = _tuple[1]; - /* */ if ((mlo - a >> 0) < (b - mhi >> 0)) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if ((mlo - a >> 0) < (b - mhi >> 0)) { */ case 7: - $r = quickSort(data, a, mlo, maxDepth); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - a = mhi; - $s = 9; continue; - /* } else { */ case 8: - $r = quickSort(data, mhi, b, maxDepth); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - b = mlo; - /* } */ case 9: - /* } */ $s = 1; continue; case 2: - /* */ if ((b - a >> 0) > 1) { $s = 12; continue; } - /* */ $s = 13; continue; - /* if ((b - a >> 0) > 1) { */ case 12: - i = a + 6 >> 0; - /* while (true) { */ case 14: - /* if (!(i < b)) { break; } */ if(!(i < b)) { $s = 15; continue; } - _r$1 = data.Less(i, i - 6 >> 0); /* */ $s = 18; case 18: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ if (_r$1) { $s = 16; continue; } - /* */ $s = 17; continue; - /* if (_r$1) { */ case 16: - $r = data.Swap(i, i - 6 >> 0); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 17: - i = i + (1) >> 0; - /* } */ $s = 14; continue; case 15: - $r = insertionSort(data, a, b); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 13: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: quickSort }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.a = a; $f.b = b; $f.data = data; $f.i = i; $f.maxDepth = maxDepth; $f.mhi = mhi; $f.mlo = mlo; $f.$s = $s; $f.$r = $r; return $f; - }; - Sort = function(data) { - var $ptr, _r, data, i, maxDepth, n, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; data = $f.data; i = $f.i; maxDepth = $f.maxDepth; n = $f.n; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = data.Len(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - n = _r; - maxDepth = 0; - i = n; - while (true) { - if (!(i > 0)) { break; } - maxDepth = maxDepth + (1) >> 0; - i = (i >> $min((1), 31)) >> 0; - } - maxDepth = $imul(maxDepth, (2)); - $r = quickSort(data, 0, n, maxDepth); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: Sort }; } $f.$ptr = $ptr; $f._r = _r; $f.data = data; $f.i = i; $f.maxDepth = maxDepth; $f.n = n; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Sort = Sort; - StringSlice.prototype.Len = function() { - var $ptr, p; - p = this; - return p.$length; - }; - $ptrType(StringSlice).prototype.Len = function() { return this.$get().Len(); }; - StringSlice.prototype.Less = function(i, j) { - var $ptr, i, j, p; - p = this; - return ((i < 0 || i >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i]) < ((j < 0 || j >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + j]); - }; - $ptrType(StringSlice).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; - StringSlice.prototype.Swap = function(i, j) { - var $ptr, _tmp, _tmp$1, i, j, p; - p = this; - _tmp = ((j < 0 || j >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + j]); - _tmp$1 = ((i < 0 || i >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i]); - ((i < 0 || i >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + i] = _tmp); - ((j < 0 || j >= p.$length) ? $throwRuntimeError("index out of range") : p.$array[p.$offset + j] = _tmp$1); - }; - $ptrType(StringSlice).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; - StringSlice.prototype.Sort = function() { - var $ptr, p, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; p = $f.p; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - p = this; - $r = Sort(p); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: StringSlice.prototype.Sort }; } $f.$ptr = $ptr; $f.p = p; $f.$s = $s; $f.$r = $r; return $f; - }; - $ptrType(StringSlice).prototype.Sort = function() { return this.$get().Sort(); }; - StringSlice.methods = [{prop: "Search", name: "Search", pkg: "", typ: $funcType([$String], [$Int], false)}, {prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Less", name: "Less", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "Sort", name: "Sort", pkg: "", typ: $funcType([], [], false)}]; - StringSlice.init($String); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["flag"] = (function() { - var $pkg = {}, $init, errors, fmt, io, os, sort, strconv, time, boolValue, boolFlag, intValue, int64Value, uintValue, uint64Value, stringValue, float64Value, durationValue, Value, ErrorHandling, FlagSet, Flag, sliceType, ptrType, ptrType$1, ptrType$2, ptrType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, sliceType$1, ptrType$10, ptrType$11, ptrType$12, ptrType$13, ptrType$14, ptrType$15, ptrType$16, sliceType$2, funcType, ptrType$17, funcType$1, mapType, x, newBoolValue, newIntValue, newInt64Value, newUintValue, newUint64Value, newStringValue, newFloat64Value, newDurationValue, sortFlags, isZeroValue, UnquoteUsage, PrintDefaults, defaultUsage, Bool, Int, Uint, String, Duration, NewFlagSet; - errors = $packages["errors"]; - fmt = $packages["fmt"]; - io = $packages["io"]; - os = $packages["os"]; - sort = $packages["sort"]; - strconv = $packages["strconv"]; - time = $packages["time"]; - boolValue = $pkg.boolValue = $newType(1, $kindBool, "flag.boolValue", "boolValue", "flag", null); - boolFlag = $pkg.boolFlag = $newType(8, $kindInterface, "flag.boolFlag", "boolFlag", "flag", null); - intValue = $pkg.intValue = $newType(4, $kindInt, "flag.intValue", "intValue", "flag", null); - int64Value = $pkg.int64Value = $newType(8, $kindInt64, "flag.int64Value", "int64Value", "flag", null); - uintValue = $pkg.uintValue = $newType(4, $kindUint, "flag.uintValue", "uintValue", "flag", null); - uint64Value = $pkg.uint64Value = $newType(8, $kindUint64, "flag.uint64Value", "uint64Value", "flag", null); - stringValue = $pkg.stringValue = $newType(8, $kindString, "flag.stringValue", "stringValue", "flag", null); - float64Value = $pkg.float64Value = $newType(8, $kindFloat64, "flag.float64Value", "float64Value", "flag", null); - durationValue = $pkg.durationValue = $newType(8, $kindInt64, "flag.durationValue", "durationValue", "flag", null); - Value = $pkg.Value = $newType(8, $kindInterface, "flag.Value", "Value", "flag", null); - ErrorHandling = $pkg.ErrorHandling = $newType(4, $kindInt, "flag.ErrorHandling", "ErrorHandling", "flag", null); - FlagSet = $pkg.FlagSet = $newType(0, $kindStruct, "flag.FlagSet", "FlagSet", "flag", function(Usage_, name_, parsed_, actual_, formal_, args_, errorHandling_, output_) { - this.$val = this; - if (arguments.length === 0) { - this.Usage = $throwNilPointerError; - this.name = ""; - this.parsed = false; - this.actual = false; - this.formal = false; - this.args = sliceType$2.nil; - this.errorHandling = 0; - this.output = $ifaceNil; - return; - } - this.Usage = Usage_; - this.name = name_; - this.parsed = parsed_; - this.actual = actual_; - this.formal = formal_; - this.args = args_; - this.errorHandling = errorHandling_; - this.output = output_; - }); - Flag = $pkg.Flag = $newType(0, $kindStruct, "flag.Flag", "Flag", "flag", function(Name_, Usage_, Value_, DefValue_) { - this.$val = this; - if (arguments.length === 0) { - this.Name = ""; - this.Usage = ""; - this.Value = $ifaceNil; - this.DefValue = ""; - return; - } - this.Name = Name_; - this.Usage = Usage_; - this.Value = Value_; - this.DefValue = DefValue_; - }); - sliceType = $sliceType($emptyInterface); - ptrType = $ptrType(boolValue); - ptrType$1 = $ptrType(intValue); - ptrType$2 = $ptrType(int64Value); - ptrType$3 = $ptrType(uintValue); - ptrType$4 = $ptrType(uint64Value); - ptrType$5 = $ptrType(stringValue); - ptrType$6 = $ptrType(float64Value); - ptrType$7 = $ptrType(durationValue); - ptrType$8 = $ptrType(time.Duration); - ptrType$9 = $ptrType(Flag); - sliceType$1 = $sliceType(ptrType$9); - ptrType$10 = $ptrType($Bool); - ptrType$11 = $ptrType($Int); - ptrType$12 = $ptrType($Int64); - ptrType$13 = $ptrType($Uint); - ptrType$14 = $ptrType($Uint64); - ptrType$15 = $ptrType($String); - ptrType$16 = $ptrType($Float64); - sliceType$2 = $sliceType($String); - funcType = $funcType([ptrType$9], [], false); - ptrType$17 = $ptrType(FlagSet); - funcType$1 = $funcType([], [], false); - mapType = $mapType($String, ptrType$9); - newBoolValue = function(val, p) { - var $ptr, _ptr, p, val; - p.$set(val); - return (_ptr = p, new ptrType(function() { return _ptr.$get(); }, function($v) { _ptr.$set($v); }, _ptr.$target)); - }; - $ptrType(boolValue).prototype.Set = function(s) { - var $ptr, _tuple, b, err, s, v; - b = this; - _tuple = strconv.ParseBool(s); - v = _tuple[0]; - err = _tuple[1]; - b.$set(v); - return err; - }; - $ptrType(boolValue).prototype.Get = function() { - var $ptr, b; - b = this; - return new $Bool(b.$get()); - }; - $ptrType(boolValue).prototype.String = function() { - var $ptr, _r, b, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; b = $f.b; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - b = this; - _r = fmt.Sprintf("%v", new sliceType([new boolValue(b.$get())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(boolValue).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.b = b; $f.$s = $s; $f.$r = $r; return $f; - }; - $ptrType(boolValue).prototype.IsBoolFlag = function() { - var $ptr, b; - b = this; - return true; - }; - newIntValue = function(val, p) { - var $ptr, _ptr, p, val; - p.$set(val); - return (_ptr = p, new ptrType$1(function() { return (_ptr.$get() >> 0); }, function($v) { _ptr.$set(($v >> 0)); }, _ptr.$target)); - }; - $ptrType(intValue).prototype.Set = function(s) { - var $ptr, _tuple, err, i, s, v; - i = this; - _tuple = strconv.ParseInt(s, 0, 64); - v = _tuple[0]; - err = _tuple[1]; - i.$set(((v.$low + ((v.$high >> 31) * 4294967296)) >> 0)); - return err; - }; - $ptrType(intValue).prototype.Get = function() { - var $ptr, i; - i = this; - return new $Int((i.$get() >> 0)); - }; - $ptrType(intValue).prototype.String = function() { - var $ptr, _r, i, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - i = this; - _r = fmt.Sprintf("%v", new sliceType([new intValue(i.$get())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(intValue).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; - }; - newInt64Value = function(val, p) { - var $ptr, _ptr, p, val, x$1; - p.$set(val); - return (_ptr = p, new ptrType$2(function() { return (x$1 = _ptr.$get(), new int64Value(x$1.$high, x$1.$low)); }, function($v) { _ptr.$set(new $Int64($v.$high, $v.$low)); }, _ptr.$target)); - }; - $ptrType(int64Value).prototype.Set = function(s) { - var $ptr, _tuple, err, i, s, v; - i = this; - _tuple = strconv.ParseInt(s, 0, 64); - v = _tuple[0]; - err = _tuple[1]; - i.$set(new int64Value(v.$high, v.$low)); - return err; - }; - $ptrType(int64Value).prototype.Get = function() { - var $ptr, i, x$1; - i = this; - return (x$1 = i.$get(), new $Int64(x$1.$high, x$1.$low)); - }; - $ptrType(int64Value).prototype.String = function() { - var $ptr, _r, i, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - i = this; - _r = fmt.Sprintf("%v", new sliceType([i.$get()])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(int64Value).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; - }; - newUintValue = function(val, p) { - var $ptr, _ptr, p, val; - p.$set(val); - return (_ptr = p, new ptrType$3(function() { return (_ptr.$get() >>> 0); }, function($v) { _ptr.$set(($v >>> 0)); }, _ptr.$target)); - }; - $ptrType(uintValue).prototype.Set = function(s) { - var $ptr, _tuple, err, i, s, v; - i = this; - _tuple = strconv.ParseUint(s, 0, 64); - v = _tuple[0]; - err = _tuple[1]; - i.$set((v.$low >>> 0)); - return err; - }; - $ptrType(uintValue).prototype.Get = function() { - var $ptr, i; - i = this; - return new $Uint((i.$get() >>> 0)); - }; - $ptrType(uintValue).prototype.String = function() { - var $ptr, _r, i, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - i = this; - _r = fmt.Sprintf("%v", new sliceType([new uintValue(i.$get())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(uintValue).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; - }; - newUint64Value = function(val, p) { - var $ptr, _ptr, p, val, x$1; - p.$set(val); - return (_ptr = p, new ptrType$4(function() { return (x$1 = _ptr.$get(), new uint64Value(x$1.$high, x$1.$low)); }, function($v) { _ptr.$set(new $Uint64($v.$high, $v.$low)); }, _ptr.$target)); - }; - $ptrType(uint64Value).prototype.Set = function(s) { - var $ptr, _tuple, err, i, s, v; - i = this; - _tuple = strconv.ParseUint(s, 0, 64); - v = _tuple[0]; - err = _tuple[1]; - i.$set(new uint64Value(v.$high, v.$low)); - return err; - }; - $ptrType(uint64Value).prototype.Get = function() { - var $ptr, i, x$1; - i = this; - return (x$1 = i.$get(), new $Uint64(x$1.$high, x$1.$low)); - }; - $ptrType(uint64Value).prototype.String = function() { - var $ptr, _r, i, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; i = $f.i; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - i = this; - _r = fmt.Sprintf("%v", new sliceType([i.$get()])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(uint64Value).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.i = i; $f.$s = $s; $f.$r = $r; return $f; - }; - newStringValue = function(val, p) { - var $ptr, _ptr, p, val; - p.$set(val); - return (_ptr = p, new ptrType$5(function() { return _ptr.$get(); }, function($v) { _ptr.$set($v); }, _ptr.$target)); - }; - $ptrType(stringValue).prototype.Set = function(val) { - var $ptr, s, val; - s = this; - s.$set(val); - return $ifaceNil; - }; - $ptrType(stringValue).prototype.Get = function() { - var $ptr, s; - s = this; - return new $String(s.$get()); - }; - $ptrType(stringValue).prototype.String = function() { - var $ptr, _r, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s = this; - _r = fmt.Sprintf("%s", new sliceType([new stringValue(s.$get())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(stringValue).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - newFloat64Value = function(val, p) { - var $ptr, _ptr, p, val; - p.$set(val); - return (_ptr = p, new ptrType$6(function() { return _ptr.$get(); }, function($v) { _ptr.$set($v); }, _ptr.$target)); - }; - $ptrType(float64Value).prototype.Set = function(s) { - var $ptr, _tuple, err, f, s, v; - f = this; - _tuple = strconv.ParseFloat(s, 64); - v = _tuple[0]; - err = _tuple[1]; - f.$set(v); - return err; - }; - $ptrType(float64Value).prototype.Get = function() { - var $ptr, f; - f = this; - return new $Float64(f.$get()); - }; - $ptrType(float64Value).prototype.String = function() { - var $ptr, _r, f, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - _r = fmt.Sprintf("%v", new sliceType([new float64Value(f.$get())])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: $ptrType(float64Value).prototype.String }; } $f.$ptr = $ptr; $f._r = _r; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; - }; - newDurationValue = function(val, p) { - var $ptr, _ptr, p, val, x$1; - p.$set(val); - return (_ptr = p, new ptrType$7(function() { return (x$1 = _ptr.$get(), new durationValue(x$1.$high, x$1.$low)); }, function($v) { _ptr.$set(new time.Duration($v.$high, $v.$low)); }, _ptr.$target)); - }; - $ptrType(durationValue).prototype.Set = function(s) { - var $ptr, _tuple, d, err, s, v; - d = this; - _tuple = time.ParseDuration(s); - v = _tuple[0]; - err = _tuple[1]; - d.$set(new durationValue(v.$high, v.$low)); - return err; - }; - $ptrType(durationValue).prototype.Get = function() { - var $ptr, d, x$1; - d = this; - return (x$1 = d.$get(), new time.Duration(x$1.$high, x$1.$low)); - }; - $ptrType(durationValue).prototype.String = function() { - var $ptr, _ptr, d, x$1; - d = this; - return (_ptr = d, new ptrType$8(function() { return (x$1 = _ptr.$get(), new time.Duration(x$1.$high, x$1.$low)); }, function($v) { _ptr.$set(new durationValue($v.$high, $v.$low)); }, _ptr.$target)).String(); - }; - sortFlags = function(flags) { - var $ptr, _entry, _entry$1, _i, _i$1, _keys, _ref, _ref$1, f, flags, i, i$1, list, name, result, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _entry$1 = $f._entry$1; _i = $f._i; _i$1 = $f._i$1; _keys = $f._keys; _ref = $f._ref; _ref$1 = $f._ref$1; f = $f.f; flags = $f.flags; i = $f.i; i$1 = $f.i$1; list = $f.list; name = $f.name; result = $f.result; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - list = $makeSlice(sort.StringSlice, $keys(flags).length); - i = 0; - _ref = flags; - _i = 0; - _keys = $keys(_ref); - while (true) { - if (!(_i < _keys.length)) { break; } - _entry = _ref[_keys[_i]]; - if (_entry === undefined) { - _i++; - continue; - } - f = _entry.v; - ((i < 0 || i >= list.$length) ? $throwRuntimeError("index out of range") : list.$array[list.$offset + i] = f.Name); - i = i + (1) >> 0; - _i++; - } - $r = list.Sort(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - result = $makeSlice(sliceType$1, list.$length); - _ref$1 = list; - _i$1 = 0; - while (true) { - if (!(_i$1 < _ref$1.$length)) { break; } - i$1 = _i$1; - name = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? $throwRuntimeError("index out of range") : _ref$1.$array[_ref$1.$offset + _i$1]); - ((i$1 < 0 || i$1 >= result.$length) ? $throwRuntimeError("index out of range") : result.$array[result.$offset + i$1] = (_entry$1 = flags[$String.keyFor(name)], _entry$1 !== undefined ? _entry$1.v : ptrType$9.nil)); - _i$1++; - } - return result; - /* */ } return; } if ($f === undefined) { $f = { $blk: sortFlags }; } $f.$ptr = $ptr; $f._entry = _entry; $f._entry$1 = _entry$1; $f._i = _i; $f._i$1 = _i$1; $f._keys = _keys; $f._ref = _ref; $f._ref$1 = _ref$1; $f.f = f; $f.flags = flags; $f.i = i; $f.i$1 = i$1; $f.list = list; $f.name = name; $f.result = result; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.ptr.prototype.out = function() { - var $ptr, f; - f = this; - if ($interfaceIsEqual(f.output, $ifaceNil)) { - return os.Stderr; - } - return f.output; - }; - FlagSet.prototype.out = function() { return this.$val.out(); }; - FlagSet.ptr.prototype.SetOutput = function(output) { - var $ptr, f, output; - f = this; - f.output = output; - }; - FlagSet.prototype.SetOutput = function(output) { return this.$val.SetOutput(output); }; - FlagSet.ptr.prototype.VisitAll = function(fn) { - var $ptr, _i, _r, _ref, f, flag, fn, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _ref = $f._ref; f = $f.f; flag = $f.flag; fn = $f.fn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - _r = sortFlags(f.formal); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _ref = _r; - _i = 0; - /* while (true) { */ case 2: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } - flag = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - $r = fn(flag); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _i++; - /* } */ $s = 2; continue; case 3: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.VisitAll }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._ref = _ref; $f.f = f; $f.flag = flag; $f.fn = fn; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.VisitAll = function(fn) { return this.$val.VisitAll(fn); }; - FlagSet.ptr.prototype.Visit = function(fn) { - var $ptr, _i, _r, _ref, f, flag, fn, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r = $f._r; _ref = $f._ref; f = $f.f; flag = $f.flag; fn = $f.fn; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - _r = sortFlags(f.actual); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _ref = _r; - _i = 0; - /* while (true) { */ case 2: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } - flag = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - $r = fn(flag); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _i++; - /* } */ $s = 2; continue; case 3: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Visit }; } $f.$ptr = $ptr; $f._i = _i; $f._r = _r; $f._ref = _ref; $f.f = f; $f.flag = flag; $f.fn = fn; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Visit = function(fn) { return this.$val.Visit(fn); }; - FlagSet.ptr.prototype.Lookup = function(name) { - var $ptr, _entry, f, name; - f = this; - return (_entry = f.formal[$String.keyFor(name)], _entry !== undefined ? _entry.v : ptrType$9.nil); - }; - FlagSet.prototype.Lookup = function(name) { return this.$val.Lookup(name); }; - FlagSet.ptr.prototype.Set = function(name, value) { - var $ptr, _entry, _key, _r, _r$1, _tuple, err, f, flag, name, ok, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; err = $f.err; f = $f.f; flag = $f.flag; name = $f.name; ok = $f.ok; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - _tuple = (_entry = f.formal[$String.keyFor(name)], _entry !== undefined ? [_entry.v, true] : [ptrType$9.nil, false]); - flag = _tuple[0]; - ok = _tuple[1]; - /* */ if (!ok) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!ok) { */ case 1: - _r = fmt.Errorf("no such flag -%v", new sliceType([new $String(name)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return _r; - /* } */ case 2: - _r$1 = flag.Value.Set(value); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - err = _r$1; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return err; - } - if (f.actual === false) { - f.actual = {}; - } - _key = name; (f.actual || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: flag }; - return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Set }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f.err = err; $f.f = f; $f.flag = flag; $f.name = name; $f.ok = ok; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Set = function(name, value) { return this.$val.Set(name, value); }; - isZeroValue = function(value) { - var $ptr, _1, value; - _1 = value; - if (_1 === ("false")) { - return true; - } else if (_1 === ("")) { - return true; - } else if (_1 === ("0")) { - return true; - } - return false; - }; - UnquoteUsage = function(flag) { - var $ptr, _ref, _tmp, _tmp$1, flag, i, j, name, usage; - name = ""; - usage = ""; - usage = flag.Usage; - i = 0; - while (true) { - if (!(i < usage.length)) { break; } - if (usage.charCodeAt(i) === 96) { - j = i + 1 >> 0; - while (true) { - if (!(j < usage.length)) { break; } - if (usage.charCodeAt(j) === 96) { - name = usage.substring((i + 1 >> 0), j); - usage = usage.substring(0, i) + name + usage.substring((j + 1 >> 0)); - _tmp = name; - _tmp$1 = usage; - name = _tmp; - usage = _tmp$1; - return [name, usage]; - } - j = j + (1) >> 0; - } - break; - } - i = i + (1) >> 0; - } - name = "value"; - _ref = flag.Value; - if ($assertType(_ref, boolFlag, true)[1]) { - name = ""; - } else if ($assertType(_ref, ptrType$7, true)[1]) { - name = "duration"; - } else if ($assertType(_ref, ptrType$6, true)[1]) { - name = "float"; - } else if ($assertType(_ref, ptrType$1, true)[1] || $assertType(_ref, ptrType$2, true)[1]) { - name = "int"; - } else if ($assertType(_ref, ptrType$5, true)[1]) { - name = "string"; - } else if ($assertType(_ref, ptrType$3, true)[1] || $assertType(_ref, ptrType$4, true)[1]) { - name = "uint"; - } - return [name, usage]; - }; - $pkg.UnquoteUsage = UnquoteUsage; - FlagSet.ptr.prototype.PrintDefaults = function() { - var $ptr, f, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = [f]; - f[0] = this; - $r = f[0].VisitAll((function(f) { return function $b(flag) { - var $ptr, _r, _r$1, _r$2, _r$3, _tuple, _tuple$1, flag, name, ok, s, usage, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; flag = $f.flag; name = $f.name; ok = $f.ok; s = $f.s; usage = $f.usage; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = fmt.Sprintf(" -%s", new sliceType([new $String(flag.Name)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - s = _r; - _tuple = UnquoteUsage(flag); - name = _tuple[0]; - usage = _tuple[1]; - if (name.length > 0) { - s = s + (" " + name); - } - if (s.length <= 4) { - s = s + ("\t"); - } else { - s = s + ("\n \t"); - } - s = s + (usage); - /* */ if (!isZeroValue(flag.DefValue)) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (!isZeroValue(flag.DefValue)) { */ case 2: - _tuple$1 = $assertType(flag.Value, ptrType$5, true); - ok = _tuple$1[1]; - /* */ if (ok) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (ok) { */ case 4: - _r$1 = fmt.Sprintf(" (default %q)", new sliceType([new $String(flag.DefValue)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - s = s + (_r$1); - $s = 6; continue; - /* } else { */ case 5: - _r$2 = fmt.Sprintf(" (default %v)", new sliceType([new $String(flag.DefValue)])); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - s = s + (_r$2); - /* } */ case 6: - /* } */ case 3: - _r$3 = fmt.Fprint(f[0].out(), new sliceType([new $String(s), new $String("\n")])); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$3; - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.flag = flag; $f.name = name; $f.ok = ok; $f.s = s; $f.usage = usage; $f.$s = $s; $f.$r = $r; return $f; - }; })(f)); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.PrintDefaults }; } $f.$ptr = $ptr; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.PrintDefaults = function() { return this.$val.PrintDefaults(); }; - PrintDefaults = function() { - var $ptr, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = $pkg.CommandLine.PrintDefaults(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: PrintDefaults }; } $f.$ptr = $ptr; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.PrintDefaults = PrintDefaults; - defaultUsage = function(f) { - var $ptr, _r, _r$1, f, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ if (f.name === "") { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (f.name === "") { */ case 1: - _r = fmt.Fprintf(f.out(), "Usage:\n", new sliceType([])); /* */ $s = 4; case 4: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r; - $s = 3; continue; - /* } else { */ case 2: - _r$1 = fmt.Fprintf(f.out(), "Usage of %s:\n", new sliceType([new $String(f.name)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$1; - /* } */ case 3: - $r = f.PrintDefaults(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: defaultUsage }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.ptr.prototype.NFlag = function() { - var $ptr, f; - f = this; - return $keys(f.actual).length; - }; - FlagSet.prototype.NFlag = function() { return this.$val.NFlag(); }; - FlagSet.ptr.prototype.Arg = function(i) { - var $ptr, f, i, x$1; - f = this; - if (i < 0 || i >= f.args.$length) { - return ""; - } - return (x$1 = f.args, ((i < 0 || i >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + i])); - }; - FlagSet.prototype.Arg = function(i) { return this.$val.Arg(i); }; - FlagSet.ptr.prototype.NArg = function() { - var $ptr, f; - f = this; - return f.args.$length; - }; - FlagSet.prototype.NArg = function() { return this.$val.NArg(); }; - FlagSet.ptr.prototype.Args = function() { - var $ptr, f; - f = this; - return f.args; - }; - FlagSet.prototype.Args = function() { return this.$val.Args(); }; - FlagSet.ptr.prototype.BoolVar = function(p, name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - $r = f.Var(newBoolValue(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.BoolVar }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.BoolVar = function(p, name, value, usage) { return this.$val.BoolVar(p, name, value, usage); }; - FlagSet.ptr.prototype.Bool = function(name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - p = $newDataPointer(false, ptrType$10); - $r = f.BoolVar(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return p; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Bool }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Bool = function(name, value, usage) { return this.$val.Bool(name, value, usage); }; - Bool = function(name, value, usage) { - var $ptr, _r, name, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = $pkg.CommandLine.Bool(name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Bool }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Bool = Bool; - FlagSet.ptr.prototype.IntVar = function(p, name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - $r = f.Var(newIntValue(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.IntVar }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.IntVar = function(p, name, value, usage) { return this.$val.IntVar(p, name, value, usage); }; - FlagSet.ptr.prototype.Int = function(name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - p = $newDataPointer(0, ptrType$11); - $r = f.IntVar(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return p; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Int }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Int = function(name, value, usage) { return this.$val.Int(name, value, usage); }; - Int = function(name, value, usage) { - var $ptr, _r, name, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = $pkg.CommandLine.Int(name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Int }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Int = Int; - FlagSet.ptr.prototype.Int64Var = function(p, name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - $r = f.Var(newInt64Value(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Int64Var }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Int64Var = function(p, name, value, usage) { return this.$val.Int64Var(p, name, value, usage); }; - FlagSet.ptr.prototype.Int64 = function(name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - p = $newDataPointer(new $Int64(0, 0), ptrType$12); - $r = f.Int64Var(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return p; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Int64 }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Int64 = function(name, value, usage) { return this.$val.Int64(name, value, usage); }; - FlagSet.ptr.prototype.UintVar = function(p, name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - $r = f.Var(newUintValue(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.UintVar }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.UintVar = function(p, name, value, usage) { return this.$val.UintVar(p, name, value, usage); }; - FlagSet.ptr.prototype.Uint = function(name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - p = $newDataPointer(0, ptrType$13); - $r = f.UintVar(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return p; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Uint }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Uint = function(name, value, usage) { return this.$val.Uint(name, value, usage); }; - Uint = function(name, value, usage) { - var $ptr, _r, name, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = $pkg.CommandLine.Uint(name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Uint }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Uint = Uint; - FlagSet.ptr.prototype.Uint64Var = function(p, name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - $r = f.Var(newUint64Value(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Uint64Var }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Uint64Var = function(p, name, value, usage) { return this.$val.Uint64Var(p, name, value, usage); }; - FlagSet.ptr.prototype.Uint64 = function(name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - p = $newDataPointer(new $Uint64(0, 0), ptrType$14); - $r = f.Uint64Var(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return p; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Uint64 }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Uint64 = function(name, value, usage) { return this.$val.Uint64(name, value, usage); }; - FlagSet.ptr.prototype.StringVar = function(p, name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - $r = f.Var(newStringValue(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.StringVar }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.StringVar = function(p, name, value, usage) { return this.$val.StringVar(p, name, value, usage); }; - FlagSet.ptr.prototype.String = function(name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - p = $newDataPointer("", ptrType$15); - $r = f.StringVar(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return p; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.String }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.String = function(name, value, usage) { return this.$val.String(name, value, usage); }; - String = function(name, value, usage) { - var $ptr, _r, name, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = $pkg.CommandLine.String(name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: String }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.String = String; - FlagSet.ptr.prototype.Float64Var = function(p, name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - $r = f.Var(newFloat64Value(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Float64Var }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Float64Var = function(p, name, value, usage) { return this.$val.Float64Var(p, name, value, usage); }; - FlagSet.ptr.prototype.Float64 = function(name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - p = $newDataPointer(0, ptrType$16); - $r = f.Float64Var(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return p; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Float64 }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Float64 = function(name, value, usage) { return this.$val.Float64(name, value, usage); }; - FlagSet.ptr.prototype.DurationVar = function(p, name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - $r = f.Var(newDurationValue(value, p), name, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.DurationVar }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.DurationVar = function(p, name, value, usage) { return this.$val.DurationVar(p, name, value, usage); }; - FlagSet.ptr.prototype.Duration = function(name, value, usage) { - var $ptr, f, name, p, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; name = $f.name; p = $f.p; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - p = $newDataPointer(new time.Duration(0, 0), ptrType$8); - $r = f.DurationVar(p, name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return p; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Duration }; } $f.$ptr = $ptr; $f.f = f; $f.name = name; $f.p = p; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Duration = function(name, value, usage) { return this.$val.Duration(name, value, usage); }; - Duration = function(name, value, usage) { - var $ptr, _r, name, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = $pkg.CommandLine.Duration(name, value, usage); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: Duration }; } $f.$ptr = $ptr; $f._r = _r; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Duration = Duration; - FlagSet.ptr.prototype.Var = function(value, name, usage) { - var $ptr, _entry, _key, _r, _r$1, _r$2, _r$3, _tuple, alreadythere, f, flag, msg, name, usage, value, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; alreadythere = $f.alreadythere; f = $f.f; flag = $f.flag; msg = $f.msg; name = $f.name; usage = $f.usage; value = $f.value; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - _r = value.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - flag = new Flag.ptr(name, usage, value, _r); - _tuple = (_entry = f.formal[$String.keyFor(name)], _entry !== undefined ? [_entry.v, true] : [ptrType$9.nil, false]); - alreadythere = _tuple[1]; - /* */ if (alreadythere) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (alreadythere) { */ case 2: - msg = ""; - /* */ if (f.name === "") { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (f.name === "") { */ case 4: - _r$1 = fmt.Sprintf("flag redefined: %s", new sliceType([new $String(name)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - msg = _r$1; - $s = 6; continue; - /* } else { */ case 5: - _r$2 = fmt.Sprintf("%s flag redefined: %s", new sliceType([new $String(f.name), new $String(name)])); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - msg = _r$2; - /* } */ case 6: - _r$3 = fmt.Fprintln(f.out(), new sliceType([new $String(msg)])); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$3; - $panic(new $String(msg)); - /* } */ case 3: - if (f.formal === false) { - f.formal = {}; - } - _key = name; (f.formal || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: flag }; - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Var }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.alreadythere = alreadythere; $f.f = f; $f.flag = flag; $f.msg = msg; $f.name = name; $f.usage = usage; $f.value = value; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Var = function(value, name, usage) { return this.$val.Var(value, name, usage); }; - FlagSet.ptr.prototype.failf = function(format, a) { - var $ptr, _r, _r$1, a, err, f, format, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; a = $f.a; err = $f.err; f = $f.f; format = $f.format; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - _r = fmt.Errorf(format, a); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - err = _r; - _r$1 = fmt.Fprintln(f.out(), new sliceType([err])); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _r$1; - $r = f.usage(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return err; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.failf }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f.a = a; $f.err = err; $f.f = f; $f.format = format; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.failf = function(format, a) { return this.$val.failf(format, a); }; - FlagSet.ptr.prototype.usage = function() { - var $ptr, f, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; f = $f.f; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - /* */ if (f.Usage === $throwNilPointerError) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (f.Usage === $throwNilPointerError) { */ case 1: - /* */ if (f === $pkg.CommandLine) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (f === $pkg.CommandLine) { */ case 4: - $r = $pkg.Usage(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 6; continue; - /* } else { */ case 5: - $r = defaultUsage(f); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 6: - $s = 3; continue; - /* } else { */ case 2: - $r = f.Usage(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 3: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.usage }; } $f.$ptr = $ptr; $f.f = f; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.usage = function() { return this.$val.usage(); }; - FlagSet.ptr.prototype.parseOne = function() { - var $ptr, _entry, _key, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tmp, _tmp$1, _tuple, _tuple$1, _v, alreadythere, err, err$1, err$2, f, flag, fv, hasValue, i, m, name, numMinuses, ok, s, value, x$1, x$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _r = $f._r; _r$1 = $f._r$1; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; alreadythere = $f.alreadythere; err = $f.err; err$1 = $f.err$1; err$2 = $f.err$2; f = $f.f; flag = $f.flag; fv = $f.fv; hasValue = $f.hasValue; i = $f.i; m = $f.m; name = $f.name; numMinuses = $f.numMinuses; ok = $f.ok; s = $f.s; value = $f.value; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - if (f.args.$length === 0) { - return [false, $ifaceNil]; - } - s = (x$1 = f.args, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])); - if ((s.length === 0) || !((s.charCodeAt(0) === 45)) || (s.length === 1)) { - return [false, $ifaceNil]; - } - numMinuses = 1; - if (s.charCodeAt(1) === 45) { - numMinuses = numMinuses + (1) >> 0; - if (s.length === 2) { - f.args = $subslice(f.args, 1); - return [false, $ifaceNil]; - } - } - name = s.substring(numMinuses); - /* */ if ((name.length === 0) || (name.charCodeAt(0) === 45) || (name.charCodeAt(0) === 61)) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if ((name.length === 0) || (name.charCodeAt(0) === 45) || (name.charCodeAt(0) === 61)) { */ case 1: - _r = f.failf("bad flag syntax: %s", new sliceType([new $String(s)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 4; case 4: - return [false, _r]; - /* } */ case 2: - f.args = $subslice(f.args, 1); - hasValue = false; - value = ""; - i = 1; - while (true) { - if (!(i < name.length)) { break; } - if (name.charCodeAt(i) === 61) { - value = name.substring((i + 1 >> 0)); - hasValue = true; - name = name.substring(0, i); - break; - } - i = i + (1) >> 0; - } - m = f.formal; - _tuple = (_entry = m[$String.keyFor(name)], _entry !== undefined ? [_entry.v, true] : [ptrType$9.nil, false]); - flag = _tuple[0]; - alreadythere = _tuple[1]; - /* */ if (!alreadythere) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if (!alreadythere) { */ case 5: - /* */ if (name === "help" || name === "h") { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (name === "help" || name === "h") { */ case 7: - $r = f.usage(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return [false, $pkg.ErrHelp]; - /* } */ case 8: - _r$1 = f.failf("flag provided but not defined: -%s", new sliceType([new $String(name)])); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - /* */ $s = 11; case 11: - return [false, _r$1]; - /* } */ case 6: - _tuple$1 = $assertType(flag.Value, boolFlag, true); - fv = _tuple$1[0]; - ok = _tuple$1[1]; - if (!(ok)) { _v = false; $s = 15; continue s; } - _r$2 = fv.IsBoolFlag(); /* */ $s = 16; case 16: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _v = _r$2; case 15: - /* */ if (_v) { $s = 12; continue; } - /* */ $s = 13; continue; - /* if (_v) { */ case 12: - /* */ if (hasValue) { $s = 17; continue; } - /* */ $s = 18; continue; - /* if (hasValue) { */ case 17: - _r$3 = fv.Set(value); /* */ $s = 20; case 20: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - err = _r$3; - /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 21; continue; } - /* */ $s = 22; continue; - /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 21: - _r$4 = f.failf("invalid boolean value %q for -%s: %v", new sliceType([new $String(value), new $String(name), err])); /* */ $s = 23; case 23: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - /* */ $s = 24; case 24: - return [false, _r$4]; - /* } */ case 22: - $s = 19; continue; - /* } else { */ case 18: - _r$5 = fv.Set("true"); /* */ $s = 25; case 25: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - err$1 = _r$5; - /* */ if (!($interfaceIsEqual(err$1, $ifaceNil))) { $s = 26; continue; } - /* */ $s = 27; continue; - /* if (!($interfaceIsEqual(err$1, $ifaceNil))) { */ case 26: - _r$6 = f.failf("invalid boolean flag %s: %v", new sliceType([new $String(name), err$1])); /* */ $s = 28; case 28: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - /* */ $s = 29; case 29: - return [false, _r$6]; - /* } */ case 27: - /* } */ case 19: - $s = 14; continue; - /* } else { */ case 13: - if (!hasValue && f.args.$length > 0) { - hasValue = true; - _tmp = (x$2 = f.args, (0 >= x$2.$length ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + 0])); - _tmp$1 = $subslice(f.args, 1); - value = _tmp; - f.args = _tmp$1; - } - /* */ if (!hasValue) { $s = 30; continue; } - /* */ $s = 31; continue; - /* if (!hasValue) { */ case 30: - _r$7 = f.failf("flag needs an argument: -%s", new sliceType([new $String(name)])); /* */ $s = 32; case 32: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - /* */ $s = 33; case 33: - return [false, _r$7]; - /* } */ case 31: - _r$8 = flag.Value.Set(value); /* */ $s = 34; case 34: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } - err$2 = _r$8; - /* */ if (!($interfaceIsEqual(err$2, $ifaceNil))) { $s = 35; continue; } - /* */ $s = 36; continue; - /* if (!($interfaceIsEqual(err$2, $ifaceNil))) { */ case 35: - _r$9 = f.failf("invalid value %q for flag -%s: %v", new sliceType([new $String(value), new $String(name), err$2])); /* */ $s = 37; case 37: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } - /* */ $s = 38; case 38: - return [false, _r$9]; - /* } */ case 36: - /* } */ case 14: - if (f.actual === false) { - f.actual = {}; - } - _key = name; (f.actual || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: flag }; - return [true, $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.parseOne }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._r = _r; $f._r$1 = _r$1; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f.alreadythere = alreadythere; $f.err = err; $f.err$1 = err$1; $f.err$2 = err$2; $f.f = f; $f.flag = flag; $f.fv = fv; $f.hasValue = hasValue; $f.i = i; $f.m = m; $f.name = name; $f.numMinuses = numMinuses; $f.ok = ok; $f.s = s; $f.value = value; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.parseOne = function() { return this.$val.parseOne(); }; - FlagSet.ptr.prototype.Parse = function(arguments$1) { - var $ptr, _2, _r, _tuple, arguments$1, err, f, seen, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _2 = $f._2; _r = $f._r; _tuple = $f._tuple; arguments$1 = $f.arguments$1; err = $f.err; f = $f.f; seen = $f.seen; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = this; - f.parsed = true; - f.args = arguments$1; - /* while (true) { */ case 1: - _r = f.parseOne(); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - seen = _tuple[0]; - err = _tuple[1]; - if (seen) { - /* continue; */ $s = 1; continue; - } - if ($interfaceIsEqual(err, $ifaceNil)) { - /* break; */ $s = 2; continue; - } - _2 = f.errorHandling; - if (_2 === (0)) { - return err; - } else if (_2 === (1)) { - os.Exit(2); - } else if (_2 === (2)) { - $panic(err); - } - /* } */ $s = 1; continue; case 2: - return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: FlagSet.ptr.prototype.Parse }; } $f.$ptr = $ptr; $f._2 = _2; $f._r = _r; $f._tuple = _tuple; $f.arguments$1 = arguments$1; $f.err = err; $f.f = f; $f.seen = seen; $f.$s = $s; $f.$r = $r; return $f; - }; - FlagSet.prototype.Parse = function(arguments$1) { return this.$val.Parse(arguments$1); }; - FlagSet.ptr.prototype.Parsed = function() { - var $ptr, f; - f = this; - return f.parsed; - }; - FlagSet.prototype.Parsed = function() { return this.$val.Parsed(); }; - NewFlagSet = function(name, errorHandling) { - var $ptr, errorHandling, f, name; - f = new FlagSet.ptr($throwNilPointerError, name, false, false, false, sliceType$2.nil, errorHandling, $ifaceNil); - return f; - }; - $pkg.NewFlagSet = NewFlagSet; - FlagSet.ptr.prototype.Init = function(name, errorHandling) { - var $ptr, errorHandling, f, name; - f = this; - f.name = name; - f.errorHandling = errorHandling; - }; - FlagSet.prototype.Init = function(name, errorHandling) { return this.$val.Init(name, errorHandling); }; - ptrType.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "IsBoolFlag", name: "IsBoolFlag", pkg: "", typ: $funcType([], [$Bool], false)}]; - ptrType$1.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$2.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$3.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$4.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$5.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$6.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$7.methods = [{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "Get", name: "Get", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$17.methods = [{prop: "out", name: "out", pkg: "flag", typ: $funcType([], [io.Writer], false)}, {prop: "SetOutput", name: "SetOutput", pkg: "", typ: $funcType([io.Writer], [], false)}, {prop: "VisitAll", name: "VisitAll", pkg: "", typ: $funcType([funcType], [], false)}, {prop: "Visit", name: "Visit", pkg: "", typ: $funcType([funcType], [], false)}, {prop: "Lookup", name: "Lookup", pkg: "", typ: $funcType([$String], [ptrType$9], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String, $String], [$error], false)}, {prop: "PrintDefaults", name: "PrintDefaults", pkg: "", typ: $funcType([], [], false)}, {prop: "NFlag", name: "NFlag", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Arg", name: "Arg", pkg: "", typ: $funcType([$Int], [$String], false)}, {prop: "NArg", name: "NArg", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Args", name: "Args", pkg: "", typ: $funcType([], [sliceType$2], false)}, {prop: "BoolVar", name: "BoolVar", pkg: "", typ: $funcType([ptrType$10, $String, $Bool, $String], [], false)}, {prop: "Bool", name: "Bool", pkg: "", typ: $funcType([$String, $Bool, $String], [ptrType$10], false)}, {prop: "IntVar", name: "IntVar", pkg: "", typ: $funcType([ptrType$11, $String, $Int, $String], [], false)}, {prop: "Int", name: "Int", pkg: "", typ: $funcType([$String, $Int, $String], [ptrType$11], false)}, {prop: "Int64Var", name: "Int64Var", pkg: "", typ: $funcType([ptrType$12, $String, $Int64, $String], [], false)}, {prop: "Int64", name: "Int64", pkg: "", typ: $funcType([$String, $Int64, $String], [ptrType$12], false)}, {prop: "UintVar", name: "UintVar", pkg: "", typ: $funcType([ptrType$13, $String, $Uint, $String], [], false)}, {prop: "Uint", name: "Uint", pkg: "", typ: $funcType([$String, $Uint, $String], [ptrType$13], false)}, {prop: "Uint64Var", name: "Uint64Var", pkg: "", typ: $funcType([ptrType$14, $String, $Uint64, $String], [], false)}, {prop: "Uint64", name: "Uint64", pkg: "", typ: $funcType([$String, $Uint64, $String], [ptrType$14], false)}, {prop: "StringVar", name: "StringVar", pkg: "", typ: $funcType([ptrType$15, $String, $String, $String], [], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([$String, $String, $String], [ptrType$15], false)}, {prop: "Float64Var", name: "Float64Var", pkg: "", typ: $funcType([ptrType$16, $String, $Float64, $String], [], false)}, {prop: "Float64", name: "Float64", pkg: "", typ: $funcType([$String, $Float64, $String], [ptrType$16], false)}, {prop: "DurationVar", name: "DurationVar", pkg: "", typ: $funcType([ptrType$8, $String, time.Duration, $String], [], false)}, {prop: "Duration", name: "Duration", pkg: "", typ: $funcType([$String, time.Duration, $String], [ptrType$8], false)}, {prop: "Var", name: "Var", pkg: "", typ: $funcType([Value, $String, $String], [], false)}, {prop: "failf", name: "failf", pkg: "flag", typ: $funcType([$String, sliceType], [$error], true)}, {prop: "usage", name: "usage", pkg: "flag", typ: $funcType([], [], false)}, {prop: "parseOne", name: "parseOne", pkg: "flag", typ: $funcType([], [$Bool, $error], false)}, {prop: "Parse", name: "Parse", pkg: "", typ: $funcType([sliceType$2], [$error], false)}, {prop: "Parsed", name: "Parsed", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Init", name: "Init", pkg: "", typ: $funcType([$String, ErrorHandling], [], false)}]; - boolFlag.init([{prop: "IsBoolFlag", name: "IsBoolFlag", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); - Value.init([{prop: "Set", name: "Set", pkg: "", typ: $funcType([$String], [$error], false)}, {prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}]); - FlagSet.init([{prop: "Usage", name: "Usage", pkg: "", typ: funcType$1, tag: ""}, {prop: "name", name: "name", pkg: "flag", typ: $String, tag: ""}, {prop: "parsed", name: "parsed", pkg: "flag", typ: $Bool, tag: ""}, {prop: "actual", name: "actual", pkg: "flag", typ: mapType, tag: ""}, {prop: "formal", name: "formal", pkg: "flag", typ: mapType, tag: ""}, {prop: "args", name: "args", pkg: "flag", typ: sliceType$2, tag: ""}, {prop: "errorHandling", name: "errorHandling", pkg: "flag", typ: ErrorHandling, tag: ""}, {prop: "output", name: "output", pkg: "flag", typ: io.Writer, tag: ""}]); - Flag.init([{prop: "Name", name: "Name", pkg: "", typ: $String, tag: ""}, {prop: "Usage", name: "Usage", pkg: "", typ: $String, tag: ""}, {prop: "Value", name: "Value", pkg: "", typ: Value, tag: ""}, {prop: "DefValue", name: "DefValue", pkg: "", typ: $String, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = errors.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = fmt.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = os.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sort.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strconv.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = time.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $pkg.ErrHelp = errors.New("flag: help requested"); - $pkg.CommandLine = NewFlagSet((x = os.Args, (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0])), 1); - $pkg.Usage = (function $b() { - var $ptr, _r, x$1, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; x$1 = $f.x$1; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r = fmt.Fprintf(os.Stderr, "Usage of %s:\n", new sliceType([new $String((x$1 = os.Args, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])))])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _r; - $r = PrintDefaults(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$ptr = $ptr; $f._r = _r; $f.x$1 = x$1; $f.$s = $s; $f.$r = $r; return $f; - }); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["runtime/debug"] = (function() { - var $pkg = {}, $init, os, runtime, sort, time; - os = $packages["os"]; - runtime = $packages["runtime"]; - sort = $packages["sort"]; - time = $packages["time"]; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = os.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sort.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = time.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["runtime/pprof"] = (function() { - var $pkg = {}, $init, io, sync; - io = $packages["io"]; - sync = $packages["sync"]; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = io.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sync.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["runtime/trace"] = (function() { - var $pkg = {}, $init, io, runtime; - io = $packages["io"]; - runtime = $packages["runtime"]; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = io.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["testing"] = (function() { - var $pkg = {}, $init, bytes, flag, fmt, nosync, io, os, runtime, debug, pprof, trace, strconv, strings, atomic, time, matchBenchmarks, benchTime, benchmarkMemory, short$1, outputDir, chatty, count, coverProfile, match, memProfile, memProfileRate, cpuProfile, blockProfile, blockProfileRate, traceFile, timeout, cpuListStr, parallel, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17; - bytes = $packages["bytes"]; - flag = $packages["flag"]; - fmt = $packages["fmt"]; - nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; - io = $packages["io"]; - os = $packages["os"]; - runtime = $packages["runtime"]; - debug = $packages["runtime/debug"]; - pprof = $packages["runtime/pprof"]; - trace = $packages["runtime/trace"]; - strconv = $packages["strconv"]; - strings = $packages["strings"]; - atomic = $packages["sync/atomic"]; - time = $packages["time"]; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = flag.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = fmt.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = nosync.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = os.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = debug.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = pprof.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = trace.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strconv.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strings.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = atomic.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = time.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _r = flag.String("test.bench", "", "regular expression to select benchmarks to run"); /* */ $s = 15; case 15: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - matchBenchmarks = _r; - _r$1 = flag.Duration("test.benchtime", new time.Duration(0, 1000000000), "approximate run time for each benchmark"); /* */ $s = 16; case 16: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - benchTime = _r$1; - _r$2 = flag.Bool("test.benchmem", false, "print memory allocations for benchmarks"); /* */ $s = 17; case 17: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - benchmarkMemory = _r$2; - _r$3 = flag.Bool("test.short", false, "run smaller test suite to save time"); /* */ $s = 18; case 18: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - short$1 = _r$3; - _r$4 = flag.String("test.outputdir", "", "directory in which to write profiles"); /* */ $s = 19; case 19: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - outputDir = _r$4; - _r$5 = flag.Bool("test.v", false, "verbose: print additional output"); /* */ $s = 20; case 20: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - chatty = _r$5; - _r$6 = flag.Uint("test.count", 1, "run tests and benchmarks `n` times"); /* */ $s = 21; case 21: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - count = _r$6; - _r$7 = flag.String("test.coverprofile", "", "write a coverage profile to the named file after execution"); /* */ $s = 22; case 22: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - coverProfile = _r$7; - _r$8 = flag.String("test.run", "", "regular expression to select tests and examples to run"); /* */ $s = 23; case 23: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } - match = _r$8; - _r$9 = flag.String("test.memprofile", "", "write a memory profile to the named file after execution"); /* */ $s = 24; case 24: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } - memProfile = _r$9; - _r$10 = flag.Int("test.memprofilerate", 0, "if >=0, sets runtime.MemProfileRate"); /* */ $s = 25; case 25: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } - memProfileRate = _r$10; - _r$11 = flag.String("test.cpuprofile", "", "write a cpu profile to the named file during execution"); /* */ $s = 26; case 26: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } - cpuProfile = _r$11; - _r$12 = flag.String("test.blockprofile", "", "write a goroutine blocking profile to the named file after execution"); /* */ $s = 27; case 27: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } - blockProfile = _r$12; - _r$13 = flag.Int("test.blockprofilerate", 1, "if >= 0, calls runtime.SetBlockProfileRate()"); /* */ $s = 28; case 28: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } - blockProfileRate = _r$13; - _r$14 = flag.String("test.trace", "", "write an execution trace to the named file after execution"); /* */ $s = 29; case 29: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } - traceFile = _r$14; - _r$15 = flag.Duration("test.timeout", new time.Duration(0, 0), "if positive, sets an aggregate time limit for all tests"); /* */ $s = 30; case 30: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } - timeout = _r$15; - _r$16 = flag.String("test.cpu", "", "comma-separated list of number of CPUs to use for each test"); /* */ $s = 31; case 31: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } - cpuListStr = _r$16; - _r$17 = flag.Int("test.parallel", runtime.GOMAXPROCS(0), "maximum test parallelism"); /* */ $s = 32; case 32: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } - parallel = _r$17; - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["unicode/utf16"] = (function() { - var $pkg = {}, $init; - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["encoding/json"] = (function() { - var $pkg = {}, $init, bytes, encoding, base64, errors, fmt, nosync, io, math, reflect, runtime, sort, strconv, strings, testing, unicode, utf16, utf8, Number, Marshaler, UnsupportedTypeError, UnsupportedValueError, MarshalerError, encodeState, encoderFunc, floatEncoder, structEncoder, mapEncoder, sliceEncoder, arrayEncoder, ptrEncoder, condAddrEncoder, stringValues, field, byName, byIndex, SyntaxError, scanner, tagOptions, sliceType, mapType, structType, sliceType$1, mapType$1, structType$1, sliceType$2, ptrType, ptrType$1, sliceType$3, ptrType$2, arrayType, arrayType$1, ptrType$4, sliceType$4, ptrType$8, ptrType$13, ptrType$14, ptrType$16, ptrType$17, ptrType$18, ptrType$19, ptrType$20, ptrType$21, ptrType$22, funcType, ptrType$23, funcType$1, errPhase, numberType, hex, encoderCache, marshalerType, textMarshalerType, float32Encoder, float64Encoder, fieldCache, _r, _r$1, isValidNumber, Marshal, isEmptyValue, valueEncoder, typeEncoder, newTypeEncoder, invalidValueEncoder, marshalerEncoder, addrMarshalerEncoder, textMarshalerEncoder, addrTextMarshalerEncoder, boolEncoder, intEncoder, uintEncoder, stringEncoder, interfaceEncoder, unsupportedTypeEncoder, newStructEncoder, newMapEncoder, encodeByteSlice, newSliceEncoder, newArrayEncoder, newPtrEncoder, newCondAddrEncoder, isValidTag, fieldByIndex, typeByIndex, fillField, typeFields, dominantField, cachedTypeFields, foldFunc, equalFoldRight, asciiEqualFold, simpleLetterEqualFold, compact, isSpace, stateBeginValueOrEmpty, stateBeginValue, stateBeginStringOrEmpty, stateBeginString, stateEndValue, stateEndTop, stateInString, stateInStringEsc, stateInStringEscU, stateInStringEscU1, stateInStringEscU12, stateInStringEscU123, stateNeg, state1, state0, stateDot, stateDot0, stateE, stateESign, stateE0, stateT, stateTr, stateTru, stateF, stateFa, stateFal, stateFals, stateN, stateNu, stateNul, stateError, quoteChar, parseTag; - bytes = $packages["bytes"]; - encoding = $packages["encoding"]; - base64 = $packages["encoding/base64"]; - errors = $packages["errors"]; - fmt = $packages["fmt"]; - nosync = $packages["github.com/gopherjs/gopherjs/nosync"]; - io = $packages["io"]; - math = $packages["math"]; - reflect = $packages["reflect"]; - runtime = $packages["runtime"]; - sort = $packages["sort"]; - strconv = $packages["strconv"]; - strings = $packages["strings"]; - testing = $packages["testing"]; - unicode = $packages["unicode"]; - utf16 = $packages["unicode/utf16"]; - utf8 = $packages["unicode/utf8"]; - Number = $pkg.Number = $newType(8, $kindString, "json.Number", "Number", "encoding/json", null); - Marshaler = $pkg.Marshaler = $newType(8, $kindInterface, "json.Marshaler", "Marshaler", "encoding/json", null); - UnsupportedTypeError = $pkg.UnsupportedTypeError = $newType(0, $kindStruct, "json.UnsupportedTypeError", "UnsupportedTypeError", "encoding/json", function(Type_) { - this.$val = this; - if (arguments.length === 0) { - this.Type = $ifaceNil; - return; - } - this.Type = Type_; - }); - UnsupportedValueError = $pkg.UnsupportedValueError = $newType(0, $kindStruct, "json.UnsupportedValueError", "UnsupportedValueError", "encoding/json", function(Value_, Str_) { - this.$val = this; - if (arguments.length === 0) { - this.Value = new reflect.Value.ptr(ptrType$2.nil, 0, 0); - this.Str = ""; - return; - } - this.Value = Value_; - this.Str = Str_; - }); - MarshalerError = $pkg.MarshalerError = $newType(0, $kindStruct, "json.MarshalerError", "MarshalerError", "encoding/json", function(Type_, Err_) { - this.$val = this; - if (arguments.length === 0) { - this.Type = $ifaceNil; - this.Err = $ifaceNil; - return; - } - this.Type = Type_; - this.Err = Err_; - }); - encodeState = $pkg.encodeState = $newType(0, $kindStruct, "json.encodeState", "encodeState", "encoding/json", function(Buffer_, scratch_) { - this.$val = this; - if (arguments.length === 0) { - this.Buffer = new bytes.Buffer.ptr(sliceType$2.nil, 0, arrayType.zero(), arrayType$1.zero(), 0); - this.scratch = arrayType$1.zero(); - return; - } - this.Buffer = Buffer_; - this.scratch = scratch_; - }); - encoderFunc = $pkg.encoderFunc = $newType(4, $kindFunc, "json.encoderFunc", "encoderFunc", "encoding/json", null); - floatEncoder = $pkg.floatEncoder = $newType(4, $kindInt, "json.floatEncoder", "floatEncoder", "encoding/json", null); - structEncoder = $pkg.structEncoder = $newType(0, $kindStruct, "json.structEncoder", "structEncoder", "encoding/json", function(fields_, fieldEncs_) { - this.$val = this; - if (arguments.length === 0) { - this.fields = sliceType$1.nil; - this.fieldEncs = sliceType$4.nil; - return; - } - this.fields = fields_; - this.fieldEncs = fieldEncs_; - }); - mapEncoder = $pkg.mapEncoder = $newType(0, $kindStruct, "json.mapEncoder", "mapEncoder", "encoding/json", function(elemEnc_) { - this.$val = this; - if (arguments.length === 0) { - this.elemEnc = $throwNilPointerError; - return; - } - this.elemEnc = elemEnc_; - }); - sliceEncoder = $pkg.sliceEncoder = $newType(0, $kindStruct, "json.sliceEncoder", "sliceEncoder", "encoding/json", function(arrayEnc_) { - this.$val = this; - if (arguments.length === 0) { - this.arrayEnc = $throwNilPointerError; - return; - } - this.arrayEnc = arrayEnc_; - }); - arrayEncoder = $pkg.arrayEncoder = $newType(0, $kindStruct, "json.arrayEncoder", "arrayEncoder", "encoding/json", function(elemEnc_) { - this.$val = this; - if (arguments.length === 0) { - this.elemEnc = $throwNilPointerError; - return; - } - this.elemEnc = elemEnc_; - }); - ptrEncoder = $pkg.ptrEncoder = $newType(0, $kindStruct, "json.ptrEncoder", "ptrEncoder", "encoding/json", function(elemEnc_) { - this.$val = this; - if (arguments.length === 0) { - this.elemEnc = $throwNilPointerError; - return; - } - this.elemEnc = elemEnc_; - }); - condAddrEncoder = $pkg.condAddrEncoder = $newType(0, $kindStruct, "json.condAddrEncoder", "condAddrEncoder", "encoding/json", function(canAddrEnc_, elseEnc_) { - this.$val = this; - if (arguments.length === 0) { - this.canAddrEnc = $throwNilPointerError; - this.elseEnc = $throwNilPointerError; - return; - } - this.canAddrEnc = canAddrEnc_; - this.elseEnc = elseEnc_; - }); - stringValues = $pkg.stringValues = $newType(12, $kindSlice, "json.stringValues", "stringValues", "encoding/json", null); - field = $pkg.field = $newType(0, $kindStruct, "json.field", "field", "encoding/json", function(name_, nameBytes_, equalFold_, tag_, index_, typ_, omitEmpty_, quoted_) { - this.$val = this; - if (arguments.length === 0) { - this.name = ""; - this.nameBytes = sliceType$2.nil; - this.equalFold = $throwNilPointerError; - this.tag = false; - this.index = sliceType$3.nil; - this.typ = $ifaceNil; - this.omitEmpty = false; - this.quoted = false; - return; - } - this.name = name_; - this.nameBytes = nameBytes_; - this.equalFold = equalFold_; - this.tag = tag_; - this.index = index_; - this.typ = typ_; - this.omitEmpty = omitEmpty_; - this.quoted = quoted_; - }); - byName = $pkg.byName = $newType(12, $kindSlice, "json.byName", "byName", "encoding/json", null); - byIndex = $pkg.byIndex = $newType(12, $kindSlice, "json.byIndex", "byIndex", "encoding/json", null); - SyntaxError = $pkg.SyntaxError = $newType(0, $kindStruct, "json.SyntaxError", "SyntaxError", "encoding/json", function(msg_, Offset_) { - this.$val = this; - if (arguments.length === 0) { - this.msg = ""; - this.Offset = new $Int64(0, 0); - return; - } - this.msg = msg_; - this.Offset = Offset_; - }); - scanner = $pkg.scanner = $newType(0, $kindStruct, "json.scanner", "scanner", "encoding/json", function(step_, endTop_, parseState_, err_, redo_, redoCode_, redoState_, bytes_) { - this.$val = this; - if (arguments.length === 0) { - this.step = $throwNilPointerError; - this.endTop = false; - this.parseState = sliceType$3.nil; - this.err = $ifaceNil; - this.redo = false; - this.redoCode = 0; - this.redoState = $throwNilPointerError; - this.bytes = new $Int64(0, 0); - return; - } - this.step = step_; - this.endTop = endTop_; - this.parseState = parseState_; - this.err = err_; - this.redo = redo_; - this.redoCode = redoCode_; - this.redoState = redoState_; - this.bytes = bytes_; - }); - tagOptions = $pkg.tagOptions = $newType(8, $kindString, "json.tagOptions", "tagOptions", "encoding/json", null); - sliceType = $sliceType($emptyInterface); - mapType = $mapType(reflect.Type, encoderFunc); - structType = $structType([{prop: "RWMutex", name: "", pkg: "", typ: nosync.RWMutex, tag: ""}, {prop: "m", name: "m", pkg: "encoding/json", typ: mapType, tag: ""}]); - sliceType$1 = $sliceType(field); - mapType$1 = $mapType(reflect.Type, sliceType$1); - structType$1 = $structType([{prop: "RWMutex", name: "", pkg: "", typ: nosync.RWMutex, tag: ""}, {prop: "m", name: "m", pkg: "encoding/json", typ: mapType$1, tag: ""}]); - sliceType$2 = $sliceType($Uint8); - ptrType = $ptrType(Marshaler); - ptrType$1 = $ptrType(encoding.TextMarshaler); - sliceType$3 = $sliceType($Int); - ptrType$2 = $ptrType(reflect.rtype); - arrayType = $arrayType($Uint8, 4); - arrayType$1 = $arrayType($Uint8, 64); - ptrType$4 = $ptrType(encodeState); - sliceType$4 = $sliceType(encoderFunc); - ptrType$8 = $ptrType(SyntaxError); - ptrType$13 = $ptrType(UnsupportedTypeError); - ptrType$14 = $ptrType(UnsupportedValueError); - ptrType$16 = $ptrType(MarshalerError); - ptrType$17 = $ptrType(structEncoder); - ptrType$18 = $ptrType(mapEncoder); - ptrType$19 = $ptrType(sliceEncoder); - ptrType$20 = $ptrType(arrayEncoder); - ptrType$21 = $ptrType(ptrEncoder); - ptrType$22 = $ptrType(condAddrEncoder); - funcType = $funcType([sliceType$2, sliceType$2], [$Bool], false); - ptrType$23 = $ptrType(scanner); - funcType$1 = $funcType([ptrType$23, $Uint8], [$Int], false); - Number.prototype.String = function() { - var $ptr, n; - n = this.$val; - return n; - }; - $ptrType(Number).prototype.String = function() { return new Number(this.$get()).String(); }; - Number.prototype.Float64 = function() { - var $ptr, n; - n = this.$val; - return strconv.ParseFloat(n, 64); - }; - $ptrType(Number).prototype.Float64 = function() { return new Number(this.$get()).Float64(); }; - Number.prototype.Int64 = function() { - var $ptr, n; - n = this.$val; - return strconv.ParseInt(n, 10, 64); - }; - $ptrType(Number).prototype.Int64 = function() { return new Number(this.$get()).Int64(); }; - isValidNumber = function(s) { - var $ptr, s; - if (s === "") { - return false; - } - if (s.charCodeAt(0) === 45) { - s = s.substring(1); - if (s === "") { - return false; - } - } - if ((s.charCodeAt(0) === 48)) { - s = s.substring(1); - } else if (49 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57) { - s = s.substring(1); - while (true) { - if (!(s.length > 0 && 48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57)) { break; } - s = s.substring(1); - } - } else { - return false; - } - if (s.length >= 2 && (s.charCodeAt(0) === 46) && 48 <= s.charCodeAt(1) && s.charCodeAt(1) <= 57) { - s = s.substring(2); - while (true) { - if (!(s.length > 0 && 48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57)) { break; } - s = s.substring(1); - } - } - if (s.length >= 2 && ((s.charCodeAt(0) === 101) || (s.charCodeAt(0) === 69))) { - s = s.substring(1); - if ((s.charCodeAt(0) === 43) || (s.charCodeAt(0) === 45)) { - s = s.substring(1); - if (s === "") { - return false; - } - } - while (true) { - if (!(s.length > 0 && 48 <= s.charCodeAt(0) && s.charCodeAt(0) <= 57)) { break; } - s = s.substring(1); - } - } - return s === ""; - }; - Marshal = function(v) { - var $ptr, _r$2, e, err, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; e = $f.e; err = $f.err; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = new encodeState.ptr(new bytes.Buffer.ptr(sliceType$2.nil, 0, arrayType.zero(), arrayType$1.zero(), 0), arrayType$1.zero()); - _r$2 = e.marshal(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - err = _r$2; - if (!($interfaceIsEqual(err, $ifaceNil))) { - return [sliceType$2.nil, err]; - } - return [e.Buffer.Bytes(), $ifaceNil]; - /* */ } return; } if ($f === undefined) { $f = { $blk: Marshal }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.e = e; $f.err = err; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.Marshal = Marshal; - UnsupportedTypeError.ptr.prototype.Error = function() { - var $ptr, _r$2, e, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _r$2 = e.Type.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return "json: unsupported type: " + _r$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: UnsupportedTypeError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; - }; - UnsupportedTypeError.prototype.Error = function() { return this.$val.Error(); }; - UnsupportedValueError.ptr.prototype.Error = function() { - var $ptr, e; - e = this; - return "json: unsupported value: " + e.Str; - }; - UnsupportedValueError.prototype.Error = function() { return this.$val.Error(); }; - MarshalerError.ptr.prototype.Error = function() { - var $ptr, _r$2, _r$3, e, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; e = $f.e; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - e = this; - _r$2 = e.Type.String(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = e.Err.Error(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ $s = 3; case 3: - return "json: error calling MarshalJSON for type " + _r$2 + ": " + _r$3; - /* */ } return; } if ($f === undefined) { $f = { $blk: MarshalerError.ptr.prototype.Error }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.e = e; $f.$s = $s; $f.$r = $r; return $f; - }; - MarshalerError.prototype.Error = function() { return this.$val.Error(); }; - encodeState.ptr.prototype.marshal = function(v) { - var $ptr, _r$2, e, err, v, $s, $deferred, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; e = $f.e; err = $f.err; v = $f.v; $s = $f.$s; $deferred = $f.$deferred; $r = $f.$r; } var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $deferred.index = $curGoroutine.deferStack.length; $curGoroutine.deferStack.push($deferred); - err = [err]; - err[0] = $ifaceNil; - e = this; - $deferred.push([(function(err) { return function() { - var $ptr, _tuple, _tuple$1, ok, ok$1, r, s; - r = $recover(); - if (!($interfaceIsEqual(r, $ifaceNil))) { - _tuple = $assertType(r, runtime.Error, true); - ok = _tuple[1]; - if (ok) { - $panic(r); - } - _tuple$1 = $assertType(r, $String, true); - s = _tuple$1[0]; - ok$1 = _tuple$1[1]; - if (ok$1) { - $panic(new $String(s)); - } - err[0] = $assertType(r, $error); - } - }; })(err), []]); - _r$2 = reflect.ValueOf(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $r = e.reflectValue(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - err[0] = $ifaceNil; - return err[0]; - /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return err[0]; } if($curGoroutine.asleep) { if ($f === undefined) { $f = { $blk: encodeState.ptr.prototype.marshal }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.e = e; $f.err = err; $f.v = v; $f.$s = $s; $f.$deferred = $deferred; $f.$r = $r; return $f; } } - }; - encodeState.prototype.marshal = function(v) { return this.$val.marshal(v); }; - encodeState.ptr.prototype.error = function(err) { - var $ptr, e, err; - e = this; - $panic(err); - }; - encodeState.prototype.error = function(err) { return this.$val.error(err); }; - isEmptyValue = function(v) { - var $ptr, _1, v, x, x$1; - v = v; - _1 = v.Kind(); - if ((_1 === (17)) || (_1 === (21)) || (_1 === (23)) || (_1 === (24))) { - return v.Len() === 0; - } else if (_1 === (1)) { - return !v.Bool(); - } else if ((_1 === (2)) || (_1 === (3)) || (_1 === (4)) || (_1 === (5)) || (_1 === (6))) { - return (x = v.Int(), (x.$high === 0 && x.$low === 0)); - } else if ((_1 === (7)) || (_1 === (8)) || (_1 === (9)) || (_1 === (10)) || (_1 === (11)) || (_1 === (12))) { - return (x$1 = v.Uint(), (x$1.$high === 0 && x$1.$low === 0)); - } else if ((_1 === (13)) || (_1 === (14))) { - return v.Float() === 0; - } else if ((_1 === (20)) || (_1 === (22))) { - return v.IsNil(); - } - return false; - }; - encodeState.ptr.prototype.reflectValue = function(v) { - var $ptr, _r$2, e, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; e = $f.e; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - e = this; - _r$2 = valueEncoder(v); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $r = _r$2(e, v, false); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: encodeState.ptr.prototype.reflectValue }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.e = e; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - encodeState.prototype.reflectValue = function(v) { return this.$val.reflectValue(v); }; - valueEncoder = function(v) { - var $ptr, _r$2, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - if (!v.IsValid()) { - return invalidValueEncoder; - } - _r$2 = typeEncoder(v.Type()); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: valueEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - typeEncoder = function(t) { - var $ptr, _entry, _key, _key$1, _r$2, f, t, wg, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _key$1 = $f._key$1; _r$2 = $f._r$2; f = $f.f; t = $f.t; wg = $f.wg; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - f = [f]; - wg = [wg]; - encoderCache.RWMutex.RLock(); - f[0] = (_entry = encoderCache.m[reflect.Type.keyFor(t)], _entry !== undefined ? _entry.v : $throwNilPointerError); - encoderCache.RWMutex.RUnlock(); - if (!(f[0] === $throwNilPointerError)) { - return f[0]; - } - encoderCache.RWMutex.Lock(); - if (encoderCache.m === false) { - encoderCache.m = {}; - } - wg[0] = new nosync.WaitGroup.ptr(0); - wg[0].Add(1); - _key = t; (encoderCache.m || $throwRuntimeError("assignment to entry in nil map"))[reflect.Type.keyFor(_key)] = { k: _key, v: (function(f, wg) { return function $b(e, v, quoted) { - var $ptr, e, quoted, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; e = $f.e; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - wg[0].Wait(); - $r = f[0](e, v, quoted); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: $b }; } $f.$ptr = $ptr; $f.e = e; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; })(f, wg) }; - encoderCache.RWMutex.Unlock(); - _r$2 = newTypeEncoder(t, true); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - f[0] = _r$2; - wg[0].Done(); - encoderCache.RWMutex.Lock(); - _key$1 = t; (encoderCache.m || $throwRuntimeError("assignment to entry in nil map"))[reflect.Type.keyFor(_key$1)] = { k: _key$1, v: f[0] }; - encoderCache.RWMutex.Unlock(); - return f[0]; - /* */ } return; } if ($f === undefined) { $f = { $blk: typeEncoder }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._key$1 = _key$1; $f._r$2 = _r$2; $f.f = f; $f.t = t; $f.wg = wg; $f.$s = $s; $f.$r = $r; return $f; - }; - newTypeEncoder = function(t, allowAddr) { - var $ptr, _2, _arg, _arg$1, _arg$2, _arg$3, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, allowAddr, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _2 = $f._2; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _arg$3 = $f._arg$3; _r$10 = $f._r$10; _r$11 = $f._r$11; _r$12 = $f._r$12; _r$13 = $f._r$13; _r$14 = $f._r$14; _r$15 = $f._r$15; _r$16 = $f._r$16; _r$17 = $f._r$17; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; allowAddr = $f.allowAddr; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$2 = t.Implements(marshalerType); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ if (_r$2) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (_r$2) { */ case 1: - return marshalerEncoder; - /* } */ case 2: - _r$3 = t.Kind(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (!((_r$3 === 22)) && allowAddr) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (!((_r$3 === 22)) && allowAddr) { */ case 4: - _r$4 = reflect.PtrTo(t).Implements(marshalerType); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - /* */ if (_r$4) { $s = 7; continue; } - /* */ $s = 8; continue; - /* if (_r$4) { */ case 7: - _arg = addrMarshalerEncoder; - _r$5 = newTypeEncoder(t, false); /* */ $s = 10; case 10: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _arg$1 = _r$5; - _r$6 = newCondAddrEncoder(_arg, _arg$1); /* */ $s = 11; case 11: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - /* */ $s = 12; case 12: - return _r$6; - /* } */ case 8: - /* } */ case 5: - _r$7 = t.Implements(textMarshalerType); /* */ $s = 15; case 15: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - /* */ if (_r$7) { $s = 13; continue; } - /* */ $s = 14; continue; - /* if (_r$7) { */ case 13: - return textMarshalerEncoder; - /* } */ case 14: - _r$8 = t.Kind(); /* */ $s = 18; case 18: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } - /* */ if (!((_r$8 === 22)) && allowAddr) { $s = 16; continue; } - /* */ $s = 17; continue; - /* if (!((_r$8 === 22)) && allowAddr) { */ case 16: - _r$9 = reflect.PtrTo(t).Implements(textMarshalerType); /* */ $s = 21; case 21: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } - /* */ if (_r$9) { $s = 19; continue; } - /* */ $s = 20; continue; - /* if (_r$9) { */ case 19: - _arg$2 = addrTextMarshalerEncoder; - _r$10 = newTypeEncoder(t, false); /* */ $s = 22; case 22: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } - _arg$3 = _r$10; - _r$11 = newCondAddrEncoder(_arg$2, _arg$3); /* */ $s = 23; case 23: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; } - /* */ $s = 24; case 24: - return _r$11; - /* } */ case 20: - /* } */ case 17: - _r$12 = t.Kind(); /* */ $s = 26; case 26: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; } - _2 = _r$12; - /* */ if (_2 === (1)) { $s = 27; continue; } - /* */ if ((_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6))) { $s = 28; continue; } - /* */ if ((_2 === (7)) || (_2 === (8)) || (_2 === (9)) || (_2 === (10)) || (_2 === (11)) || (_2 === (12))) { $s = 29; continue; } - /* */ if (_2 === (13)) { $s = 30; continue; } - /* */ if (_2 === (14)) { $s = 31; continue; } - /* */ if (_2 === (24)) { $s = 32; continue; } - /* */ if (_2 === (20)) { $s = 33; continue; } - /* */ if (_2 === (25)) { $s = 34; continue; } - /* */ if (_2 === (21)) { $s = 35; continue; } - /* */ if (_2 === (23)) { $s = 36; continue; } - /* */ if (_2 === (17)) { $s = 37; continue; } - /* */ if (_2 === (22)) { $s = 38; continue; } - /* */ $s = 39; continue; - /* if (_2 === (1)) { */ case 27: - return boolEncoder; - /* } else if ((_2 === (2)) || (_2 === (3)) || (_2 === (4)) || (_2 === (5)) || (_2 === (6))) { */ case 28: - return intEncoder; - /* } else if ((_2 === (7)) || (_2 === (8)) || (_2 === (9)) || (_2 === (10)) || (_2 === (11)) || (_2 === (12))) { */ case 29: - return uintEncoder; - /* } else if (_2 === (13)) { */ case 30: - return float32Encoder; - /* } else if (_2 === (14)) { */ case 31: - return float64Encoder; - /* } else if (_2 === (24)) { */ case 32: - return stringEncoder; - /* } else if (_2 === (20)) { */ case 33: - return interfaceEncoder; - /* } else if (_2 === (25)) { */ case 34: - _r$13 = newStructEncoder(t); /* */ $s = 41; case 41: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; } - /* */ $s = 42; case 42: - return _r$13; - /* } else if (_2 === (21)) { */ case 35: - _r$14 = newMapEncoder(t); /* */ $s = 43; case 43: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; } - /* */ $s = 44; case 44: - return _r$14; - /* } else if (_2 === (23)) { */ case 36: - _r$15 = newSliceEncoder(t); /* */ $s = 45; case 45: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; } - /* */ $s = 46; case 46: - return _r$15; - /* } else if (_2 === (17)) { */ case 37: - _r$16 = newArrayEncoder(t); /* */ $s = 47; case 47: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; } - /* */ $s = 48; case 48: - return _r$16; - /* } else if (_2 === (22)) { */ case 38: - _r$17 = newPtrEncoder(t); /* */ $s = 49; case 49: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; } - /* */ $s = 50; case 50: - return _r$17; - /* } else { */ case 39: - return unsupportedTypeEncoder; - /* } */ case 40: - case 25: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: newTypeEncoder }; } $f.$ptr = $ptr; $f._2 = _2; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._arg$3 = _arg$3; $f._r$10 = _r$10; $f._r$11 = _r$11; $f._r$12 = _r$12; $f._r$13 = _r$13; $f._r$14 = _r$14; $f._r$15 = _r$15; $f._r$16 = _r$16; $f._r$17 = _r$17; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f.allowAddr = allowAddr; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - invalidValueEncoder = function(e, v, quoted) { - var $ptr, e, quoted, v; - v = v; - e.Buffer.WriteString("null"); - }; - marshalerEncoder = function(e, v, quoted) { - var $ptr, _r$2, _r$3, _r$4, _tuple, b, e, err, m, quoted, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - if ((v.Kind() === 22) && v.IsNil()) { - e.Buffer.WriteString("null"); - return; - } - _r$2 = v.Interface(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - m = $assertType(_r$2, Marshaler); - _r$3 = m.MarshalJSON(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _tuple = _r$3; - b = _tuple[0]; - err = _tuple[1]; - /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 3: - _r$4 = compact(e.Buffer, b, true); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - err = _r$4; - /* } */ case 4: - if (!($interfaceIsEqual(err, $ifaceNil))) { - e.error(new MarshalerError.ptr(v.Type(), err)); - } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: marshalerEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - addrMarshalerEncoder = function(e, v, quoted) { - var $ptr, _r$2, _r$3, _r$4, _tuple, b, e, err, m, quoted, v, va, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; quoted = $f.quoted; v = $f.v; va = $f.va; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - va = v.Addr(); - if (va.IsNil()) { - e.Buffer.WriteString("null"); - return; - } - _r$2 = va.Interface(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - m = $assertType(_r$2, Marshaler); - _r$3 = m.MarshalJSON(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _tuple = _r$3; - b = _tuple[0]; - err = _tuple[1]; - /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 3: - _r$4 = compact(e.Buffer, b, true); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - err = _r$4; - /* } */ case 4: - if (!($interfaceIsEqual(err, $ifaceNil))) { - e.error(new MarshalerError.ptr(v.Type(), err)); - } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: addrMarshalerEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.quoted = quoted; $f.v = v; $f.va = va; $f.$s = $s; $f.$r = $r; return $f; - }; - textMarshalerEncoder = function(e, v, quoted) { - var $ptr, _r$2, _r$3, _tuple, b, e, err, m, quoted, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - if ((v.Kind() === 22) && v.IsNil()) { - e.Buffer.WriteString("null"); - return; - } - _r$2 = v.Interface(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - m = $assertType(_r$2, encoding.TextMarshaler); - _r$3 = m.MarshalText(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _tuple = _r$3; - b = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - e.error(new MarshalerError.ptr(v.Type(), err)); - } - e.stringBytes(b); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: textMarshalerEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - addrTextMarshalerEncoder = function(e, v, quoted) { - var $ptr, _r$2, _r$3, _tuple, b, e, err, m, quoted, v, va, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _tuple = $f._tuple; b = $f.b; e = $f.e; err = $f.err; m = $f.m; quoted = $f.quoted; v = $f.v; va = $f.va; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - va = v.Addr(); - if (va.IsNil()) { - e.Buffer.WriteString("null"); - return; - } - _r$2 = va.Interface(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - m = $assertType(_r$2, encoding.TextMarshaler); - _r$3 = m.MarshalText(); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _tuple = _r$3; - b = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - e.error(new MarshalerError.ptr(v.Type(), err)); - } - e.stringBytes(b); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: addrTextMarshalerEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._tuple = _tuple; $f.b = b; $f.e = e; $f.err = err; $f.m = m; $f.quoted = quoted; $f.v = v; $f.va = va; $f.$s = $s; $f.$r = $r; return $f; - }; - boolEncoder = function(e, v, quoted) { - var $ptr, e, quoted, v; - v = v; - if (quoted) { - e.Buffer.WriteByte(34); - } - if (v.Bool()) { - e.Buffer.WriteString("true"); - } else { - e.Buffer.WriteString("false"); - } - if (quoted) { - e.Buffer.WriteByte(34); - } - }; - intEncoder = function(e, v, quoted) { - var $ptr, b, e, quoted, v; - v = v; - b = strconv.AppendInt($subslice(new sliceType$2(e.scratch), 0, 0), v.Int(), 10); - if (quoted) { - e.Buffer.WriteByte(34); - } - e.Buffer.Write(b); - if (quoted) { - e.Buffer.WriteByte(34); - } - }; - uintEncoder = function(e, v, quoted) { - var $ptr, b, e, quoted, v; - v = v; - b = strconv.AppendUint($subslice(new sliceType$2(e.scratch), 0, 0), v.Uint(), 10); - if (quoted) { - e.Buffer.WriteByte(34); - } - e.Buffer.Write(b); - if (quoted) { - e.Buffer.WriteByte(34); - } - }; - floatEncoder.prototype.encode = function(e, v, quoted) { - var $ptr, b, bits, e, f, quoted, v; - v = v; - bits = this.$val; - f = v.Float(); - if (math.IsInf(f, 0) || math.IsNaN(f)) { - e.error(new UnsupportedValueError.ptr($clone(v, reflect.Value), strconv.FormatFloat(f, 103, -1, (bits >> 0)))); - } - b = strconv.AppendFloat($subslice(new sliceType$2(e.scratch), 0, 0), f, 103, -1, (bits >> 0)); - if (quoted) { - e.Buffer.WriteByte(34); - } - e.Buffer.Write(b); - if (quoted) { - e.Buffer.WriteByte(34); - } - }; - $ptrType(floatEncoder).prototype.encode = function(e, v, quoted) { return new floatEncoder(this.$get()).encode(e, v, quoted); }; - stringEncoder = function(e, v, quoted) { - var $ptr, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _tuple, e, err, numStr, quoted, sb, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _tuple = $f._tuple; e = $f.e; err = $f.err; numStr = $f.numStr; quoted = $f.quoted; sb = $f.sb; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - /* */ if ($interfaceIsEqual(v.Type(), numberType)) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if ($interfaceIsEqual(v.Type(), numberType)) { */ case 1: - _r$2 = v.String(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - numStr = _r$2; - if (numStr === "") { - numStr = "0"; - } - /* */ if (!isValidNumber(numStr)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (!isValidNumber(numStr)) { */ case 4: - _r$3 = fmt.Errorf("json: invalid number literal %q", new sliceType([new $String(numStr)])); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - $r = e.error(_r$3); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 5: - e.Buffer.WriteString(numStr); - return; - /* } */ case 2: - /* */ if (quoted) { $s = 8; continue; } - /* */ $s = 9; continue; - /* if (quoted) { */ case 8: - _r$4 = v.String(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _r$5 = Marshal(new $String(_r$4)); /* */ $s = 12; case 12: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _tuple = _r$5; - sb = _tuple[0]; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - e.error(err); - } - e.string($bytesToString(sb)); - $s = 10; continue; - /* } else { */ case 9: - _r$6 = v.String(); /* */ $s = 13; case 13: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - _r$7 = e.string(_r$6); /* */ $s = 14; case 14: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - _r$7; - /* } */ case 10: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: stringEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._tuple = _tuple; $f.e = e; $f.err = err; $f.numStr = numStr; $f.quoted = quoted; $f.sb = sb; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - interfaceEncoder = function(e, v, quoted) { - var $ptr, _r$2, e, quoted, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; e = $f.e; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - if (v.IsNil()) { - e.Buffer.WriteString("null"); - return; - } - _r$2 = v.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - $r = e.reflectValue(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: interfaceEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.e = e; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - unsupportedTypeEncoder = function(e, v, quoted) { - var $ptr, e, quoted, v; - v = v; - e.error(new UnsupportedTypeError.ptr(v.Type())); - }; - structEncoder.ptr.prototype.encode = function(e, v, quoted) { - var $ptr, _i, _r$2, _ref, e, f, first, fv, i, quoted, se, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r$2 = $f._r$2; _ref = $f._ref; e = $f.e; f = $f.f; first = $f.first; fv = $f.fv; i = $f.i; quoted = $f.quoted; se = $f.se; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - se = this; - e.Buffer.WriteByte(123); - first = true; - _ref = se.fields; - _i = 0; - /* while (true) { */ case 1: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } - i = _i; - f = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), field); - _r$2 = fieldByIndex(v, f.index); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - fv = _r$2; - /* */ if (!fv.IsValid() || f.omitEmpty && isEmptyValue(fv)) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (!fv.IsValid() || f.omitEmpty && isEmptyValue(fv)) { */ case 4: - _i++; - /* continue; */ $s = 1; continue; - /* } */ case 5: - if (first) { - first = false; - } else { - e.Buffer.WriteByte(44); - } - e.string(f.name); - e.Buffer.WriteByte(58); - $r = (x = se.fieldEncs, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]))(e, fv, f.quoted); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _i++; - /* } */ $s = 1; continue; case 2: - e.Buffer.WriteByte(125); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: structEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f._i = _i; $f._r$2 = _r$2; $f._ref = _ref; $f.e = e; $f.f = f; $f.first = first; $f.fv = fv; $f.i = i; $f.quoted = quoted; $f.se = se; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - structEncoder.prototype.encode = function(e, v, quoted) { return this.$val.encode(e, v, quoted); }; - newStructEncoder = function(t) { - var $ptr, _i, _r$2, _r$3, _r$4, _ref, f, fields, i, se, t, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; f = $f.f; fields = $f.fields; i = $f.i; se = $f.se; t = $f.t; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$2 = cachedTypeFields(t); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - fields = _r$2; - se = new structEncoder.ptr(fields, $makeSlice(sliceType$4, fields.$length)); - _ref = fields; - _i = 0; - /* while (true) { */ case 2: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 3; continue; } - i = _i; - f = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), field); - _r$3 = typeByIndex(t, f.index); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$4 = typeEncoder(_r$3); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - (x = se.fieldEncs, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i] = _r$4)); - _i++; - /* } */ $s = 2; continue; case 3: - return $methodVal(se, "encode"); - /* */ } return; } if ($f === undefined) { $f = { $blk: newStructEncoder }; } $f.$ptr = $ptr; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f.f = f; $f.fields = fields; $f.i = i; $f.se = se; $f.t = t; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - mapEncoder.ptr.prototype.encode = function(e, v, param) { - var $ptr, _arg, _arg$1, _i, _r$2, _r$3, _r$4, _r$5, _ref, e, i, k, me, param, sv, v, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _ref = $f._ref; e = $f.e; i = $f.i; k = $f.k; me = $f.me; param = $f.param; sv = $f.sv; v = $f.v; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - me = this; - if (v.IsNil()) { - e.Buffer.WriteString("null"); - return; - } - e.Buffer.WriteByte(123); - _r$2 = v.MapKeys(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - sv = (x = _r$2, $subslice(new stringValues(x.$array), x.$offset, x.$offset + x.$length)); - $r = sort.Sort(sv); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _ref = sv; - _i = 0; - /* while (true) { */ case 3: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } - i = _i; - k = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (i > 0) { - e.Buffer.WriteByte(44); - } - _r$3 = k.String(); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$4 = e.string(_r$3); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _r$4; - e.Buffer.WriteByte(58); - _arg = e; - _r$5 = v.MapIndex(k); /* */ $s = 7; case 7: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _arg$1 = _r$5; - $r = me.elemEnc(_arg, _arg$1, false); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - _i++; - /* } */ $s = 3; continue; case 4: - e.Buffer.WriteByte(125); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: mapEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._ref = _ref; $f.e = e; $f.i = i; $f.k = k; $f.me = me; $f.param = param; $f.sv = sv; $f.v = v; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - mapEncoder.prototype.encode = function(e, v, param) { return this.$val.encode(e, v, param); }; - newMapEncoder = function(t) { - var $ptr, _r$2, _r$3, _r$4, _r$5, me, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; me = $f.me; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$2 = t.Key(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = _r$2.Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (!((_r$3 === 24))) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (!((_r$3 === 24))) { */ case 1: - return unsupportedTypeEncoder; - /* } */ case 2: - _r$4 = t.Elem(); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _r$5 = typeEncoder(_r$4); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - me = new mapEncoder.ptr(_r$5); - return $methodVal(me, "encode"); - /* */ } return; } if ($f === undefined) { $f = { $blk: newMapEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f.me = me; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - encodeByteSlice = function(e, v, param) { - var $ptr, _r$2, _r$3, _r$4, dst, e, enc, param, s, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; dst = $f.dst; e = $f.e; enc = $f.enc; param = $f.param; s = $f.s; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - if (v.IsNil()) { - e.Buffer.WriteString("null"); - return; - } - _r$2 = v.Bytes(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - s = _r$2; - e.Buffer.WriteByte(34); - /* */ if (s.$length < 1024) { $s = 2; continue; } - /* */ $s = 3; continue; - /* if (s.$length < 1024) { */ case 2: - dst = $makeSlice(sliceType$2, base64.StdEncoding.EncodedLen(s.$length)); - base64.StdEncoding.Encode(dst, s); - e.Buffer.Write(dst); - $s = 4; continue; - /* } else { */ case 3: - enc = base64.NewEncoder(base64.StdEncoding, e); - _r$3 = enc.Write(s); /* */ $s = 5; case 5: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - _r$3; - _r$4 = enc.Close(); /* */ $s = 6; case 6: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - _r$4; - /* } */ case 4: - e.Buffer.WriteByte(34); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: encodeByteSlice }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.dst = dst; $f.e = e; $f.enc = enc; $f.param = param; $f.s = s; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - sliceEncoder.ptr.prototype.encode = function(e, v, param) { - var $ptr, e, param, se, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; e = $f.e; param = $f.param; se = $f.se; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - se = this; - if (v.IsNil()) { - e.Buffer.WriteString("null"); - return; - } - $r = se.arrayEnc(e, v, false); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: sliceEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f.e = e; $f.param = param; $f.se = se; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - sliceEncoder.prototype.encode = function(e, v, param) { return this.$val.encode(e, v, param); }; - newSliceEncoder = function(t) { - var $ptr, _r$2, _r$3, _r$4, enc, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; enc = $f.enc; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$2 = t.Elem(); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = _r$2.Kind(); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (_r$3 === 8) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (_r$3 === 8) { */ case 1: - return encodeByteSlice; - /* } */ case 2: - _r$4 = newArrayEncoder(t); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - enc = new sliceEncoder.ptr(_r$4); - return $methodVal(enc, "encode"); - /* */ } return; } if ($f === undefined) { $f = { $blk: newSliceEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f.enc = enc; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - arrayEncoder.ptr.prototype.encode = function(e, v, param) { - var $ptr, _arg, _arg$1, _r$2, ae, e, i, n, param, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _r$2 = $f._r$2; ae = $f.ae; e = $f.e; i = $f.i; n = $f.n; param = $f.param; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - ae = this; - e.Buffer.WriteByte(91); - n = v.Len(); - i = 0; - /* while (true) { */ case 1: - /* if (!(i < n)) { break; } */ if(!(i < n)) { $s = 2; continue; } - if (i > 0) { - e.Buffer.WriteByte(44); - } - _arg = e; - _r$2 = v.Index(i); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _arg$1 = _r$2; - $r = ae.elemEnc(_arg, _arg$1, false); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - i = i + (1) >> 0; - /* } */ $s = 1; continue; case 2: - e.Buffer.WriteByte(93); - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: arrayEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._r$2 = _r$2; $f.ae = ae; $f.e = e; $f.i = i; $f.n = n; $f.param = param; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - arrayEncoder.prototype.encode = function(e, v, param) { return this.$val.encode(e, v, param); }; - newArrayEncoder = function(t) { - var $ptr, _r$2, _r$3, enc, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; enc = $f.enc; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$2 = t.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = typeEncoder(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - enc = new arrayEncoder.ptr(_r$3); - return $methodVal(enc, "encode"); - /* */ } return; } if ($f === undefined) { $f = { $blk: newArrayEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.enc = enc; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - ptrEncoder.ptr.prototype.encode = function(e, v, quoted) { - var $ptr, _arg, _arg$1, _arg$2, _r$2, e, pe, quoted, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _arg = $f._arg; _arg$1 = $f._arg$1; _arg$2 = $f._arg$2; _r$2 = $f._r$2; e = $f.e; pe = $f.pe; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - pe = this; - if (v.IsNil()) { - e.Buffer.WriteString("null"); - return; - } - _arg = e; - _r$2 = v.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _arg$1 = _r$2; - _arg$2 = quoted; - $r = pe.elemEnc(_arg, _arg$1, _arg$2); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: ptrEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f._arg = _arg; $f._arg$1 = _arg$1; $f._arg$2 = _arg$2; $f._r$2 = _r$2; $f.e = e; $f.pe = pe; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - ptrEncoder.prototype.encode = function(e, v, quoted) { return this.$val.encode(e, v, quoted); }; - newPtrEncoder = function(t) { - var $ptr, _r$2, _r$3, enc, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; enc = $f.enc; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _r$2 = t.Elem(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = typeEncoder(_r$2); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - enc = new ptrEncoder.ptr(_r$3); - return $methodVal(enc, "encode"); - /* */ } return; } if ($f === undefined) { $f = { $blk: newPtrEncoder }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.enc = enc; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - condAddrEncoder.ptr.prototype.encode = function(e, v, quoted) { - var $ptr, ce, e, quoted, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; ce = $f.ce; e = $f.e; quoted = $f.quoted; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - ce = this; - /* */ if (v.CanAddr()) { $s = 1; continue; } - /* */ $s = 2; continue; - /* if (v.CanAddr()) { */ case 1: - $r = ce.canAddrEnc(e, v, quoted); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $s = 3; continue; - /* } else { */ case 2: - $r = ce.elseEnc(e, v, quoted); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* } */ case 3: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: condAddrEncoder.ptr.prototype.encode }; } $f.$ptr = $ptr; $f.ce = ce; $f.e = e; $f.quoted = quoted; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - condAddrEncoder.prototype.encode = function(e, v, quoted) { return this.$val.encode(e, v, quoted); }; - newCondAddrEncoder = function(canAddrEnc, elseEnc) { - var $ptr, canAddrEnc, elseEnc, enc; - enc = new condAddrEncoder.ptr(canAddrEnc, elseEnc); - return $methodVal(enc, "encode"); - }; - isValidTag = function(s) { - var $ptr, _i, _ref, _rune, c, s; - if (s === "") { - return false; - } - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.length)) { break; } - _rune = $decodeRune(_ref, _i); - c = _rune[0]; - if (strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~ ", c)) { - } else if (!unicode.IsLetter(c) && !unicode.IsDigit(c)) { - return false; - } - _i += _rune[1]; - } - return true; - }; - fieldByIndex = function(v, index) { - var $ptr, _i, _r$2, _r$3, _ref, i, index, v, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; i = $f.i; index = $f.index; v = $f.v; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - v = v; - _ref = index; - _i = 0; - /* while (true) { */ case 1: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } - i = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - /* */ if (v.Kind() === 22) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (v.Kind() === 22) { */ case 3: - if (v.IsNil()) { - return new reflect.Value.ptr(ptrType$2.nil, 0, 0); - } - _r$2 = v.Elem(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - v = _r$2; - /* } */ case 4: - _r$3 = v.Field(i); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - v = _r$3; - _i++; - /* } */ $s = 1; continue; case 2: - return v; - /* */ } return; } if ($f === undefined) { $f = { $blk: fieldByIndex }; } $f.$ptr = $ptr; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f.i = i; $f.index = index; $f.v = v; $f.$s = $s; $f.$r = $r; return $f; - }; - typeByIndex = function(t, index) { - var $ptr, _i, _r$2, _r$3, _r$4, _ref, i, index, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _ref = $f._ref; i = $f.i; index = $f.index; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - _ref = index; - _i = 0; - /* while (true) { */ case 1: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } - i = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - _r$2 = t.Kind(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ if (_r$2 === 22) { $s = 3; continue; } - /* */ $s = 4; continue; - /* if (_r$2 === 22) { */ case 3: - _r$3 = t.Elem(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - t = _r$3; - /* } */ case 4: - _r$4 = t.Field(i); /* */ $s = 7; case 7: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - t = _r$4.Type; - _i++; - /* } */ $s = 1; continue; case 2: - return t; - /* */ } return; } if ($f === undefined) { $f = { $blk: typeByIndex }; } $f.$ptr = $ptr; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._ref = _ref; $f.i = i; $f.index = index; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - stringValues.prototype.Len = function() { - var $ptr, sv; - sv = this; - return sv.$length; - }; - $ptrType(stringValues).prototype.Len = function() { return this.$get().Len(); }; - stringValues.prototype.Swap = function(i, j) { - var $ptr, _tmp, _tmp$1, i, j, sv; - sv = this; - _tmp = ((j < 0 || j >= sv.$length) ? $throwRuntimeError("index out of range") : sv.$array[sv.$offset + j]); - _tmp$1 = ((i < 0 || i >= sv.$length) ? $throwRuntimeError("index out of range") : sv.$array[sv.$offset + i]); - ((i < 0 || i >= sv.$length) ? $throwRuntimeError("index out of range") : sv.$array[sv.$offset + i] = _tmp); - ((j < 0 || j >= sv.$length) ? $throwRuntimeError("index out of range") : sv.$array[sv.$offset + j] = _tmp$1); - }; - $ptrType(stringValues).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; - stringValues.prototype.Less = function(i, j) { - var $ptr, _r$2, _r$3, i, j, sv, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; _r$3 = $f._r$3; i = $f.i; j = $f.j; sv = $f.sv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - sv = this; - _r$2 = sv.get(i); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$3 = sv.get(j); /* */ $s = 2; case 2: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ $s = 3; case 3: - return _r$2 < _r$3; - /* */ } return; } if ($f === undefined) { $f = { $blk: stringValues.prototype.Less }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f._r$3 = _r$3; $f.i = i; $f.j = j; $f.sv = sv; $f.$s = $s; $f.$r = $r; return $f; - }; - $ptrType(stringValues).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; - stringValues.prototype.get = function(i) { - var $ptr, _r$2, i, sv, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; i = $f.i; sv = $f.sv; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - sv = this; - _r$2 = ((i < 0 || i >= sv.$length) ? $throwRuntimeError("index out of range") : sv.$array[sv.$offset + i]).String(); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r$2; - /* */ } return; } if ($f === undefined) { $f = { $blk: stringValues.prototype.get }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.i = i; $f.sv = sv; $f.$s = $s; $f.$r = $r; return $f; - }; - $ptrType(stringValues).prototype.get = function(i) { return this.$get().get(i); }; - encodeState.ptr.prototype.string = function(s) { - var $ptr, _3, _tuple, b, c, e, i, len0, s, size, start; - e = this; - len0 = e.Buffer.Len(); - e.Buffer.WriteByte(34); - start = 0; - i = 0; - while (true) { - if (!(i < s.length)) { break; } - b = s.charCodeAt(i); - if (b < 128) { - if (32 <= b && !((b === 92)) && !((b === 34)) && !((b === 60)) && !((b === 62)) && !((b === 38))) { - i = i + (1) >> 0; - continue; - } - if (start < i) { - e.Buffer.WriteString(s.substring(start, i)); - } - _3 = b; - if ((_3 === (92)) || (_3 === (34))) { - e.Buffer.WriteByte(92); - e.Buffer.WriteByte(b); - } else if (_3 === (10)) { - e.Buffer.WriteByte(92); - e.Buffer.WriteByte(110); - } else if (_3 === (13)) { - e.Buffer.WriteByte(92); - e.Buffer.WriteByte(114); - } else if (_3 === (9)) { - e.Buffer.WriteByte(92); - e.Buffer.WriteByte(116); - } else { - e.Buffer.WriteString("\\u00"); - e.Buffer.WriteByte(hex.charCodeAt((b >>> 4 << 24 >>> 24))); - e.Buffer.WriteByte(hex.charCodeAt(((b & 15) >>> 0))); - } - i = i + (1) >> 0; - start = i; - continue; - } - _tuple = utf8.DecodeRuneInString(s.substring(i)); - c = _tuple[0]; - size = _tuple[1]; - if ((c === 65533) && (size === 1)) { - if (start < i) { - e.Buffer.WriteString(s.substring(start, i)); - } - e.Buffer.WriteString("\\ufffd"); - i = i + (size) >> 0; - start = i; - continue; - } - if ((c === 8232) || (c === 8233)) { - if (start < i) { - e.Buffer.WriteString(s.substring(start, i)); - } - e.Buffer.WriteString("\\u202"); - e.Buffer.WriteByte(hex.charCodeAt((c & 15))); - i = i + (size) >> 0; - start = i; - continue; - } - i = i + (size) >> 0; - } - if (start < s.length) { - e.Buffer.WriteString(s.substring(start)); - } - e.Buffer.WriteByte(34); - return e.Buffer.Len() - len0 >> 0; - }; - encodeState.prototype.string = function(s) { return this.$val.string(s); }; - encodeState.ptr.prototype.stringBytes = function(s) { - var $ptr, _4, _tuple, b, c, e, i, len0, s, size, start; - e = this; - len0 = e.Buffer.Len(); - e.Buffer.WriteByte(34); - start = 0; - i = 0; - while (true) { - if (!(i < s.$length)) { break; } - b = ((i < 0 || i >= s.$length) ? $throwRuntimeError("index out of range") : s.$array[s.$offset + i]); - if (b < 128) { - if (32 <= b && !((b === 92)) && !((b === 34)) && !((b === 60)) && !((b === 62)) && !((b === 38))) { - i = i + (1) >> 0; - continue; - } - if (start < i) { - e.Buffer.Write($subslice(s, start, i)); - } - _4 = b; - if ((_4 === (92)) || (_4 === (34))) { - e.Buffer.WriteByte(92); - e.Buffer.WriteByte(b); - } else if (_4 === (10)) { - e.Buffer.WriteByte(92); - e.Buffer.WriteByte(110); - } else if (_4 === (13)) { - e.Buffer.WriteByte(92); - e.Buffer.WriteByte(114); - } else if (_4 === (9)) { - e.Buffer.WriteByte(92); - e.Buffer.WriteByte(116); - } else { - e.Buffer.WriteString("\\u00"); - e.Buffer.WriteByte(hex.charCodeAt((b >>> 4 << 24 >>> 24))); - e.Buffer.WriteByte(hex.charCodeAt(((b & 15) >>> 0))); - } - i = i + (1) >> 0; - start = i; - continue; - } - _tuple = utf8.DecodeRune($subslice(s, i)); - c = _tuple[0]; - size = _tuple[1]; - if ((c === 65533) && (size === 1)) { - if (start < i) { - e.Buffer.Write($subslice(s, start, i)); - } - e.Buffer.WriteString("\\ufffd"); - i = i + (size) >> 0; - start = i; - continue; - } - if ((c === 8232) || (c === 8233)) { - if (start < i) { - e.Buffer.Write($subslice(s, start, i)); - } - e.Buffer.WriteString("\\u202"); - e.Buffer.WriteByte(hex.charCodeAt((c & 15))); - i = i + (size) >> 0; - start = i; - continue; - } - i = i + (size) >> 0; - } - if (start < s.$length) { - e.Buffer.Write($subslice(s, start)); - } - e.Buffer.WriteByte(34); - return e.Buffer.Len() - len0 >> 0; - }; - encodeState.prototype.stringBytes = function(s) { return this.$val.stringBytes(s); }; - fillField = function(f) { - var $ptr, f; - f = $clone(f, field); - f.nameBytes = new sliceType$2($stringToBytes(f.name)); - f.equalFold = foldFunc(f.nameBytes); - return f; - }; - byName.prototype.Len = function() { - var $ptr, x; - x = this; - return x.$length; - }; - $ptrType(byName).prototype.Len = function() { return this.$get().Len(); }; - byName.prototype.Swap = function(i, j) { - var $ptr, _tmp, _tmp$1, i, j, x; - x = this; - _tmp = $clone(((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]), field); - _tmp$1 = $clone(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), field); - field.copy(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), _tmp); - field.copy(((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]), _tmp$1); - }; - $ptrType(byName).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; - byName.prototype.Less = function(i, j) { - var $ptr, i, j, x; - x = this; - if (!(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).name === ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).name)) { - return ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).name < ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).name; - } - if (!((((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).index.$length === ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index.$length))) { - return ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).index.$length < ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index.$length; - } - if (!(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).tag === ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).tag)) { - return ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).tag; - } - return $subslice(new byIndex(x.$array), x.$offset, x.$offset + x.$length).Less(i, j); - }; - $ptrType(byName).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; - byIndex.prototype.Len = function() { - var $ptr, x; - x = this; - return x.$length; - }; - $ptrType(byIndex).prototype.Len = function() { return this.$get().Len(); }; - byIndex.prototype.Swap = function(i, j) { - var $ptr, _tmp, _tmp$1, i, j, x; - x = this; - _tmp = $clone(((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]), field); - _tmp$1 = $clone(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), field); - field.copy(((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]), _tmp); - field.copy(((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]), _tmp$1); - }; - $ptrType(byIndex).prototype.Swap = function(i, j) { return this.$get().Swap(i, j); }; - byIndex.prototype.Less = function(i, j) { - var $ptr, _i, _ref, i, j, k, x, x$1, x$2, xik; - x = this; - _ref = ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).index; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - k = _i; - xik = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (k >= ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index.$length) { - return false; - } - if (!((xik === (x$1 = ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index, ((k < 0 || k >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + k]))))) { - return xik < (x$2 = ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index, ((k < 0 || k >= x$2.$length) ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + k])); - } - _i++; - } - return ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i]).index.$length < ((j < 0 || j >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + j]).index.$length; - }; - $ptrType(byIndex).prototype.Less = function(i, j) { return this.$get().Less(i, j); }; - typeFields = function(t) { - var $ptr, _5, _entry, _entry$1, _entry$2, _entry$3, _i, _key, _key$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, _tmp, _tmp$1, _tmp$2, _tmp$3, _tmp$4, _tmp$5, _tuple, _tuple$1, _v, _v$1, advance, count, current, dominant, f, fi, fields, fj, ft, i, i$1, index, name, name$1, next, nextCount, ok, opts, out, quoted, sf, t, tag, tagged, visited, x, x$1, x$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _5 = $f._5; _entry = $f._entry; _entry$1 = $f._entry$1; _entry$2 = $f._entry$2; _entry$3 = $f._entry$3; _i = $f._i; _key = $f._key; _key$1 = $f._key$1; _r$10 = $f._r$10; _r$2 = $f._r$2; _r$3 = $f._r$3; _r$4 = $f._r$4; _r$5 = $f._r$5; _r$6 = $f._r$6; _r$7 = $f._r$7; _r$8 = $f._r$8; _r$9 = $f._r$9; _ref = $f._ref; _tmp = $f._tmp; _tmp$1 = $f._tmp$1; _tmp$2 = $f._tmp$2; _tmp$3 = $f._tmp$3; _tmp$4 = $f._tmp$4; _tmp$5 = $f._tmp$5; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; _v = $f._v; _v$1 = $f._v$1; advance = $f.advance; count = $f.count; current = $f.current; dominant = $f.dominant; f = $f.f; fi = $f.fi; fields = $f.fields; fj = $f.fj; ft = $f.ft; i = $f.i; i$1 = $f.i$1; index = $f.index; name = $f.name; name$1 = $f.name$1; next = $f.next; nextCount = $f.nextCount; ok = $f.ok; opts = $f.opts; out = $f.out; quoted = $f.quoted; sf = $f.sf; t = $f.t; tag = $f.tag; tagged = $f.tagged; visited = $f.visited; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - current = new sliceType$1([]); - next = new sliceType$1([new field.ptr("", sliceType$2.nil, $throwNilPointerError, false, sliceType$3.nil, t, false, false)]); - count = $makeMap(reflect.Type.keyFor, []); - nextCount = $makeMap(reflect.Type.keyFor, []); - visited = $makeMap(reflect.Type.keyFor, []); - fields = sliceType$1.nil; - /* while (true) { */ case 1: - /* if (!(next.$length > 0)) { break; } */ if(!(next.$length > 0)) { $s = 2; continue; } - _tmp = next; - _tmp$1 = $subslice(current, 0, 0); - current = _tmp; - next = _tmp$1; - _tmp$2 = nextCount; - _tmp$3 = $makeMap(reflect.Type.keyFor, []); - count = _tmp$2; - nextCount = _tmp$3; - _ref = current; - _i = 0; - /* while (true) { */ case 3: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 4; continue; } - f = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), field); - /* */ if ((_entry = visited[reflect.Type.keyFor(f.typ)], _entry !== undefined ? _entry.v : false)) { $s = 5; continue; } - /* */ $s = 6; continue; - /* if ((_entry = visited[reflect.Type.keyFor(f.typ)], _entry !== undefined ? _entry.v : false)) { */ case 5: - _i++; - /* continue; */ $s = 3; continue; - /* } */ case 6: - _key = f.typ; (visited || $throwRuntimeError("assignment to entry in nil map"))[reflect.Type.keyFor(_key)] = { k: _key, v: true }; - i = 0; - /* while (true) { */ case 7: - _r$2 = f.typ.NumField(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - /* if (!(i < _r$2)) { break; } */ if(!(i < _r$2)) { $s = 8; continue; } - _r$3 = f.typ.Field(i); /* */ $s = 10; case 10: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - sf = $clone(_r$3, reflect.StructField); - /* */ if (!(sf.PkgPath === "") && !sf.Anonymous) { $s = 11; continue; } - /* */ $s = 12; continue; - /* if (!(sf.PkgPath === "") && !sf.Anonymous) { */ case 11: - i = i + (1) >> 0; - /* continue; */ $s = 7; continue; - /* } */ case 12: - tag = new reflect.StructTag(sf.Tag).Get("json"); - /* */ if (tag === "-") { $s = 13; continue; } - /* */ $s = 14; continue; - /* if (tag === "-") { */ case 13: - i = i + (1) >> 0; - /* continue; */ $s = 7; continue; - /* } */ case 14: - _tuple = parseTag(tag); - name = _tuple[0]; - opts = _tuple[1]; - if (!isValidTag(name)) { - name = ""; - } - index = $makeSlice(sliceType$3, (f.index.$length + 1 >> 0)); - $copySlice(index, f.index); - (x = f.index.$length, ((x < 0 || x >= index.$length) ? $throwRuntimeError("index out of range") : index.$array[index.$offset + x] = i)); - ft = sf.Type; - _r$4 = ft.Name(); /* */ $s = 18; case 18: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; } - if (!(_r$4 === "")) { _v = false; $s = 17; continue s; } - _r$5 = ft.Kind(); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; } - _v = _r$5 === 22; case 17: - /* */ if (_v) { $s = 15; continue; } - /* */ $s = 16; continue; - /* if (_v) { */ case 15: - _r$6 = ft.Elem(); /* */ $s = 20; case 20: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; } - ft = _r$6; - /* } */ case 16: - quoted = false; - /* */ if (new tagOptions(opts).Contains("string")) { $s = 21; continue; } - /* */ $s = 22; continue; - /* if (new tagOptions(opts).Contains("string")) { */ case 21: - _r$7 = ft.Kind(); /* */ $s = 24; case 24: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; } - _5 = _r$7; - if ((_5 === (1)) || (_5 === (2)) || (_5 === (3)) || (_5 === (4)) || (_5 === (5)) || (_5 === (6)) || (_5 === (7)) || (_5 === (8)) || (_5 === (9)) || (_5 === (10)) || (_5 === (11)) || (_5 === (13)) || (_5 === (14)) || (_5 === (24))) { - quoted = true; - } - case 23: - /* } */ case 22: - if (!(name === "") || !sf.Anonymous) { _v$1 = true; $s = 27; continue s; } - _r$8 = ft.Kind(); /* */ $s = 28; case 28: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; } - _v$1 = !((_r$8 === 25)); case 27: - /* */ if (_v$1) { $s = 25; continue; } - /* */ $s = 26; continue; - /* if (_v$1) { */ case 25: - tagged = !(name === ""); - if (name === "") { - name = sf.Name; - } - fields = $append(fields, fillField(new field.ptr(name, sliceType$2.nil, $throwNilPointerError, tagged, index, ft, new tagOptions(opts).Contains("omitempty"), quoted))); - if ((_entry$1 = count[reflect.Type.keyFor(f.typ)], _entry$1 !== undefined ? _entry$1.v : 0) > 1) { - fields = $append(fields, (x$1 = fields.$length - 1 >> 0, ((x$1 < 0 || x$1 >= fields.$length) ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + x$1]))); - } - i = i + (1) >> 0; - /* continue; */ $s = 7; continue; - /* } */ case 26: - _key$1 = ft; (nextCount || $throwRuntimeError("assignment to entry in nil map"))[reflect.Type.keyFor(_key$1)] = { k: _key$1, v: (_entry$2 = nextCount[reflect.Type.keyFor(ft)], _entry$2 !== undefined ? _entry$2.v : 0) + (1) >> 0 }; - /* */ if ((_entry$3 = nextCount[reflect.Type.keyFor(ft)], _entry$3 !== undefined ? _entry$3.v : 0) === 1) { $s = 29; continue; } - /* */ $s = 30; continue; - /* if ((_entry$3 = nextCount[reflect.Type.keyFor(ft)], _entry$3 !== undefined ? _entry$3.v : 0) === 1) { */ case 29: - _r$9 = ft.Name(); /* */ $s = 31; case 31: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; } - _r$10 = fillField(new field.ptr(_r$9, sliceType$2.nil, $throwNilPointerError, false, index, ft, false, false)); /* */ $s = 32; case 32: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; } - next = $append(next, _r$10); - /* } */ case 30: - i = i + (1) >> 0; - /* } */ $s = 7; continue; case 8: - _i++; - /* } */ $s = 3; continue; case 4: - /* } */ $s = 1; continue; case 2: - $r = sort.Sort($subslice(new byName(fields.$array), fields.$offset, fields.$offset + fields.$length)); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - out = $subslice(fields, 0, 0); - _tmp$4 = 0; - _tmp$5 = 0; - advance = _tmp$4; - i$1 = _tmp$5; - /* while (true) { */ case 34: - /* if (!(i$1 < fields.$length)) { break; } */ if(!(i$1 < fields.$length)) { $s = 35; continue; } - fi = $clone(((i$1 < 0 || i$1 >= fields.$length) ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + i$1]), field); - name$1 = fi.name; - advance = 1; - while (true) { - if (!((i$1 + advance >> 0) < fields.$length)) { break; } - fj = $clone((x$2 = i$1 + advance >> 0, ((x$2 < 0 || x$2 >= fields.$length) ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + x$2])), field); - if (!(fj.name === name$1)) { - break; - } - advance = advance + (1) >> 0; - } - if (advance === 1) { - out = $append(out, fi); - i$1 = i$1 + (advance) >> 0; - /* continue; */ $s = 34; continue; - } - _tuple$1 = dominantField($subslice(fields, i$1, (i$1 + advance >> 0))); - dominant = $clone(_tuple$1[0], field); - ok = _tuple$1[1]; - if (ok) { - out = $append(out, dominant); - } - i$1 = i$1 + (advance) >> 0; - /* } */ $s = 34; continue; case 35: - fields = out; - $r = sort.Sort($subslice(new byIndex(fields.$array), fields.$offset, fields.$offset + fields.$length)); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - return fields; - /* */ } return; } if ($f === undefined) { $f = { $blk: typeFields }; } $f.$ptr = $ptr; $f._5 = _5; $f._entry = _entry; $f._entry$1 = _entry$1; $f._entry$2 = _entry$2; $f._entry$3 = _entry$3; $f._i = _i; $f._key = _key; $f._key$1 = _key$1; $f._r$10 = _r$10; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._r$4 = _r$4; $f._r$5 = _r$5; $f._r$6 = _r$6; $f._r$7 = _r$7; $f._r$8 = _r$8; $f._r$9 = _r$9; $f._ref = _ref; $f._tmp = _tmp; $f._tmp$1 = _tmp$1; $f._tmp$2 = _tmp$2; $f._tmp$3 = _tmp$3; $f._tmp$4 = _tmp$4; $f._tmp$5 = _tmp$5; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f._v = _v; $f._v$1 = _v$1; $f.advance = advance; $f.count = count; $f.current = current; $f.dominant = dominant; $f.f = f; $f.fi = fi; $f.fields = fields; $f.fj = fj; $f.ft = ft; $f.i = i; $f.i$1 = i$1; $f.index = index; $f.name = name; $f.name$1 = name$1; $f.next = next; $f.nextCount = nextCount; $f.ok = ok; $f.opts = opts; $f.out = out; $f.quoted = quoted; $f.sf = sf; $f.t = t; $f.tag = tag; $f.tagged = tagged; $f.visited = visited; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; - }; - dominantField = function(fields) { - var $ptr, _i, _ref, f, fields, i, length, tagged; - length = (0 >= fields.$length ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + 0]).index.$length; - tagged = -1; - _ref = fields; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - f = $clone(((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]), field); - if (f.index.$length > length) { - fields = $subslice(fields, 0, i); - break; - } - if (f.tag) { - if (tagged >= 0) { - return [new field.ptr("", sliceType$2.nil, $throwNilPointerError, false, sliceType$3.nil, $ifaceNil, false, false), false]; - } - tagged = i; - } - _i++; - } - if (tagged >= 0) { - return [((tagged < 0 || tagged >= fields.$length) ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + tagged]), true]; - } - if (fields.$length > 1) { - return [new field.ptr("", sliceType$2.nil, $throwNilPointerError, false, sliceType$3.nil, $ifaceNil, false, false), false]; - } - return [(0 >= fields.$length ? $throwRuntimeError("index out of range") : fields.$array[fields.$offset + 0]), true]; - }; - cachedTypeFields = function(t) { - var $ptr, _entry, _key, _r$2, f, t, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _entry = $f._entry; _key = $f._key; _r$2 = $f._r$2; f = $f.f; t = $f.t; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - fieldCache.RWMutex.RLock(); - f = (_entry = fieldCache.m[reflect.Type.keyFor(t)], _entry !== undefined ? _entry.v : sliceType$1.nil); - fieldCache.RWMutex.RUnlock(); - if (!(f === sliceType$1.nil)) { - return f; - } - _r$2 = typeFields(t); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - f = _r$2; - if (f === sliceType$1.nil) { - f = new sliceType$1([]); - } - fieldCache.RWMutex.Lock(); - if (fieldCache.m === false) { - fieldCache.m = $makeMap(reflect.Type.keyFor, []); - } - _key = t; (fieldCache.m || $throwRuntimeError("assignment to entry in nil map"))[reflect.Type.keyFor(_key)] = { k: _key, v: f }; - fieldCache.RWMutex.Unlock(); - return f; - /* */ } return; } if ($f === undefined) { $f = { $blk: cachedTypeFields }; } $f.$ptr = $ptr; $f._entry = _entry; $f._key = _key; $f._r$2 = _r$2; $f.f = f; $f.t = t; $f.$s = $s; $f.$r = $r; return $f; - }; - foldFunc = function(s) { - var $ptr, _i, _ref, b, nonLetter, s, special, upper; - nonLetter = false; - special = false; - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - b = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (b >= 128) { - return bytes.EqualFold; - } - upper = (b & 223) >>> 0; - if (upper < 65 || upper > 90) { - nonLetter = true; - } else if ((upper === 75) || (upper === 83)) { - special = true; - } - _i++; - } - if (special) { - return equalFoldRight; - } - if (nonLetter) { - return asciiEqualFold; - } - return simpleLetterEqualFold; - }; - equalFoldRight = function(s, t) { - var $ptr, _1, _i, _ref, _tuple, s, sb, sbUpper, size, t, tb, tr; - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - sb = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (t.$length === 0) { - return false; - } - tb = (0 >= t.$length ? $throwRuntimeError("index out of range") : t.$array[t.$offset + 0]); - if (tb < 128) { - if (!((sb === tb))) { - sbUpper = (sb & 223) >>> 0; - if (65 <= sbUpper && sbUpper <= 90) { - if (!((sbUpper === ((tb & 223) >>> 0)))) { - return false; - } - } else { - return false; - } - } - t = $subslice(t, 1); - _i++; - continue; - } - _tuple = utf8.DecodeRune(t); - tr = _tuple[0]; - size = _tuple[1]; - _1 = sb; - if ((_1 === (115)) || (_1 === (83))) { - if (!((tr === 383))) { - return false; - } - } else if ((_1 === (107)) || (_1 === (75))) { - if (!((tr === 8490))) { - return false; - } - } else { - return false; - } - t = $subslice(t, size); - _i++; - } - if (t.$length > 0) { - return false; - } - return true; - }; - asciiEqualFold = function(s, t) { - var $ptr, _i, _ref, i, s, sb, t, tb; - if (!((s.$length === t.$length))) { - return false; - } - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - sb = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - tb = ((i < 0 || i >= t.$length) ? $throwRuntimeError("index out of range") : t.$array[t.$offset + i]); - if (sb === tb) { - _i++; - continue; - } - if ((97 <= sb && sb <= 122) || (65 <= sb && sb <= 90)) { - if (!((((sb & 223) >>> 0) === ((tb & 223) >>> 0)))) { - return false; - } - } else { - return false; - } - _i++; - } - return true; - }; - simpleLetterEqualFold = function(s, t) { - var $ptr, _i, _ref, b, i, s, t; - if (!((s.$length === t.$length))) { - return false; - } - _ref = s; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - b = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (!((((b & 223) >>> 0) === ((((i < 0 || i >= t.$length) ? $throwRuntimeError("index out of range") : t.$array[t.$offset + i]) & 223) >>> 0)))) { - return false; - } - _i++; - } - return true; - }; - compact = function(dst, src, escape) { - var $ptr, _i, _r$2, _r$3, _ref, c, dst, escape, i, origLen, scan, src, start, v, x, x$1, x$2, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _i = $f._i; _r$2 = $f._r$2; _r$3 = $f._r$3; _ref = $f._ref; c = $f.c; dst = $f.dst; escape = $f.escape; i = $f.i; origLen = $f.origLen; scan = $f.scan; src = $f.src; start = $f.start; v = $f.v; x = $f.x; x$1 = $f.x$1; x$2 = $f.x$2; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - scan = [scan]; - origLen = dst.Len(); - scan[0] = new scanner.ptr($throwNilPointerError, false, sliceType$3.nil, $ifaceNil, false, 0, $throwNilPointerError, new $Int64(0, 0)); - scan[0].reset(); - start = 0; - _ref = src; - _i = 0; - /* while (true) { */ case 1: - /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 2; continue; } - i = _i; - c = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - if (escape && ((c === 60) || (c === 62) || (c === 38))) { - if (start < i) { - dst.Write($subslice(src, start, i)); - } - dst.WriteString("\\u00"); - dst.WriteByte(hex.charCodeAt((c >>> 4 << 24 >>> 24))); - dst.WriteByte(hex.charCodeAt(((c & 15) >>> 0))); - start = i + 1 >> 0; - } - if ((c === 226) && (i + 2 >> 0) < src.$length && ((x = i + 1 >> 0, ((x < 0 || x >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x])) === 128) && ((((x$1 = i + 2 >> 0, ((x$1 < 0 || x$1 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$1])) & ~1) << 24 >>> 24) === 168)) { - if (start < i) { - dst.Write($subslice(src, start, i)); - } - dst.WriteString("\\u202"); - dst.WriteByte(hex.charCodeAt((((x$2 = i + 2 >> 0, ((x$2 < 0 || x$2 >= src.$length) ? $throwRuntimeError("index out of range") : src.$array[src.$offset + x$2])) & 15) >>> 0))); - start = i + 3 >> 0; - } - _r$2 = scan[0].step(scan[0], c); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - v = _r$2; - if (v >= 9) { - if (v === 11) { - /* break; */ $s = 2; continue; - } - if (start < i) { - dst.Write($subslice(src, start, i)); - } - start = i + 1 >> 0; - } - _i++; - /* } */ $s = 1; continue; case 2: - _r$3 = scan[0].eof(); /* */ $s = 6; case 6: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; } - /* */ if (_r$3 === 11) { $s = 4; continue; } - /* */ $s = 5; continue; - /* if (_r$3 === 11) { */ case 4: - dst.Truncate(origLen); - return scan[0].err; - /* } */ case 5: - if (start < src.$length) { - dst.Write($subslice(src, start)); - } - return $ifaceNil; - /* */ } return; } if ($f === undefined) { $f = { $blk: compact }; } $f.$ptr = $ptr; $f._i = _i; $f._r$2 = _r$2; $f._r$3 = _r$3; $f._ref = _ref; $f.c = c; $f.dst = dst; $f.escape = escape; $f.i = i; $f.origLen = origLen; $f.scan = scan; $f.src = src; $f.start = start; $f.v = v; $f.x = x; $f.x$1 = x$1; $f.x$2 = x$2; $f.$s = $s; $f.$r = $r; return $f; - }; - SyntaxError.ptr.prototype.Error = function() { - var $ptr, e; - e = this; - return e.msg; - }; - SyntaxError.prototype.Error = function() { return this.$val.Error(); }; - scanner.ptr.prototype.reset = function() { - var $ptr, s; - s = this; - s.step = stateBeginValue; - s.parseState = $subslice(s.parseState, 0, 0); - s.err = $ifaceNil; - s.redo = false; - s.endTop = false; - }; - scanner.prototype.reset = function() { return this.$val.reset(); }; - scanner.ptr.prototype.eof = function() { - var $ptr, _r$2, s, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r$2 = $f._r$2; s = $f.s; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - s = this; - if (!($interfaceIsEqual(s.err, $ifaceNil))) { - return 11; - } - if (s.endTop) { - return 10; - } - _r$2 = s.step(s, 32); /* */ $s = 1; case 1: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; } - _r$2; - if (s.endTop) { - return 10; - } - if ($interfaceIsEqual(s.err, $ifaceNil)) { - s.err = new SyntaxError.ptr("unexpected end of JSON input", s.bytes); - } - return 11; - /* */ } return; } if ($f === undefined) { $f = { $blk: scanner.ptr.prototype.eof }; } $f.$ptr = $ptr; $f._r$2 = _r$2; $f.s = s; $f.$s = $s; $f.$r = $r; return $f; - }; - scanner.prototype.eof = function() { return this.$val.eof(); }; - scanner.ptr.prototype.pushParseState = function(p) { - var $ptr, p, s; - s = this; - s.parseState = $append(s.parseState, p); - }; - scanner.prototype.pushParseState = function(p) { return this.$val.pushParseState(p); }; - scanner.ptr.prototype.popParseState = function() { - var $ptr, n, s; - s = this; - n = s.parseState.$length - 1 >> 0; - s.parseState = $subslice(s.parseState, 0, n); - s.redo = false; - if (n === 0) { - s.step = stateEndTop; - s.endTop = true; - } else { - s.step = stateEndValue; - } - }; - scanner.prototype.popParseState = function() { return this.$val.popParseState(); }; - isSpace = function(c) { - var $ptr, c; - return (c === 32) || (c === 9) || (c === 13) || (c === 10); - }; - stateBeginValueOrEmpty = function(s, c) { - var $ptr, c, s; - if (c <= 32 && isSpace(c)) { - return 9; - } - if (c === 93) { - return stateEndValue(s, c); - } - return stateBeginValue(s, c); - }; - stateBeginValue = function(s, c) { - var $ptr, _2, c, s; - if (c <= 32 && isSpace(c)) { - return 9; - } - _2 = c; - if (_2 === (123)) { - s.step = stateBeginStringOrEmpty; - s.pushParseState(0); - return 2; - } else if (_2 === (91)) { - s.step = stateBeginValueOrEmpty; - s.pushParseState(2); - return 6; - } else if (_2 === (34)) { - s.step = stateInString; - return 1; - } else if (_2 === (45)) { - s.step = stateNeg; - return 1; - } else if (_2 === (48)) { - s.step = state0; - return 1; - } else if (_2 === (116)) { - s.step = stateT; - return 1; - } else if (_2 === (102)) { - s.step = stateF; - return 1; - } else if (_2 === (110)) { - s.step = stateN; - return 1; - } - if (49 <= c && c <= 57) { - s.step = state1; - return 1; - } - return s.error(c, "looking for beginning of value"); - }; - stateBeginStringOrEmpty = function(s, c) { - var $ptr, c, n, s, x, x$1; - if (c <= 32 && isSpace(c)) { - return 9; - } - if (c === 125) { - n = s.parseState.$length; - (x = s.parseState, x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1] = 1)); - return stateEndValue(s, c); - } - return stateBeginString(s, c); - }; - stateBeginString = function(s, c) { - var $ptr, c, s; - if (c <= 32 && isSpace(c)) { - return 9; - } - if (c === 34) { - s.step = stateInString; - return 1; - } - return s.error(c, "looking for beginning of object key string"); - }; - stateEndValue = function(s, c) { - var $ptr, _3, c, n, ps, s, x, x$1, x$2, x$3, x$4, x$5; - n = s.parseState.$length; - if (n === 0) { - s.step = stateEndTop; - s.endTop = true; - return stateEndTop(s, c); - } - if (c <= 32 && isSpace(c)) { - s.step = stateEndValue; - return 9; - } - ps = (x = s.parseState, x$1 = n - 1 >> 0, ((x$1 < 0 || x$1 >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + x$1])); - _3 = ps; - if (_3 === (0)) { - if (c === 58) { - (x$2 = s.parseState, x$3 = n - 1 >> 0, ((x$3 < 0 || x$3 >= x$2.$length) ? $throwRuntimeError("index out of range") : x$2.$array[x$2.$offset + x$3] = 1)); - s.step = stateBeginValue; - return 3; - } - return s.error(c, "after object key"); - } else if (_3 === (1)) { - if (c === 44) { - (x$4 = s.parseState, x$5 = n - 1 >> 0, ((x$5 < 0 || x$5 >= x$4.$length) ? $throwRuntimeError("index out of range") : x$4.$array[x$4.$offset + x$5] = 0)); - s.step = stateBeginString; - return 4; - } - if (c === 125) { - s.popParseState(); - return 5; - } - return s.error(c, "after object key:value pair"); - } else if (_3 === (2)) { - if (c === 44) { - s.step = stateBeginValue; - return 7; - } - if (c === 93) { - s.popParseState(); - return 8; - } - return s.error(c, "after array element"); - } - return s.error(c, ""); - }; - stateEndTop = function(s, c) { - var $ptr, c, s; - if (!((c === 32)) && !((c === 9)) && !((c === 13)) && !((c === 10))) { - s.error(c, "after top-level value"); - } - return 10; - }; - stateInString = function(s, c) { - var $ptr, c, s; - if (c === 34) { - s.step = stateEndValue; - return 0; - } - if (c === 92) { - s.step = stateInStringEsc; - return 0; - } - if (c < 32) { - return s.error(c, "in string literal"); - } - return 0; - }; - stateInStringEsc = function(s, c) { - var $ptr, _4, c, s; - _4 = c; - if ((_4 === (98)) || (_4 === (102)) || (_4 === (110)) || (_4 === (114)) || (_4 === (116)) || (_4 === (92)) || (_4 === (47)) || (_4 === (34))) { - s.step = stateInString; - return 0; - } else if (_4 === (117)) { - s.step = stateInStringEscU; - return 0; - } - return s.error(c, "in string escape code"); - }; - stateInStringEscU = function(s, c) { - var $ptr, c, s; - if (48 <= c && c <= 57 || 97 <= c && c <= 102 || 65 <= c && c <= 70) { - s.step = stateInStringEscU1; - return 0; - } - return s.error(c, "in \\u hexadecimal character escape"); - }; - stateInStringEscU1 = function(s, c) { - var $ptr, c, s; - if (48 <= c && c <= 57 || 97 <= c && c <= 102 || 65 <= c && c <= 70) { - s.step = stateInStringEscU12; - return 0; - } - return s.error(c, "in \\u hexadecimal character escape"); - }; - stateInStringEscU12 = function(s, c) { - var $ptr, c, s; - if (48 <= c && c <= 57 || 97 <= c && c <= 102 || 65 <= c && c <= 70) { - s.step = stateInStringEscU123; - return 0; - } - return s.error(c, "in \\u hexadecimal character escape"); - }; - stateInStringEscU123 = function(s, c) { - var $ptr, c, s; - if (48 <= c && c <= 57 || 97 <= c && c <= 102 || 65 <= c && c <= 70) { - s.step = stateInString; - return 0; - } - return s.error(c, "in \\u hexadecimal character escape"); - }; - stateNeg = function(s, c) { - var $ptr, c, s; - if (c === 48) { - s.step = state0; - return 0; - } - if (49 <= c && c <= 57) { - s.step = state1; - return 0; - } - return s.error(c, "in numeric literal"); - }; - state1 = function(s, c) { - var $ptr, c, s; - if (48 <= c && c <= 57) { - s.step = state1; - return 0; - } - return state0(s, c); - }; - state0 = function(s, c) { - var $ptr, c, s; - if (c === 46) { - s.step = stateDot; - return 0; - } - if ((c === 101) || (c === 69)) { - s.step = stateE; - return 0; - } - return stateEndValue(s, c); - }; - stateDot = function(s, c) { - var $ptr, c, s; - if (48 <= c && c <= 57) { - s.step = stateDot0; - return 0; - } - return s.error(c, "after decimal point in numeric literal"); - }; - stateDot0 = function(s, c) { - var $ptr, c, s; - if (48 <= c && c <= 57) { - return 0; - } - if ((c === 101) || (c === 69)) { - s.step = stateE; - return 0; - } - return stateEndValue(s, c); - }; - stateE = function(s, c) { - var $ptr, c, s; - if ((c === 43) || (c === 45)) { - s.step = stateESign; - return 0; - } - return stateESign(s, c); - }; - stateESign = function(s, c) { - var $ptr, c, s; - if (48 <= c && c <= 57) { - s.step = stateE0; - return 0; - } - return s.error(c, "in exponent of numeric literal"); - }; - stateE0 = function(s, c) { - var $ptr, c, s; - if (48 <= c && c <= 57) { - return 0; - } - return stateEndValue(s, c); - }; - stateT = function(s, c) { - var $ptr, c, s; - if (c === 114) { - s.step = stateTr; - return 0; - } - return s.error(c, "in literal true (expecting 'r')"); - }; - stateTr = function(s, c) { - var $ptr, c, s; - if (c === 117) { - s.step = stateTru; - return 0; - } - return s.error(c, "in literal true (expecting 'u')"); - }; - stateTru = function(s, c) { - var $ptr, c, s; - if (c === 101) { - s.step = stateEndValue; - return 0; - } - return s.error(c, "in literal true (expecting 'e')"); - }; - stateF = function(s, c) { - var $ptr, c, s; - if (c === 97) { - s.step = stateFa; - return 0; - } - return s.error(c, "in literal false (expecting 'a')"); - }; - stateFa = function(s, c) { - var $ptr, c, s; - if (c === 108) { - s.step = stateFal; - return 0; - } - return s.error(c, "in literal false (expecting 'l')"); - }; - stateFal = function(s, c) { - var $ptr, c, s; - if (c === 115) { - s.step = stateFals; - return 0; - } - return s.error(c, "in literal false (expecting 's')"); - }; - stateFals = function(s, c) { - var $ptr, c, s; - if (c === 101) { - s.step = stateEndValue; - return 0; - } - return s.error(c, "in literal false (expecting 'e')"); - }; - stateN = function(s, c) { - var $ptr, c, s; - if (c === 117) { - s.step = stateNu; - return 0; - } - return s.error(c, "in literal null (expecting 'u')"); - }; - stateNu = function(s, c) { - var $ptr, c, s; - if (c === 108) { - s.step = stateNul; - return 0; - } - return s.error(c, "in literal null (expecting 'l')"); - }; - stateNul = function(s, c) { - var $ptr, c, s; - if (c === 108) { - s.step = stateEndValue; - return 0; - } - return s.error(c, "in literal null (expecting 'l')"); - }; - stateError = function(s, c) { - var $ptr, c, s; - return 11; - }; - scanner.ptr.prototype.error = function(c, context) { - var $ptr, c, context, s; - s = this; - s.step = stateError; - s.err = new SyntaxError.ptr("invalid character " + quoteChar(c) + " " + context, s.bytes); - return 11; - }; - scanner.prototype.error = function(c, context) { return this.$val.error(c, context); }; - quoteChar = function(c) { - var $ptr, c, s; - if (c === 39) { - return "'\\''"; - } - if (c === 34) { - return "'\"'"; - } - s = strconv.Quote($encodeRune(c)); - return "'" + s.substring(1, (s.length - 1 >> 0)) + "'"; - }; - parseTag = function(tag) { - var $ptr, idx, tag; - idx = strings.Index(tag, ","); - if (!((idx === -1))) { - return [tag.substring(0, idx), tag.substring((idx + 1 >> 0))]; - } - return [tag, ""]; - }; - tagOptions.prototype.Contains = function(optionName) { - var $ptr, _tmp, _tmp$1, i, next, o, optionName, s; - o = this.$val; - if (o.length === 0) { - return false; - } - s = o; - while (true) { - if (!(!(s === ""))) { break; } - next = ""; - i = strings.Index(s, ","); - if (i >= 0) { - _tmp = s.substring(0, i); - _tmp$1 = s.substring((i + 1 >> 0)); - s = _tmp; - next = _tmp$1; - } - if (s === optionName) { - return true; - } - s = next; - } - return false; - }; - $ptrType(tagOptions).prototype.Contains = function(optionName) { return new tagOptions(this.$get()).Contains(optionName); }; - Number.methods = [{prop: "String", name: "String", pkg: "", typ: $funcType([], [$String], false)}, {prop: "Float64", name: "Float64", pkg: "", typ: $funcType([], [$Float64, $error], false)}, {prop: "Int64", name: "Int64", pkg: "", typ: $funcType([], [$Int64, $error], false)}]; - ptrType$13.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$14.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$16.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$4.methods = [{prop: "marshal", name: "marshal", pkg: "encoding/json", typ: $funcType([$emptyInterface], [$error], false)}, {prop: "error", name: "error", pkg: "encoding/json", typ: $funcType([$error], [], false)}, {prop: "reflectValue", name: "reflectValue", pkg: "encoding/json", typ: $funcType([reflect.Value], [], false)}, {prop: "string", name: "string", pkg: "encoding/json", typ: $funcType([$String], [$Int], false)}, {prop: "stringBytes", name: "stringBytes", pkg: "encoding/json", typ: $funcType([sliceType$2], [$Int], false)}]; - floatEncoder.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; - ptrType$17.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; - ptrType$18.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; - ptrType$19.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; - ptrType$20.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; - ptrType$21.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; - ptrType$22.methods = [{prop: "encode", name: "encode", pkg: "encoding/json", typ: $funcType([ptrType$4, reflect.Value, $Bool], [], false)}]; - stringValues.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "Less", name: "Less", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}, {prop: "get", name: "get", pkg: "encoding/json", typ: $funcType([$Int], [$String], false)}]; - byName.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "Less", name: "Less", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}]; - byIndex.methods = [{prop: "Len", name: "Len", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Swap", name: "Swap", pkg: "", typ: $funcType([$Int, $Int], [], false)}, {prop: "Less", name: "Less", pkg: "", typ: $funcType([$Int, $Int], [$Bool], false)}]; - ptrType$8.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}]; - ptrType$23.methods = [{prop: "reset", name: "reset", pkg: "encoding/json", typ: $funcType([], [], false)}, {prop: "eof", name: "eof", pkg: "encoding/json", typ: $funcType([], [$Int], false)}, {prop: "pushParseState", name: "pushParseState", pkg: "encoding/json", typ: $funcType([$Int], [], false)}, {prop: "popParseState", name: "popParseState", pkg: "encoding/json", typ: $funcType([], [], false)}, {prop: "error", name: "error", pkg: "encoding/json", typ: $funcType([$Uint8, $String], [$Int], false)}, {prop: "undo", name: "undo", pkg: "encoding/json", typ: $funcType([$Int], [], false)}]; - tagOptions.methods = [{prop: "Contains", name: "Contains", pkg: "", typ: $funcType([$String], [$Bool], false)}]; - Marshaler.init([{prop: "MarshalJSON", name: "MarshalJSON", pkg: "", typ: $funcType([], [sliceType$2, $error], false)}]); - UnsupportedTypeError.init([{prop: "Type", name: "Type", pkg: "", typ: reflect.Type, tag: ""}]); - UnsupportedValueError.init([{prop: "Value", name: "Value", pkg: "", typ: reflect.Value, tag: ""}, {prop: "Str", name: "Str", pkg: "", typ: $String, tag: ""}]); - MarshalerError.init([{prop: "Type", name: "Type", pkg: "", typ: reflect.Type, tag: ""}, {prop: "Err", name: "Err", pkg: "", typ: $error, tag: ""}]); - encodeState.init([{prop: "Buffer", name: "", pkg: "", typ: bytes.Buffer, tag: ""}, {prop: "scratch", name: "scratch", pkg: "encoding/json", typ: arrayType$1, tag: ""}]); - encoderFunc.init([ptrType$4, reflect.Value, $Bool], [], false); - structEncoder.init([{prop: "fields", name: "fields", pkg: "encoding/json", typ: sliceType$1, tag: ""}, {prop: "fieldEncs", name: "fieldEncs", pkg: "encoding/json", typ: sliceType$4, tag: ""}]); - mapEncoder.init([{prop: "elemEnc", name: "elemEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}]); - sliceEncoder.init([{prop: "arrayEnc", name: "arrayEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}]); - arrayEncoder.init([{prop: "elemEnc", name: "elemEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}]); - ptrEncoder.init([{prop: "elemEnc", name: "elemEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}]); - condAddrEncoder.init([{prop: "canAddrEnc", name: "canAddrEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}, {prop: "elseEnc", name: "elseEnc", pkg: "encoding/json", typ: encoderFunc, tag: ""}]); - stringValues.init(reflect.Value); - field.init([{prop: "name", name: "name", pkg: "encoding/json", typ: $String, tag: ""}, {prop: "nameBytes", name: "nameBytes", pkg: "encoding/json", typ: sliceType$2, tag: ""}, {prop: "equalFold", name: "equalFold", pkg: "encoding/json", typ: funcType, tag: ""}, {prop: "tag", name: "tag", pkg: "encoding/json", typ: $Bool, tag: ""}, {prop: "index", name: "index", pkg: "encoding/json", typ: sliceType$3, tag: ""}, {prop: "typ", name: "typ", pkg: "encoding/json", typ: reflect.Type, tag: ""}, {prop: "omitEmpty", name: "omitEmpty", pkg: "encoding/json", typ: $Bool, tag: ""}, {prop: "quoted", name: "quoted", pkg: "encoding/json", typ: $Bool, tag: ""}]); - byName.init(field); - byIndex.init(field); - SyntaxError.init([{prop: "msg", name: "msg", pkg: "encoding/json", typ: $String, tag: ""}, {prop: "Offset", name: "Offset", pkg: "", typ: $Int64, tag: ""}]); - scanner.init([{prop: "step", name: "step", pkg: "encoding/json", typ: funcType$1, tag: ""}, {prop: "endTop", name: "endTop", pkg: "encoding/json", typ: $Bool, tag: ""}, {prop: "parseState", name: "parseState", pkg: "encoding/json", typ: sliceType$3, tag: ""}, {prop: "err", name: "err", pkg: "encoding/json", typ: $error, tag: ""}, {prop: "redo", name: "redo", pkg: "encoding/json", typ: $Bool, tag: ""}, {prop: "redoCode", name: "redoCode", pkg: "encoding/json", typ: $Int, tag: ""}, {prop: "redoState", name: "redoState", pkg: "encoding/json", typ: funcType$1, tag: ""}, {prop: "bytes", name: "bytes", pkg: "encoding/json", typ: $Int64, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = encoding.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = base64.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = errors.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = fmt.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = nosync.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = io.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = math.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = reflect.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = runtime.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sort.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strconv.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = strings.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = testing.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = unicode.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = utf16.$init(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = utf8.$init(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - encoderCache = new structType.ptr(new nosync.RWMutex.ptr(false, 0), false); - fieldCache = new structType$1.ptr(new nosync.RWMutex.ptr(false, 0), false); - errPhase = errors.New("JSON decoder out of sync - data changing underfoot?"); - numberType = reflect.TypeOf(new Number("")); - hex = "0123456789abcdef"; - _r = reflect.TypeOf($newDataPointer($ifaceNil, ptrType)).Elem(); /* */ $s = 18; case 18: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - marshalerType = _r; - _r$1 = reflect.TypeOf($newDataPointer($ifaceNil, ptrType$1)).Elem(); /* */ $s = 19; case 19: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - textMarshalerType = _r$1; - float32Encoder = $methodVal(new floatEncoder(32), "encode"); - float64Encoder = $methodVal(new floatEncoder(64), "encode"); - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["github.com/ZiRo-/cuckgo/cuckoo"] = (function() { - var $pkg = {}, $init, sha256, json, Cuckoo, Edge, CuckooJSON, arrayType, arrayType$1, sliceType, sliceType$1, ptrType$1, ptrType$2, mapType, u8, u8to64, NewCuckoo, NewCuckooSHA, EncodeCuckooJSON; - sha256 = $packages["crypto/sha256"]; - json = $packages["encoding/json"]; - Cuckoo = $pkg.Cuckoo = $newType(0, $kindStruct, "cuckoo.Cuckoo", "Cuckoo", "github.com/ZiRo-/cuckgo/cuckoo", function(v_) { - this.$val = this; - if (arguments.length === 0) { - this.v = arrayType$1.zero(); - return; - } - this.v = v_; - }); - Edge = $pkg.Edge = $newType(0, $kindStruct, "cuckoo.Edge", "Edge", "github.com/ZiRo-/cuckgo/cuckoo", function(U_, V_) { - this.$val = this; - if (arguments.length === 0) { - this.U = new $Uint64(0, 0); - this.V = new $Uint64(0, 0); - return; - } - this.U = U_; - this.V = V_; - }); - CuckooJSON = $pkg.CuckooJSON = $newType(0, $kindStruct, "cuckoo.CuckooJSON", "CuckooJSON", "github.com/ZiRo-/cuckgo/cuckoo", function(Parameter_, InputData_, Cycle_) { - this.$val = this; - if (arguments.length === 0) { - this.Parameter = false; - this.InputData = sliceType$1.nil; - this.Cycle = sliceType.nil; - return; - } - this.Parameter = Parameter_; - this.InputData = InputData_; - this.Cycle = Cycle_; - }); - arrayType = $arrayType($Uint8, 32); - arrayType$1 = $arrayType($Uint64, 4); - sliceType = $sliceType($Uint64); - sliceType$1 = $sliceType($Uint8); - ptrType$1 = $ptrType(Edge); - ptrType$2 = $ptrType(Cuckoo); - mapType = $mapType($String, $Uint64); - u8 = function(b) { - var $ptr, b, x; - return (x = new $Uint64(0, b), new $Uint64(x.$high & 0, (x.$low & 255) >>> 0)); - }; - u8to64 = function(p, i) { - var $ptr, i, p, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - p = $clone(p, arrayType); - return (x = (x$1 = (x$2 = (x$3 = (x$4 = (x$5 = (x$6 = u8(((i < 0 || i >= p.length) ? $throwRuntimeError("index out of range") : p[i])), x$7 = $shiftLeft64(u8((x$8 = i + 1 >> 0, ((x$8 < 0 || x$8 >= p.length) ? $throwRuntimeError("index out of range") : p[x$8]))), 8), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0)), x$9 = $shiftLeft64(u8((x$10 = i + 2 >> 0, ((x$10 < 0 || x$10 >= p.length) ? $throwRuntimeError("index out of range") : p[x$10]))), 16), new $Uint64(x$5.$high | x$9.$high, (x$5.$low | x$9.$low) >>> 0)), x$11 = $shiftLeft64(u8((x$12 = i + 3 >> 0, ((x$12 < 0 || x$12 >= p.length) ? $throwRuntimeError("index out of range") : p[x$12]))), 24), new $Uint64(x$4.$high | x$11.$high, (x$4.$low | x$11.$low) >>> 0)), x$13 = $shiftLeft64(u8((x$14 = i + 4 >> 0, ((x$14 < 0 || x$14 >= p.length) ? $throwRuntimeError("index out of range") : p[x$14]))), 32), new $Uint64(x$3.$high | x$13.$high, (x$3.$low | x$13.$low) >>> 0)), x$15 = $shiftLeft64(u8((x$16 = i + 5 >> 0, ((x$16 < 0 || x$16 >= p.length) ? $throwRuntimeError("index out of range") : p[x$16]))), 40), new $Uint64(x$2.$high | x$15.$high, (x$2.$low | x$15.$low) >>> 0)), x$17 = $shiftLeft64(u8((x$18 = i + 6 >> 0, ((x$18 < 0 || x$18 >= p.length) ? $throwRuntimeError("index out of range") : p[x$18]))), 48), new $Uint64(x$1.$high | x$17.$high, (x$1.$low | x$17.$low) >>> 0)), x$19 = $shiftLeft64(u8((x$20 = i + 7 >> 0, ((x$20 < 0 || x$20 >= p.length) ? $throwRuntimeError("index out of range") : p[x$20]))), 56), new $Uint64(x.$high | x$19.$high, (x.$low | x$19.$low) >>> 0)); - }; - NewCuckoo = function(header) { - var $ptr, hdrkey, header; - hdrkey = $clone(sha256.Sum256(header), arrayType); - return NewCuckooSHA(hdrkey); - }; - $pkg.NewCuckoo = NewCuckoo; - NewCuckooSHA = function(hdrkey) { - var $ptr, hdrkey, k0, k1, self; - hdrkey = $clone(hdrkey, arrayType); - self = new Cuckoo.ptr(arrayType$1.zero()); - k0 = u8to64(hdrkey, 0); - k1 = u8to64(hdrkey, 8); - self.v[0] = new $Uint64(k0.$high ^ 1936682341, (k0.$low ^ 1886610805) >>> 0); - self.v[1] = new $Uint64(k1.$high ^ 1685025377, (k1.$low ^ 1852075885) >>> 0); - self.v[2] = new $Uint64(k0.$high ^ 1819895653, (k0.$low ^ 1852142177) >>> 0); - self.v[3] = new $Uint64(k1.$high ^ 1952801890, (k1.$low ^ 2037671283) >>> 0); - return self; - }; - $pkg.NewCuckooSHA = NewCuckooSHA; - Edge.ptr.prototype.HashCode = function() { - var $ptr, self; - self = this; - return ((self.U.$low >> 0) ^ (self.V.$low >> 0)) >> 0; - }; - Edge.prototype.HashCode = function() { return this.$val.HashCode(); }; - Cuckoo.ptr.prototype.Sipedge = function(nonce) { - var $ptr, nonce, self; - self = this; - return new Edge.ptr(self.Sipnode(nonce, 0), self.Sipnode(nonce, 1)); - }; - Cuckoo.prototype.Sipedge = function(nonce) { return this.$val.Sipedge(nonce); }; - Cuckoo.ptr.prototype.siphash24 = function(nonce) { - var $ptr, nonce, self, v0, v1, v2, v3, x, x$1, x$10, x$100, x$101, x$102, x$103, x$104, x$105, x$106, x$107, x$108, x$109, x$11, x$110, x$111, x$112, x$113, x$114, x$115, x$116, x$117, x$118, x$119, x$12, x$120, x$121, x$122, x$123, x$124, x$13, x$14, x$15, x$16, x$17, x$18, x$19, x$2, x$20, x$21, x$22, x$23, x$24, x$25, x$26, x$27, x$28, x$29, x$3, x$30, x$31, x$32, x$33, x$34, x$35, x$36, x$37, x$38, x$39, x$4, x$40, x$41, x$42, x$43, x$44, x$45, x$46, x$47, x$48, x$49, x$5, x$50, x$51, x$52, x$53, x$54, x$55, x$56, x$57, x$58, x$59, x$6, x$60, x$61, x$62, x$63, x$64, x$65, x$66, x$67, x$68, x$69, x$7, x$70, x$71, x$72, x$73, x$74, x$75, x$76, x$77, x$78, x$79, x$8, x$80, x$81, x$82, x$83, x$84, x$85, x$86, x$87, x$88, x$89, x$9, x$90, x$91, x$92, x$93, x$94, x$95, x$96, x$97, x$98, x$99; - self = this; - v0 = self.v[0]; - v1 = self.v[1]; - v2 = self.v[2]; - v3 = (x = self.v[3], new $Uint64(x.$high ^ nonce.$high, (x.$low ^ nonce.$low) >>> 0)); - v0 = (x$1 = v1, new $Uint64(v0.$high + x$1.$high, v0.$low + x$1.$low)); - v2 = (x$2 = v3, new $Uint64(v2.$high + x$2.$high, v2.$low + x$2.$low)); - v1 = (x$3 = $shiftLeft64(v1, 13), x$4 = $shiftRightUint64(v1, 51), new $Uint64(x$3.$high | x$4.$high, (x$3.$low | x$4.$low) >>> 0)); - v3 = (x$5 = $shiftLeft64(v3, 16), x$6 = $shiftRightUint64(v3, 48), new $Uint64(x$5.$high | x$6.$high, (x$5.$low | x$6.$low) >>> 0)); - v1 = (x$7 = v0, new $Uint64(v1.$high ^ x$7.$high, (v1.$low ^ x$7.$low) >>> 0)); - v3 = (x$8 = v2, new $Uint64(v3.$high ^ x$8.$high, (v3.$low ^ x$8.$low) >>> 0)); - v0 = (x$9 = $shiftLeft64(v0, 32), x$10 = $shiftRightUint64(v0, 32), new $Uint64(x$9.$high | x$10.$high, (x$9.$low | x$10.$low) >>> 0)); - v2 = (x$11 = v1, new $Uint64(v2.$high + x$11.$high, v2.$low + x$11.$low)); - v0 = (x$12 = v3, new $Uint64(v0.$high + x$12.$high, v0.$low + x$12.$low)); - v1 = (x$13 = $shiftLeft64(v1, 17), x$14 = $shiftRightUint64(v1, 47), new $Uint64(x$13.$high | x$14.$high, (x$13.$low | x$14.$low) >>> 0)); - v3 = (x$15 = $shiftLeft64(v3, 21), x$16 = $shiftRightUint64(v3, 43), new $Uint64(x$15.$high | x$16.$high, (x$15.$low | x$16.$low) >>> 0)); - v1 = (x$17 = v2, new $Uint64(v1.$high ^ x$17.$high, (v1.$low ^ x$17.$low) >>> 0)); - v3 = (x$18 = v0, new $Uint64(v3.$high ^ x$18.$high, (v3.$low ^ x$18.$low) >>> 0)); - v2 = (x$19 = $shiftLeft64(v2, 32), x$20 = $shiftRightUint64(v2, 32), new $Uint64(x$19.$high | x$20.$high, (x$19.$low | x$20.$low) >>> 0)); - v0 = (x$21 = v1, new $Uint64(v0.$high + x$21.$high, v0.$low + x$21.$low)); - v2 = (x$22 = v3, new $Uint64(v2.$high + x$22.$high, v2.$low + x$22.$low)); - v1 = (x$23 = $shiftLeft64(v1, 13), x$24 = $shiftRightUint64(v1, 51), new $Uint64(x$23.$high | x$24.$high, (x$23.$low | x$24.$low) >>> 0)); - v3 = (x$25 = $shiftLeft64(v3, 16), x$26 = $shiftRightUint64(v3, 48), new $Uint64(x$25.$high | x$26.$high, (x$25.$low | x$26.$low) >>> 0)); - v1 = (x$27 = v0, new $Uint64(v1.$high ^ x$27.$high, (v1.$low ^ x$27.$low) >>> 0)); - v3 = (x$28 = v2, new $Uint64(v3.$high ^ x$28.$high, (v3.$low ^ x$28.$low) >>> 0)); - v0 = (x$29 = $shiftLeft64(v0, 32), x$30 = $shiftRightUint64(v0, 32), new $Uint64(x$29.$high | x$30.$high, (x$29.$low | x$30.$low) >>> 0)); - v2 = (x$31 = v1, new $Uint64(v2.$high + x$31.$high, v2.$low + x$31.$low)); - v0 = (x$32 = v3, new $Uint64(v0.$high + x$32.$high, v0.$low + x$32.$low)); - v1 = (x$33 = $shiftLeft64(v1, 17), x$34 = $shiftRightUint64(v1, 47), new $Uint64(x$33.$high | x$34.$high, (x$33.$low | x$34.$low) >>> 0)); - v3 = (x$35 = $shiftLeft64(v3, 21), x$36 = $shiftRightUint64(v3, 43), new $Uint64(x$35.$high | x$36.$high, (x$35.$low | x$36.$low) >>> 0)); - v1 = (x$37 = v2, new $Uint64(v1.$high ^ x$37.$high, (v1.$low ^ x$37.$low) >>> 0)); - v3 = (x$38 = v0, new $Uint64(v3.$high ^ x$38.$high, (v3.$low ^ x$38.$low) >>> 0)); - v2 = (x$39 = $shiftLeft64(v2, 32), x$40 = $shiftRightUint64(v2, 32), new $Uint64(x$39.$high | x$40.$high, (x$39.$low | x$40.$low) >>> 0)); - v0 = (x$41 = nonce, new $Uint64(v0.$high ^ x$41.$high, (v0.$low ^ x$41.$low) >>> 0)); - v2 = (x$42 = new $Uint64(0, 255), new $Uint64(v2.$high ^ x$42.$high, (v2.$low ^ x$42.$low) >>> 0)); - v0 = (x$43 = v1, new $Uint64(v0.$high + x$43.$high, v0.$low + x$43.$low)); - v2 = (x$44 = v3, new $Uint64(v2.$high + x$44.$high, v2.$low + x$44.$low)); - v1 = (x$45 = $shiftLeft64(v1, 13), x$46 = $shiftRightUint64(v1, 51), new $Uint64(x$45.$high | x$46.$high, (x$45.$low | x$46.$low) >>> 0)); - v3 = (x$47 = $shiftLeft64(v3, 16), x$48 = $shiftRightUint64(v3, 48), new $Uint64(x$47.$high | x$48.$high, (x$47.$low | x$48.$low) >>> 0)); - v1 = (x$49 = v0, new $Uint64(v1.$high ^ x$49.$high, (v1.$low ^ x$49.$low) >>> 0)); - v3 = (x$50 = v2, new $Uint64(v3.$high ^ x$50.$high, (v3.$low ^ x$50.$low) >>> 0)); - v0 = (x$51 = $shiftLeft64(v0, 32), x$52 = $shiftRightUint64(v0, 32), new $Uint64(x$51.$high | x$52.$high, (x$51.$low | x$52.$low) >>> 0)); - v2 = (x$53 = v1, new $Uint64(v2.$high + x$53.$high, v2.$low + x$53.$low)); - v0 = (x$54 = v3, new $Uint64(v0.$high + x$54.$high, v0.$low + x$54.$low)); - v1 = (x$55 = $shiftLeft64(v1, 17), x$56 = $shiftRightUint64(v1, 47), new $Uint64(x$55.$high | x$56.$high, (x$55.$low | x$56.$low) >>> 0)); - v3 = (x$57 = $shiftLeft64(v3, 21), x$58 = $shiftRightUint64(v3, 43), new $Uint64(x$57.$high | x$58.$high, (x$57.$low | x$58.$low) >>> 0)); - v1 = (x$59 = v2, new $Uint64(v1.$high ^ x$59.$high, (v1.$low ^ x$59.$low) >>> 0)); - v3 = (x$60 = v0, new $Uint64(v3.$high ^ x$60.$high, (v3.$low ^ x$60.$low) >>> 0)); - v2 = (x$61 = $shiftLeft64(v2, 32), x$62 = $shiftRightUint64(v2, 32), new $Uint64(x$61.$high | x$62.$high, (x$61.$low | x$62.$low) >>> 0)); - v0 = (x$63 = v1, new $Uint64(v0.$high + x$63.$high, v0.$low + x$63.$low)); - v2 = (x$64 = v3, new $Uint64(v2.$high + x$64.$high, v2.$low + x$64.$low)); - v1 = (x$65 = $shiftLeft64(v1, 13), x$66 = $shiftRightUint64(v1, 51), new $Uint64(x$65.$high | x$66.$high, (x$65.$low | x$66.$low) >>> 0)); - v3 = (x$67 = $shiftLeft64(v3, 16), x$68 = $shiftRightUint64(v3, 48), new $Uint64(x$67.$high | x$68.$high, (x$67.$low | x$68.$low) >>> 0)); - v1 = (x$69 = v0, new $Uint64(v1.$high ^ x$69.$high, (v1.$low ^ x$69.$low) >>> 0)); - v3 = (x$70 = v2, new $Uint64(v3.$high ^ x$70.$high, (v3.$low ^ x$70.$low) >>> 0)); - v0 = (x$71 = $shiftLeft64(v0, 32), x$72 = $shiftRightUint64(v0, 32), new $Uint64(x$71.$high | x$72.$high, (x$71.$low | x$72.$low) >>> 0)); - v2 = (x$73 = v1, new $Uint64(v2.$high + x$73.$high, v2.$low + x$73.$low)); - v0 = (x$74 = v3, new $Uint64(v0.$high + x$74.$high, v0.$low + x$74.$low)); - v1 = (x$75 = $shiftLeft64(v1, 17), x$76 = $shiftRightUint64(v1, 47), new $Uint64(x$75.$high | x$76.$high, (x$75.$low | x$76.$low) >>> 0)); - v3 = (x$77 = $shiftLeft64(v3, 21), x$78 = $shiftRightUint64(v3, 43), new $Uint64(x$77.$high | x$78.$high, (x$77.$low | x$78.$low) >>> 0)); - v1 = (x$79 = v2, new $Uint64(v1.$high ^ x$79.$high, (v1.$low ^ x$79.$low) >>> 0)); - v3 = (x$80 = v0, new $Uint64(v3.$high ^ x$80.$high, (v3.$low ^ x$80.$low) >>> 0)); - v2 = (x$81 = $shiftLeft64(v2, 32), x$82 = $shiftRightUint64(v2, 32), new $Uint64(x$81.$high | x$82.$high, (x$81.$low | x$82.$low) >>> 0)); - v0 = (x$83 = v1, new $Uint64(v0.$high + x$83.$high, v0.$low + x$83.$low)); - v2 = (x$84 = v3, new $Uint64(v2.$high + x$84.$high, v2.$low + x$84.$low)); - v1 = (x$85 = $shiftLeft64(v1, 13), x$86 = $shiftRightUint64(v1, 51), new $Uint64(x$85.$high | x$86.$high, (x$85.$low | x$86.$low) >>> 0)); - v3 = (x$87 = $shiftLeft64(v3, 16), x$88 = $shiftRightUint64(v3, 48), new $Uint64(x$87.$high | x$88.$high, (x$87.$low | x$88.$low) >>> 0)); - v1 = (x$89 = v0, new $Uint64(v1.$high ^ x$89.$high, (v1.$low ^ x$89.$low) >>> 0)); - v3 = (x$90 = v2, new $Uint64(v3.$high ^ x$90.$high, (v3.$low ^ x$90.$low) >>> 0)); - v0 = (x$91 = $shiftLeft64(v0, 32), x$92 = $shiftRightUint64(v0, 32), new $Uint64(x$91.$high | x$92.$high, (x$91.$low | x$92.$low) >>> 0)); - v2 = (x$93 = v1, new $Uint64(v2.$high + x$93.$high, v2.$low + x$93.$low)); - v0 = (x$94 = v3, new $Uint64(v0.$high + x$94.$high, v0.$low + x$94.$low)); - v1 = (x$95 = $shiftLeft64(v1, 17), x$96 = $shiftRightUint64(v1, 47), new $Uint64(x$95.$high | x$96.$high, (x$95.$low | x$96.$low) >>> 0)); - v3 = (x$97 = $shiftLeft64(v3, 21), x$98 = $shiftRightUint64(v3, 43), new $Uint64(x$97.$high | x$98.$high, (x$97.$low | x$98.$low) >>> 0)); - v1 = (x$99 = v2, new $Uint64(v1.$high ^ x$99.$high, (v1.$low ^ x$99.$low) >>> 0)); - v3 = (x$100 = v0, new $Uint64(v3.$high ^ x$100.$high, (v3.$low ^ x$100.$low) >>> 0)); - v2 = (x$101 = $shiftLeft64(v2, 32), x$102 = $shiftRightUint64(v2, 32), new $Uint64(x$101.$high | x$102.$high, (x$101.$low | x$102.$low) >>> 0)); - v0 = (x$103 = v1, new $Uint64(v0.$high + x$103.$high, v0.$low + x$103.$low)); - v2 = (x$104 = v3, new $Uint64(v2.$high + x$104.$high, v2.$low + x$104.$low)); - v1 = (x$105 = $shiftLeft64(v1, 13), x$106 = $shiftRightUint64(v1, 51), new $Uint64(x$105.$high | x$106.$high, (x$105.$low | x$106.$low) >>> 0)); - v3 = (x$107 = $shiftLeft64(v3, 16), x$108 = $shiftRightUint64(v3, 48), new $Uint64(x$107.$high | x$108.$high, (x$107.$low | x$108.$low) >>> 0)); - v1 = (x$109 = v0, new $Uint64(v1.$high ^ x$109.$high, (v1.$low ^ x$109.$low) >>> 0)); - v3 = (x$110 = v2, new $Uint64(v3.$high ^ x$110.$high, (v3.$low ^ x$110.$low) >>> 0)); - v0 = (x$111 = $shiftLeft64(v0, 32), x$112 = $shiftRightUint64(v0, 32), new $Uint64(x$111.$high | x$112.$high, (x$111.$low | x$112.$low) >>> 0)); - v2 = (x$113 = v1, new $Uint64(v2.$high + x$113.$high, v2.$low + x$113.$low)); - v0 = (x$114 = v3, new $Uint64(v0.$high + x$114.$high, v0.$low + x$114.$low)); - v1 = (x$115 = $shiftLeft64(v1, 17), x$116 = $shiftRightUint64(v1, 47), new $Uint64(x$115.$high | x$116.$high, (x$115.$low | x$116.$low) >>> 0)); - v3 = (x$117 = $shiftLeft64(v3, 21), x$118 = $shiftRightUint64(v3, 43), new $Uint64(x$117.$high | x$118.$high, (x$117.$low | x$118.$low) >>> 0)); - v1 = (x$119 = v2, new $Uint64(v1.$high ^ x$119.$high, (v1.$low ^ x$119.$low) >>> 0)); - v3 = (x$120 = v0, new $Uint64(v3.$high ^ x$120.$high, (v3.$low ^ x$120.$low) >>> 0)); - v2 = (x$121 = $shiftLeft64(v2, 32), x$122 = $shiftRightUint64(v2, 32), new $Uint64(x$121.$high | x$122.$high, (x$121.$low | x$122.$low) >>> 0)); - return (x$123 = (x$124 = new $Uint64(v0.$high ^ v1.$high, (v0.$low ^ v1.$low) >>> 0), new $Uint64(x$124.$high ^ v2.$high, (x$124.$low ^ v2.$low) >>> 0)), new $Uint64(x$123.$high ^ v3.$high, (x$123.$low ^ v3.$low) >>> 0)); - }; - Cuckoo.prototype.siphash24 = function(nonce) { return this.$val.siphash24(nonce); }; - Cuckoo.ptr.prototype.Sipnode = function(nonce, uorv) { - var $ptr, nonce, self, uorv, x, x$1, x$2; - self = this; - return (x = self.siphash24((x$1 = $mul64(new $Uint64(0, 2), nonce), x$2 = new $Uint64(0, uorv), new $Uint64(x$1.$high + x$2.$high, x$1.$low + x$2.$low))), new $Uint64(x.$high & 0, (x.$low & 524287) >>> 0)); - }; - Cuckoo.prototype.Sipnode = function(nonce, uorv) { return this.$val.Sipnode(nonce, uorv); }; - Cuckoo.ptr.prototype.Verify = function(nonces, easiness) { - var $ptr, easiness, i, j, k, k$1, loop, n, nonces, self, us, vs, x, x$1, x$10, x$11, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - self = this; - us = $makeSlice(sliceType, 42); - vs = $makeSlice(sliceType, 42); - i = 0; - n = new $Uint64(0, 0); - n = new $Uint64(0, 0); - while (true) { - if (!((n.$high < 0 || (n.$high === 0 && n.$low < 42)))) { break; } - if ((x = (($flatten64(n) < 0 || $flatten64(n) >= nonces.$length) ? $throwRuntimeError("index out of range") : nonces.$array[nonces.$offset + $flatten64(n)]), (x.$high > easiness.$high || (x.$high === easiness.$high && x.$low >= easiness.$low))) || (!((n.$high === 0 && n.$low === 0)) && (x$1 = (($flatten64(n) < 0 || $flatten64(n) >= nonces.$length) ? $throwRuntimeError("index out of range") : nonces.$array[nonces.$offset + $flatten64(n)]), x$2 = (x$3 = new $Uint64(n.$high - 0, n.$low - 1), (($flatten64(x$3) < 0 || $flatten64(x$3) >= nonces.$length) ? $throwRuntimeError("index out of range") : nonces.$array[nonces.$offset + $flatten64(x$3)])), (x$1.$high < x$2.$high || (x$1.$high === x$2.$high && x$1.$low <= x$2.$low))))) { - return false; - } - (($flatten64(n) < 0 || $flatten64(n) >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + $flatten64(n)] = self.Sipnode((($flatten64(n) < 0 || $flatten64(n) >= nonces.$length) ? $throwRuntimeError("index out of range") : nonces.$array[nonces.$offset + $flatten64(n)]), 0)); - (($flatten64(n) < 0 || $flatten64(n) >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + $flatten64(n)] = self.Sipnode((($flatten64(n) < 0 || $flatten64(n) >= nonces.$length) ? $throwRuntimeError("index out of range") : nonces.$array[nonces.$offset + $flatten64(n)]), 1)); - n = (x$4 = new $Uint64(0, 1), new $Uint64(n.$high + x$4.$high, n.$low + x$4.$low)); - } - loop = true; - while (true) { - if (!(loop)) { break; } - j = i; - k = 0; - while (true) { - if (!((x$5 = new $Uint64(0, k), (x$5.$high < 0 || (x$5.$high === 0 && x$5.$low < 42))))) { break; } - if (!((k === i)) && (x$6 = ((k < 0 || k >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + k]), x$7 = ((i < 0 || i >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + i]), (x$6.$high === x$7.$high && x$6.$low === x$7.$low))) { - if (!((j === i))) { - return false; - } - j = k; - } - k = k + (1) >> 0; - } - if (j === i) { - return false; - } - i = j; - k$1 = 0; - while (true) { - if (!((x$8 = new $Uint64(0, k$1), (x$8.$high < 0 || (x$8.$high === 0 && x$8.$low < 42))))) { break; } - if (!((k$1 === j)) && (x$9 = ((k$1 < 0 || k$1 >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + k$1]), x$10 = ((j < 0 || j >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + j]), (x$9.$high === x$10.$high && x$9.$low === x$10.$low))) { - if (!((i === j))) { - return false; - } - i = k$1; - } - k$1 = k$1 + (1) >> 0; - } - if (i === j) { - return false; - } - n = (x$11 = new $Uint64(0, 2), new $Uint64(n.$high - x$11.$high, n.$low - x$11.$low)); - loop = !((i === 0)); - } - return (n.$high === 0 && n.$low === 0); - }; - Cuckoo.prototype.Verify = function(nonces, easiness) { return this.$val.Verify(nonces, easiness); }; - EncodeCuckooJSON = function(cuck) { - var $ptr, _r, cuck, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; cuck = $f.cuck; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - cuck = $clone(cuck, CuckooJSON); - _r = json.Marshal(new cuck.constructor.elem(cuck)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - /* */ $s = 2; case 2: - return _r; - /* */ } return; } if ($f === undefined) { $f = { $blk: EncodeCuckooJSON }; } $f.$ptr = $ptr; $f._r = _r; $f.cuck = cuck; $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.EncodeCuckooJSON = EncodeCuckooJSON; - ptrType$2.methods = [{prop: "Sipedge", name: "Sipedge", pkg: "", typ: $funcType([$Uint64], [ptrType$1], false)}, {prop: "siphash24", name: "siphash24", pkg: "github.com/ZiRo-/cuckgo/cuckoo", typ: $funcType([$Uint64], [$Uint64], false)}, {prop: "Sipnode", name: "Sipnode", pkg: "", typ: $funcType([$Uint64, $Uint32], [$Uint64], false)}, {prop: "Verify", name: "Verify", pkg: "", typ: $funcType([sliceType, $Uint64], [$Bool], false)}]; - ptrType$1.methods = [{prop: "HashCode", name: "HashCode", pkg: "", typ: $funcType([], [$Int], false)}]; - Cuckoo.init([{prop: "v", name: "v", pkg: "github.com/ZiRo-/cuckgo/cuckoo", typ: arrayType$1, tag: ""}]); - Edge.init([{prop: "U", name: "U", pkg: "", typ: $Uint64, tag: ""}, {prop: "V", name: "V", pkg: "", typ: $Uint64, tag: ""}]); - CuckooJSON.init([{prop: "Parameter", name: "Parameter", pkg: "", typ: mapType, tag: "json:\"parameters\""}, {prop: "InputData", name: "InputData", pkg: "", typ: sliceType$1, tag: "json:\"header\""}, {prop: "Cycle", name: "Cycle", pkg: "", typ: sliceType, tag: "json:\"cycle\""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = sha256.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = json.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); -$packages["main"] = (function() { - var $pkg = {}, $init, rand, sha256, base64, cuckoo, js, CuckooSolve, ptrType, sliceType, sliceType$1, ptrType$1, sliceType$2, arrayType, sliceType$3, funcType, mapType, ptrType$2, NewCuckooSolve, contains, worker, mine_cuckoo, formatProof, main; - rand = $packages["crypto/rand"]; - sha256 = $packages["crypto/sha256"]; - base64 = $packages["encoding/base64"]; - cuckoo = $packages["github.com/ZiRo-/cuckgo/cuckoo"]; - js = $packages["github.com/gopherjs/gopherjs/js"]; - CuckooSolve = $pkg.CuckooSolve = $newType(0, $kindStruct, "main.CuckooSolve", "CuckooSolve", "main", function(graph_, easiness_, cuckoo_, sols_, nsols_, nthreads_) { - this.$val = this; - if (arguments.length === 0) { - this.graph = ptrType.nil; - this.easiness = 0; - this.cuckoo = sliceType.nil; - this.sols = sliceType$1.nil; - this.nsols = 0; - this.nthreads = 0; - return; - } - this.graph = graph_; - this.easiness = easiness_; - this.cuckoo = cuckoo_; - this.sols = sols_; - this.nsols = nsols_; - this.nthreads = nthreads_; - }); - ptrType = $ptrType(cuckoo.Cuckoo); - sliceType = $sliceType($Int); - sliceType$1 = $sliceType(sliceType); - ptrType$1 = $ptrType(cuckoo.Edge); - sliceType$2 = $sliceType($Uint8); - arrayType = $arrayType($Uint8, 32); - sliceType$3 = $sliceType($Uint64); - funcType = $funcType([$Float64], [$String], false); - mapType = $mapType($String, $emptyInterface); - ptrType$2 = $ptrType(CuckooSolve); - NewCuckooSolve = function(hdr, en, ms, nt) { - var $ptr, _i, _ref, en, hdr, i, ms, nt, self, x; - self = new CuckooSolve.ptr(cuckoo.NewCuckoo(hdr), en, $makeSlice(sliceType, 1048577), $makeSlice(sliceType$1, ($imul(2, ms))), 0, 1); - _ref = self.sols; - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - (x = self.sols, ((i < 0 || i >= x.$length) ? $throwRuntimeError("index out of range") : x.$array[x.$offset + i] = $makeSlice(sliceType, 42))); - _i++; - } - return self; - }; - $pkg.NewCuckooSolve = NewCuckooSolve; - CuckooSolve.ptr.prototype.path = function(u, us) { - var $ptr, nu, self, u, us, x, x$1; - self = this; - nu = 0; - nu = 0; - while (true) { - if (!(!((u === 0)))) { break; } - nu = nu + (1) >> 0; - if (nu >= 4096) { - while (true) { - if (!(!((nu === 0)) && !(((x = nu - 1 >> 0, ((x < 0 || x >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + x])) === u)))) { break; } - nu = nu - (1) >> 0; - } - if (nu < 0) { - } else { - } - return -1; - } - ((nu < 0 || nu >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + nu] = u); - u = (x$1 = self.cuckoo, ((u < 0 || u >= x$1.$length) ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + u])); - } - return nu; - }; - CuckooSolve.prototype.path = function(u, us) { return this.$val.path(u, us); }; - CuckooSolve.ptr.prototype.solution = function(us, nu, vs, nv) { - var $ptr, _entry, _entry$1, _key, _key$1, _key$2, _tuple, _tuple$1, _tuple$2, cycle, e, edg, edg$1, edg$2, has, has$1, has$2, key, n, nonce, nu, nv, self, us, vs, x, x$1, x$10, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - self = this; - cycle = {}; - n = 0; - edg = new cuckoo.Edge.ptr(new $Uint64(0, (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0])), (x = new $Uint64(0, (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0])), new $Uint64(x.$high - 0, x.$low - 524288))); - _key = edg.HashCode(); (cycle || $throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(_key)] = { k: _key, v: edg }; - while (true) { - if (!(!((nu === 0)))) { break; } - nu = nu - (1) >> 0; - edg$1 = new cuckoo.Edge.ptr(new $Uint64(0, (x$1 = (((nu + 1 >> 0)) & ~1) >> 0, ((x$1 < 0 || x$1 >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + x$1]))), (x$2 = new $Uint64(0, (x$3 = nu | 1, ((x$3 < 0 || x$3 >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + x$3]))), new $Uint64(x$2.$high - 0, x$2.$low - 524288))); - _tuple = (_entry = cycle[$Int.keyFor(edg$1.HashCode())], _entry !== undefined ? [_entry.v, true] : [ptrType$1.nil, false]); - has = _tuple[1]; - if (!has) { - _key$1 = edg$1.HashCode(); (cycle || $throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(_key$1)] = { k: _key$1, v: edg$1 }; - } - } - while (true) { - if (!(!((nv === 0)))) { break; } - nv = nv - (1) >> 0; - edg$2 = new cuckoo.Edge.ptr(new $Uint64(0, (x$4 = nv | 1, ((x$4 < 0 || x$4 >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + x$4]))), (x$5 = new $Uint64(0, (x$6 = (((nv + 1 >> 0)) & ~1) >> 0, ((x$6 < 0 || x$6 >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + x$6]))), new $Uint64(x$5.$high - 0, x$5.$low - 524288))); - _tuple$1 = (_entry$1 = cycle[$Int.keyFor(edg$2.HashCode())], _entry$1 !== undefined ? [_entry$1.v, true] : [ptrType$1.nil, false]); - has$1 = _tuple$1[1]; - if (!has$1) { - _key$2 = edg$2.HashCode(); (cycle || $throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(_key$2)] = { k: _key$2, v: edg$2 }; - } - } - n = 0; - nonce = 0; - while (true) { - if (!(nonce < self.easiness)) { break; } - e = self.graph.Sipedge(new $Uint64(0, nonce)); - _tuple$2 = contains(cycle, e); - has$2 = _tuple$2[0]; - key = _tuple$2[1]; - if (has$2) { - (x$7 = (x$8 = self.sols, x$9 = self.nsols, ((x$9 < 0 || x$9 >= x$8.$length) ? $throwRuntimeError("index out of range") : x$8.$array[x$8.$offset + x$9])), ((n < 0 || n >= x$7.$length) ? $throwRuntimeError("index out of range") : x$7.$array[x$7.$offset + n] = nonce)); - n = n + (1) >> 0; - delete cycle[$Int.keyFor(key)]; - } - nonce = nonce + (1) >> 0; - } - if ((x$10 = new $Uint64(0, n), (x$10.$high === 0 && x$10.$low === 42))) { - self.nsols = self.nsols + (1) >> 0; - } else { - } - }; - CuckooSolve.prototype.solution = function(us, nu, vs, nv) { return this.$val.solution(us, nu, vs, nv); }; - contains = function(m, e) { - var $ptr, _entry, _i, _keys, _ref, e, h, k, m, v, x, x$1, x$2, x$3; - h = e.HashCode(); - _ref = m; - _i = 0; - _keys = $keys(_ref); - while (true) { - if (!(_i < _keys.length)) { break; } - _entry = _ref[_keys[_i]]; - if (_entry === undefined) { - _i++; - continue; - } - k = _entry.k; - v = _entry.v; - if ((k === h) && (x = v.U, x$1 = e.U, (x.$high === x$1.$high && x.$low === x$1.$low)) && (x$2 = v.V, x$3 = e.V, (x$2.$high === x$3.$high && x$2.$low === x$3.$low))) { - return [true, k]; - } - _i++; - } - return [false, 0]; - }; - worker = function(id, solve) { - var $ptr, cuck, id, length, min, nonce, nu, nv, solve, u, us, v, vs, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9; - cuck = solve.cuckoo; - us = $makeSlice(sliceType, 4096); - vs = $makeSlice(sliceType, 4096); - nonce = id; - while (true) { - if (!(nonce < solve.easiness)) { break; } - (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0] = (solve.graph.Sipnode(new $Uint64(0, nonce), 0).$low >> 0)); - u = (x = (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0]), ((x < 0 || x >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x])); - (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0] = ((x$1 = solve.graph.Sipnode(new $Uint64(0, nonce), 1), new $Uint64(0 + x$1.$high, 524288 + x$1.$low)).$low >> 0)); - v = (x$2 = (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0]), ((x$2 < 0 || x$2 >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x$2])); - if ((u === (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0])) || (v === (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0]))) { - nonce = nonce + (solve.nthreads) >> 0; - continue; - } - nu = solve.path(u, us); - nv = solve.path(v, vs); - if ((nu === -1) || (nv === -1)) { - return; - } - if (((nu < 0 || nu >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + nu]) === ((nv < 0 || nv >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + nv])) { - min = 0; - if (nu < nv) { - min = nu; - } else { - min = nv; - } - nu = nu - (min) >> 0; - nv = nv - (min) >> 0; - while (true) { - if (!(!((((nu < 0 || nu >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + nu]) === ((nv < 0 || nv >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + nv]))))) { break; } - nu = nu + (1) >> 0; - nv = nv + (1) >> 0; - } - length = (nu + nv >> 0) + 1 >> 0; - if ((x$3 = new $Uint64(0, length), (x$3.$high === 0 && x$3.$low === 42)) && solve.nsols < solve.sols.$length) { - solve.solution(us, nu, vs, nv); - } - nonce = nonce + (solve.nthreads) >> 0; - continue; - } - if (nu < nv) { - while (true) { - if (!(!((nu === 0)))) { break; } - nu = nu - (1) >> 0; - (x$4 = (x$5 = nu + 1 >> 0, ((x$5 < 0 || x$5 >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + x$5])), ((x$4 < 0 || x$4 >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x$4] = ((nu < 0 || nu >= us.$length) ? $throwRuntimeError("index out of range") : us.$array[us.$offset + nu]))); - } - (x$6 = (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0]), ((x$6 < 0 || x$6 >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x$6] = (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0]))); - } else { - while (true) { - if (!(!((nv === 0)))) { break; } - nv = nv - (1) >> 0; - (x$7 = (x$8 = nv + 1 >> 0, ((x$8 < 0 || x$8 >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + x$8])), ((x$7 < 0 || x$7 >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x$7] = ((nv < 0 || nv >= vs.$length) ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + nv]))); - } - (x$9 = (0 >= vs.$length ? $throwRuntimeError("index out of range") : vs.$array[vs.$offset + 0]), ((x$9 < 0 || x$9 >= cuck.$length) ? $throwRuntimeError("index out of range") : cuck.$array[cuck.$offset + x$9] = (0 >= us.$length ? $throwRuntimeError("index out of range") : us.$array[us.$offset + 0]))); - } - nonce = nonce + (solve.nthreads) >> 0; - } - }; - mine_cuckoo = function(easipct) { - var $ptr, _r, _r$1, _tuple, _tuple$1, b, c, easipct, easy, err, i, json, k, maxsols, solve, str, x, $s, $r; - /* */ $s = 0; var $f, $c = false; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $ptr = $f.$ptr; _r = $f._r; _r$1 = $f._r$1; _tuple = $f._tuple; _tuple$1 = $f._tuple$1; b = $f.b; c = $f.c; easipct = $f.easipct; easy = $f.easy; err = $f.err; i = $f.i; json = $f.json; k = $f.k; maxsols = $f.maxsols; solve = $f.solve; str = $f.str; x = $f.x; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - maxsols = 8; - b = $makeSlice(sliceType$2, 64); - _r = rand.Read(b); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; } - _tuple = _r; - err = _tuple[1]; - if (!($interfaceIsEqual(err, $ifaceNil))) { - $panic(err); - } - easy = (easipct * 1.048576e+06 / 100 >> 0); - solve = NewCuckooSolve(b, easy, maxsols, 1); - k = 0; - /* while (true) { */ case 2: - /* if (!(k < 960)) { break; } */ if(!(k < 960)) { $s = 3; continue; } - b = $append(b, 0); - i = 0; - /* while (true) { */ case 4: - /* if (!(i < 256)) { break; } */ if(!(i < 256)) { $s = 5; continue; } - (x = 64 + k >> 0, ((x < 0 || x >= b.$length) ? $throwRuntimeError("index out of range") : b.$array[b.$offset + x] = (i << 24 >>> 24))); - solve = NewCuckooSolve(b, easy, maxsols, 1); - worker(i, solve); - /* */ if (solve.nsols > 0) { $s = 6; continue; } - /* */ $s = 7; continue; - /* if (solve.nsols > 0) { */ case 6: - /* goto done */ $s = 8; continue; - /* } */ case 7: - i = i + (1) >> 0; - /* } */ $s = 4; continue; case 5: - k = k + (1) >> 0; - /* } */ $s = 2; continue; case 3: - /* done: */ case 8: - /* */ if (solve.sols.$length > 0) { $s = 9; continue; } - /* */ $s = 10; continue; - /* if (solve.sols.$length > 0) { */ case 9: - c = $clone(formatProof(solve, b), cuckoo.CuckooJSON); - _r$1 = cuckoo.EncodeCuckooJSON(c); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; } - _tuple$1 = _r$1; - json = _tuple$1[0]; - str = base64.StdEncoding.EncodeToString(json); - return str; - /* } else { */ case 10: - return "No Solution found."; - /* } */ case 11: - /* */ $s = -1; case -1: } return; } if ($f === undefined) { $f = { $blk: mine_cuckoo }; } $f.$ptr = $ptr; $f._r = _r; $f._r$1 = _r$1; $f._tuple = _tuple; $f._tuple$1 = _tuple$1; $f.b = b; $f.c = c; $f.easipct = easipct; $f.easy = easy; $f.err = err; $f.i = i; $f.json = json; $f.k = k; $f.maxsols = maxsols; $f.solve = solve; $f.str = str; $f.x = x; $f.$s = $s; $f.$r = $r; return $f; - }; - formatProof = function(solve, b) { - var $ptr, _i, _key, _ref, b, cycle, easy, i, m, n, sha, solve, x, x$1; - sha = $clone(sha256.Sum256(b), arrayType); - easy = new $Uint64(0, solve.easiness); - cycle = $makeSlice(sliceType$3, (x = solve.sols, (0 >= x.$length ? $throwRuntimeError("index out of range") : x.$array[x.$offset + 0])).$length); - m = {}; - _key = "easiness"; (m || $throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(_key)] = { k: _key, v: easy }; - _ref = (x$1 = solve.sols, (0 >= x$1.$length ? $throwRuntimeError("index out of range") : x$1.$array[x$1.$offset + 0])); - _i = 0; - while (true) { - if (!(_i < _ref.$length)) { break; } - i = _i; - n = ((_i < 0 || _i >= _ref.$length) ? $throwRuntimeError("index out of range") : _ref.$array[_ref.$offset + _i]); - ((i < 0 || i >= cycle.$length) ? $throwRuntimeError("index out of range") : cycle.$array[cycle.$offset + i] = new $Uint64(0, n)); - _i++; - } - return new cuckoo.CuckooJSON.ptr(m, new sliceType$2(sha), cycle); - }; - main = function() { - var $ptr; - $global.cuckoo = $externalize($makeMap($String.keyFor, [{ k: "mine_cuckoo", v: new funcType(mine_cuckoo) }]), mapType); - }; - ptrType$2.methods = [{prop: "path", name: "path", pkg: "main", typ: $funcType([$Int, sliceType], [$Int], false)}, {prop: "solution", name: "solution", pkg: "main", typ: $funcType([sliceType, $Int, sliceType, $Int], [], false)}]; - CuckooSolve.init([{prop: "graph", name: "graph", pkg: "main", typ: ptrType, tag: ""}, {prop: "easiness", name: "easiness", pkg: "main", typ: $Int, tag: ""}, {prop: "cuckoo", name: "cuckoo", pkg: "main", typ: sliceType, tag: ""}, {prop: "sols", name: "sols", pkg: "main", typ: sliceType$1, tag: ""}, {prop: "nsols", name: "nsols", pkg: "main", typ: $Int, tag: ""}, {prop: "nthreads", name: "nthreads", pkg: "main", typ: $Int, tag: ""}]); - $init = function() { - $pkg.$init = function() {}; - /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0: - $r = rand.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = sha256.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = base64.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = cuckoo.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - $r = js.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; } - if ($pkg === $mainPkg) { - main(); - $mainFinished = true; - } - /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f; - }; - $pkg.$init = $init; - return $pkg; -})(); +Error.stackTraceLimit=Infinity;var $global,$module;if(typeof window!=="undefined"){$global=window;}else if(typeof self!=="undefined"){$global=self;}else if(typeof global!=="undefined"){$global=global;$global.require=require;}else{$global=this;}if($global===undefined||$global.Array===undefined){throw new Error("no global object found");}if(typeof module!=="undefined"){$module=module;}var $packages={},$idCounter=0;var $keys=function(m){return m?Object.keys(m):[];};var $flushConsole=function(){};var $throwRuntimeError;var $throwNilPointerError=function(){$throwRuntimeError("invalid memory address or nil pointer dereference");};var $call=function(fn,rcvr,args){return fn.apply(rcvr,args);};var $makeFunc=function(fn){return function(){return fn(new($sliceType($jsObjectPtr))($global.Array.prototype.slice.call(arguments,[])));}};var $mapArray=function(array,f){var newArray=new array.constructor(array.length);for(var i=0;islice.$capacity||max>slice.$capacity){$throwRuntimeError("slice bounds out of range");}var s=new slice.constructor(slice.$array);s.$offset=slice.$offset+low;s.$length=slice.$length-low;s.$capacity=slice.$capacity-low;if(high!==undefined){s.$length=high-low;}if(max!==undefined){s.$capacity=max-low;}return s;};var $sliceToArray=function(slice){if(slice.$length===0){return[];}if(slice.$array.constructor!==Array){return slice.$array.subarray(slice.$offset,slice.$offset+slice.$length);}return slice.$array.slice(slice.$offset,slice.$offset+slice.$length);};var $decodeRune=function(str,pos){var c0=str.charCodeAt(pos);if(c0<0x80){return[c0,1];}if(c0!==c0||c0<0xC0){return[0xFFFD,1];}var c1=str.charCodeAt(pos+1);if(c1!==c1||c1<0x80||0xC0<=c1){return[0xFFFD,1];}if(c0<0xE0){var r=(c0&0x1F)<<6|(c1&0x3F);if(r<=0x7F){return[0xFFFD,1];}return[r,2];}var c2=str.charCodeAt(pos+2);if(c2!==c2||c2<0x80||0xC0<=c2){return[0xFFFD,1];}if(c0<0xF0){var r=(c0&0x0F)<<12|(c1&0x3F)<<6|(c2&0x3F);if(r<=0x7FF){return[0xFFFD,1];}if(0xD800<=r&&r<=0xDFFF){return[0xFFFD,1];}return[r,3];}var c3=str.charCodeAt(pos+3);if(c3!==c3||c3<0x80||0xC0<=c3){return[0xFFFD,1];}if(c0<0xF8){var r=(c0&0x07)<<18|(c1&0x3F)<<12|(c2&0x3F)<<6|(c3&0x3F);if(r<=0xFFFF||0x10FFFF0x10FFFF||(0xD800<=r&&r<=0xDFFF)){r=0xFFFD;}if(r<=0x7F){return String.fromCharCode(r);}if(r<=0x7FF){return String.fromCharCode(0xC0|r>>6,0x80|(r&0x3F));}if(r<=0xFFFF){return String.fromCharCode(0xE0|r>>12,0x80|(r>>6&0x3F),0x80|(r&0x3F));}return String.fromCharCode(0xF0|r>>18,0x80|(r>>12&0x3F),0x80|(r>>6&0x3F),0x80|(r&0x3F));};var $stringToBytes=function(str){var array=new Uint8Array(str.length);for(var i=0;isrcOffset){for(var i=n-1;i>=0;i--){elem.copy(dst[dstOffset+i],src[srcOffset+i]);}return;}for(var i=0;isrcOffset){for(var i=n-1;i>=0;i--){dst[dstOffset+i]=src[srcOffset+i];}return;}for(var i=0;inewCapacity){newOffset=0;newCapacity=Math.max(newLength,slice.$capacity<1024?slice.$capacity*2:Math.floor(slice.$capacity*5/4));if(slice.$array.constructor===Array){newArray=slice.$array.slice(slice.$offset,slice.$offset+slice.$length);newArray.length=newCapacity;var zero=slice.constructor.elem.zero;for(var i=slice.$length;i>>16)&0xffff;var al=a&0xffff;var bh=(b>>>16)&0xffff;var bl=b&0xffff;return((al*bl)+(((ah*bl+al*bh)<<16)>>>0)>>0);};var $floatKey=function(f){if(f!==f){$idCounter++;return"NaN$"+$idCounter;}return String(f);};var $flatten64=function(x){return x.$high*4294967296+x.$low;};var $shiftLeft64=function(x,y){if(y===0){return x;}if(y<32){return new x.constructor(x.$high<>>(32-y),(x.$low<>>0);}if(y<64){return new x.constructor(x.$low<<(y-32),0);}return new x.constructor(0,0);};var $shiftRightInt64=function(x,y){if(y===0){return x;}if(y<32){return new x.constructor(x.$high>>y,(x.$low>>>y|x.$high<<(32-y))>>>0);}if(y<64){return new x.constructor(x.$high>>31,(x.$high>>(y-32))>>>0);}if(x.$high<0){return new x.constructor(-1,4294967295);}return new x.constructor(0,0);};var $shiftRightUint64=function(x,y){if(y===0){return x;}if(y<32){return new x.constructor(x.$high>>>y,(x.$low>>>y|x.$high<<(32-y))>>>0);}if(y<64){return new x.constructor(0,x.$high>>>(y-32));}return new x.constructor(0,0);};var $mul64=function(x,y){var high=0,low=0;if((y.$low&1)!==0){high=x.$high;low=x.$low;}for(var i=1;i<32;i++){if((y.$low&1<>>(32-i);low+=(x.$low<>>0;}}for(var i=0;i<32;i++){if((y.$high&1<yHigh)||(xHigh===yHigh&&xLow>yLow))){yHigh=(yHigh<<1|yLow>>>31)>>>0;yLow=(yLow<<1)>>>0;n++;}for(var i=0;i<=n;i++){high=high<<1|low>>>31;low=(low<<1)>>>0;if((xHigh>yHigh)||(xHigh===yHigh&&xLow>=yLow)){xHigh=xHigh-yHigh;xLow=xLow-yLow;if(xLow<0){xHigh--;xLow+=4294967296;}low++;if(low===4294967296){high++;low=0;}}yLow=(yLow>>>1|yHigh<<(32-1))>>>0;yHigh=yHigh>>>1;}if(returnRemainder){return new x.constructor(xHigh*rs,xLow*rs);}return new x.constructor(high*s,low*s);};var $divComplex=function(n,d){var ninf=n.$real===Infinity||n.$real===-Infinity||n.$imag===Infinity||n.$imag===-Infinity;var dinf=d.$real===Infinity||d.$real===-Infinity||d.$imag===Infinity||d.$imag===-Infinity;var nnan=!ninf&&(n.$real!==n.$real||n.$imag!==n.$imag);var dnan=!dinf&&(d.$real!==d.$real||d.$imag!==d.$imag);if(nnan||dnan){return new n.constructor(NaN,NaN);}if(ninf&&!dinf){return new n.constructor(Infinity,Infinity);}if(!ninf&&dinf){return new n.constructor(0,0);}if(d.$real===0&&d.$imag===0){if(n.$real===0&&n.$imag===0){return new n.constructor(NaN,NaN);}return new n.constructor(Infinity,Infinity);}var a=Math.abs(d.$real);var b=Math.abs(d.$imag);if(a<=b){var ratio=d.$real/d.$imag;var denom=d.$real*ratio+d.$imag;return new n.constructor((n.$real*ratio+n.$imag)/denom,(n.$imag*ratio-n.$real)/denom);}var ratio=d.$imag/d.$real;var denom=d.$imag*ratio+d.$real;return new n.constructor((n.$imag*ratio+n.$real)/denom,(n.$imag-n.$real*ratio)/denom);};var $kindBool=1;var $kindInt=2;var $kindInt8=3;var $kindInt16=4;var $kindInt32=5;var $kindInt64=6;var $kindUint=7;var $kindUint8=8;var $kindUint16=9;var $kindUint32=10;var $kindUint64=11;var $kindUintptr=12;var $kindFloat32=13;var $kindFloat64=14;var $kindComplex64=15;var $kindComplex128=16;var $kindArray=17;var $kindChan=18;var $kindFunc=19;var $kindInterface=20;var $kindMap=21;var $kindPtr=22;var $kindSlice=23;var $kindString=24;var $kindStruct=25;var $kindUnsafePointer=26;var $methodSynthesizers=[];var $addMethodSynthesizer=function(f){if($methodSynthesizers===null){f();return;}$methodSynthesizers.push(f);};var $synthesizeMethods=function(){$methodSynthesizers.forEach(function(f){f();});$methodSynthesizers=null;};var $ifaceKeyFor=function(x){if(x===$ifaceNil){return'nil';}var c=x.constructor;return c.string+'$'+c.keyFor(x.$val);};var $identity=function(x){return x;};var $typeIDCounter=0;var $idKey=function(x){if(x.$id===undefined){$idCounter++;x.$id=$idCounter;}return String(x.$id);};var $newType=function(size,kind,string,name,pkg,constructor){var typ;switch(kind){case $kindBool:case $kindInt:case $kindInt8:case $kindInt16:case $kindInt32:case $kindUint:case $kindUint8:case $kindUint16:case $kindUint32:case $kindUintptr:case $kindUnsafePointer:typ=function(v){this.$val=v;};typ.wrapped=true;typ.keyFor=$identity;break;case $kindString:typ=function(v){this.$val=v;};typ.wrapped=true;typ.keyFor=function(x){return"$"+x;};break;case $kindFloat32:case $kindFloat64:typ=function(v){this.$val=v;};typ.wrapped=true;typ.keyFor=function(x){return $floatKey(x);};break;case $kindInt64:typ=function(high,low){this.$high=(high+Math.floor(Math.ceil(low)/4294967296))>>0;this.$low=low>>>0;this.$val=this;};typ.keyFor=function(x){return x.$high+"$"+x.$low;};break;case $kindUint64:typ=function(high,low){this.$high=(high+Math.floor(Math.ceil(low)/4294967296))>>>0;this.$low=low>>>0;this.$val=this;};typ.keyFor=function(x){return x.$high+"$"+x.$low;};break;case $kindComplex64:typ=function(real,imag){this.$real=$fround(real);this.$imag=$fround(imag);this.$val=this;};typ.keyFor=function(x){return x.$real+"$"+x.$imag;};break;case $kindComplex128:typ=function(real,imag){this.$real=real;this.$imag=imag;this.$val=this;};typ.keyFor=function(x){return x.$real+"$"+x.$imag;};break;case $kindArray:typ=function(v){this.$val=v;};typ.wrapped=true;typ.ptr=$newType(4,$kindPtr,"*"+string,"","",function(array){this.$get=function(){return array;};this.$set=function(v){typ.copy(this,v);};this.$val=array;});typ.init=function(elem,len){typ.elem=elem;typ.len=len;typ.comparable=elem.comparable;typ.keyFor=function(x){return Array.prototype.join.call($mapArray(x,function(e){return String(elem.keyFor(e)).replace(/\\/g,"\\\\").replace(/\$/g,"\\$");}),"$");};typ.copy=function(dst,src){$copyArray(dst,src,0,0,src.length,elem);};typ.ptr.init(typ);Object.defineProperty(typ.ptr.nil,"nilCheck",{get:$throwNilPointerError});};break;case $kindChan:typ=function(v){this.$val=v;};typ.wrapped=true;typ.keyFor=$idKey;typ.init=function(elem,sendOnly,recvOnly){typ.elem=elem;typ.sendOnly=sendOnly;typ.recvOnly=recvOnly;};break;case $kindFunc:typ=function(v){this.$val=v;};typ.wrapped=true;typ.init=function(params,results,variadic){typ.params=params;typ.results=results;typ.variadic=variadic;typ.comparable=false;};break;case $kindInterface:typ={implementedBy:{},missingMethodFor:{}};typ.keyFor=$ifaceKeyFor;typ.init=function(methods){typ.methods=methods;methods.forEach(function(m){$ifaceNil[m.prop]=$throwNilPointerError;});};break;case $kindMap:typ=function(v){this.$val=v;};typ.wrapped=true;typ.init=function(key,elem){typ.key=key;typ.elem=elem;typ.comparable=false;};break;case $kindPtr:typ=constructor||function(getter,setter,target){this.$get=getter;this.$set=setter;this.$target=target;this.$val=this;};typ.keyFor=$idKey;typ.init=function(elem){typ.elem=elem;typ.wrapped=(elem.kind===$kindArray);typ.nil=new typ($throwNilPointerError,$throwNilPointerError);};break;case $kindSlice:typ=function(array){if(array.constructor!==typ.nativeArray){array=new typ.nativeArray(array);}this.$array=array;this.$offset=0;this.$length=array.length;this.$capacity=array.length;this.$val=this;};typ.init=function(elem){typ.elem=elem;typ.comparable=false;typ.nativeArray=$nativeArray(elem.kind);typ.nil=new typ([]);};break;case $kindStruct:typ=function(v){this.$val=v;};typ.wrapped=true;typ.ptr=$newType(4,$kindPtr,"*"+string,"","",constructor);typ.ptr.elem=typ;typ.ptr.prototype.$get=function(){return this;};typ.ptr.prototype.$set=function(v){typ.copy(this,v);};typ.init=function(fields){typ.fields=fields;fields.forEach(function(f){if(!f.typ.comparable){typ.comparable=false;}});typ.keyFor=function(x){var val=x.$val;return $mapArray(fields,function(f){return String(f.typ.keyFor(val[f.prop])).replace(/\\/g,"\\\\").replace(/\$/g,"\\$");}).join("$");};typ.copy=function(dst,src){for(var i=0;i0){var next=[];var mset=[];current.forEach(function(e){if(seen[e.typ.string]){return;}seen[e.typ.string]=true;if(e.typ.typeName!==""){mset=mset.concat(e.typ.methods);if(e.indirect){mset=mset.concat($ptrType(e.typ).methods);}}switch(e.typ.kind){case $kindStruct:e.typ.fields.forEach(function(f){if(f.name===""){var fTyp=f.typ;var fIsPtr=(fTyp.kind===$kindPtr);next.push({typ:fIsPtr?fTyp.elem:fTyp,indirect:e.indirect||fIsPtr});}});break;case $kindInterface:mset=mset.concat(e.typ.methods);break;}});mset.forEach(function(m){if(base[m.name]===undefined){base[m.name]=m;}});current=next;}typ.methodSetCache=[];Object.keys(base).sort().forEach(function(name){typ.methodSetCache.push(base[name]);});return typ.methodSetCache;};var $Bool=$newType(1,$kindBool,"bool","bool","",null);var $Int=$newType(4,$kindInt,"int","int","",null);var $Int8=$newType(1,$kindInt8,"int8","int8","",null);var $Int16=$newType(2,$kindInt16,"int16","int16","",null);var $Int32=$newType(4,$kindInt32,"int32","int32","",null);var $Int64=$newType(8,$kindInt64,"int64","int64","",null);var $Uint=$newType(4,$kindUint,"uint","uint","",null);var $Uint8=$newType(1,$kindUint8,"uint8","uint8","",null);var $Uint16=$newType(2,$kindUint16,"uint16","uint16","",null);var $Uint32=$newType(4,$kindUint32,"uint32","uint32","",null);var $Uint64=$newType(8,$kindUint64,"uint64","uint64","",null);var $Uintptr=$newType(4,$kindUintptr,"uintptr","uintptr","",null);var $Float32=$newType(4,$kindFloat32,"float32","float32","",null);var $Float64=$newType(8,$kindFloat64,"float64","float64","",null);var $Complex64=$newType(8,$kindComplex64,"complex64","complex64","",null);var $Complex128=$newType(16,$kindComplex128,"complex128","complex128","",null);var $String=$newType(8,$kindString,"string","string","",null);var $UnsafePointer=$newType(4,$kindUnsafePointer,"unsafe.Pointer","Pointer","",null);var $nativeArray=function(elemKind){switch(elemKind){case $kindInt:return Int32Array;case $kindInt8:return Int8Array;case $kindInt16:return Int16Array;case $kindInt32:return Int32Array;case $kindUint:return Uint32Array;case $kindUint8:return Uint8Array;case $kindUint16:return Uint16Array;case $kindUint32:return Uint32Array;case $kindUintptr:return Uint32Array;case $kindFloat32:return Float32Array;case $kindFloat64:return Float64Array;default:return Array;}};var $toNativeArray=function(elemKind,array){var nativeArray=$nativeArray(elemKind);if(nativeArray===Array){return array;}return new nativeArray(array);};var $arrayTypes={};var $arrayType=function(elem,len){var typeKey=elem.id+"$"+len;var typ=$arrayTypes[typeKey];if(typ===undefined){typ=$newType(12,$kindArray,"["+len+"]"+elem.string,"","",null);$arrayTypes[typeKey]=typ;typ.init(elem,len);}return typ;};var $chanType=function(elem,sendOnly,recvOnly){var string=(recvOnly?"<-":"")+"chan"+(sendOnly?"<- ":" ")+elem.string;var field=sendOnly?"SendChan":(recvOnly?"RecvChan":"Chan");var typ=elem[field];if(typ===undefined){typ=$newType(4,$kindChan,string,"","",null);elem[field]=typ;typ.init(elem,sendOnly,recvOnly);}return typ;};var $Chan=function(elem,capacity){if(capacity<0||capacity>2147483647){$throwRuntimeError("makechan: size out of range");}this.$elem=elem;this.$capacity=capacity;this.$buffer=[];this.$sendQueue=[];this.$recvQueue=[];this.$closed=false;};var $chanNil=new $Chan(null,0);$chanNil.$sendQueue=$chanNil.$recvQueue={length:0,push:function(){},shift:function(){return undefined;},indexOf:function(){return-1;}};var $funcTypes={};var $funcType=function(params,results,variadic){var typeKey=$mapArray(params,function(p){return p.id;}).join(",")+"$"+$mapArray(results,function(r){return r.id;}).join(",")+"$"+variadic;var typ=$funcTypes[typeKey];if(typ===undefined){var paramTypes=$mapArray(params,function(p){return p.string;});if(variadic){paramTypes[paramTypes.length-1]="..."+paramTypes[paramTypes.length-1].substr(2);}var string="func("+paramTypes.join(", ")+")";if(results.length===1){string+=" "+results[0].string;}else if(results.length>1){string+=" ("+$mapArray(results,function(r){return r.string;}).join(", ")+")";}typ=$newType(4,$kindFunc,string,"","",null);$funcTypes[typeKey]=typ;typ.init(params,results,variadic);}return typ;};var $interfaceTypes={};var $interfaceType=function(methods){var typeKey=$mapArray(methods,function(m){return m.pkg+","+m.name+","+m.typ.id;}).join("$");var typ=$interfaceTypes[typeKey];if(typ===undefined){var string="interface {}";if(methods.length!==0){string="interface { "+$mapArray(methods,function(m){return(m.pkg!==""?m.pkg+".":"")+m.name+m.typ.string.substr(4);}).join("; ")+" }";}typ=$newType(8,$kindInterface,string,"","",null);$interfaceTypes[typeKey]=typ;typ.init(methods);}return typ;};var $emptyInterface=$interfaceType([]);var $ifaceNil={};var $error=$newType(8,$kindInterface,"error","error","",null);$error.init([{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}]);var $mapTypes={};var $mapType=function(key,elem){var typeKey=key.id+"$"+elem.id;var typ=$mapTypes[typeKey];if(typ===undefined){typ=$newType(4,$kindMap,"map["+key.string+"]"+elem.string,"","",null);$mapTypes[typeKey]=typ;typ.init(key,elem);}return typ;};var $makeMap=function(keyForFunc,entries){var m={};for(var i=0;i2147483647){$throwRuntimeError("makeslice: len out of range");}if(capacity<0||capacity2147483647){$throwRuntimeError("makeslice: cap out of range");}var array=new typ.nativeArray(capacity);if(typ.nativeArray===Array){for(var i=0;i=$curGoroutine.deferStack.length){throw jsErr;}if(jsErr!==null){var newErr=null;try{$curGoroutine.deferStack.push(deferred);$panic(new $jsErrorPtr(jsErr));}catch(err){newErr=err;}$curGoroutine.deferStack.pop();$callDeferred(deferred,newErr);return;}if($curGoroutine.asleep){return;}$stackDepthOffset--;var outerPanicStackDepth=$panicStackDepth;var outerPanicValue=$panicValue;var localPanicValue=$curGoroutine.panicStack.pop();if(localPanicValue!==undefined){$panicStackDepth=$getStackDepth();$panicValue=localPanicValue;}try{while(true){if(deferred===null){deferred=$curGoroutine.deferStack[$curGoroutine.deferStack.length-1];if(deferred===undefined){$panicStackDepth=null;if(localPanicValue.Object instanceof Error){throw localPanicValue.Object;}var msg;if(localPanicValue.constructor===$String){msg=localPanicValue.$val;}else if(localPanicValue.Error!==undefined){msg=localPanicValue.Error();}else if(localPanicValue.String!==undefined){msg=localPanicValue.String();}else{msg=localPanicValue;}throw new Error(msg);}}var call=deferred.pop();if(call===undefined){$curGoroutine.deferStack.pop();if(localPanicValue!==undefined){deferred=null;continue;}return;}var r=call[0].apply(call[2],call[1]);if(r&&r.$blk!==undefined){deferred.push([r.$blk,[],r]);if(fromPanic){throw null;}return;}if(localPanicValue!==undefined&&$panicStackDepth===null){throw null;}}}finally{if(localPanicValue!==undefined){if($panicStackDepth!==null){$curGoroutine.panicStack.push(localPanicValue);}$panicStackDepth=outerPanicStackDepth;$panicValue=outerPanicValue;}$stackDepthOffset++;}};var $panic=function(value){$curGoroutine.panicStack.push(value);$callDeferred(null,null,true);};var $recover=function(){if($panicStackDepth===null||($panicStackDepth!==undefined&&$panicStackDepth!==$getStackDepth()-2)){return $ifaceNil;}$panicStackDepth=null;return $panicValue;};var $throw=function(err){throw err;};var $dummyGoroutine={asleep:false,exit:false,deferStack:[],panicStack:[],canBlock:false};var $curGoroutine=$dummyGoroutine,$totalGoroutines=0,$awakeGoroutines=0,$checkForDeadlock=true;var $mainFinished=false;var $go=function(fun,args,direct){$totalGoroutines++;$awakeGoroutines++;var $goroutine=function(){try{$curGoroutine=$goroutine;var r=fun.apply(undefined,args);if(r&&r.$blk!==undefined){fun=function(){return r.$blk();};args=[];return;}$goroutine.exit=true;}catch(err){if(!$goroutine.exit){throw err;}}finally{$curGoroutine=$dummyGoroutine;if($goroutine.exit){$totalGoroutines--;$goroutine.asleep=true;}if($goroutine.asleep){$awakeGoroutines--;if(!$mainFinished&&$awakeGoroutines===0&&$checkForDeadlock){console.error("fatal error: all goroutines are asleep - deadlock!");if($global.process!==undefined){$global.process.exit(2);}}}}};$goroutine.asleep=false;$goroutine.exit=false;$goroutine.deferStack=[];$goroutine.panicStack=[];$goroutine.canBlock=true;$schedule($goroutine,direct);};var $scheduled=[],$schedulerActive=false;var $runScheduled=function(){try{var r;while((r=$scheduled.shift())!==undefined){r();}$schedulerActive=false;}finally{if($schedulerActive){setTimeout($runScheduled,0);}}};var $schedule=function(goroutine,direct){if(goroutine.asleep){goroutine.asleep=false;$awakeGoroutines++;}if(direct){goroutine();return;}$scheduled.push(goroutine);if(!$schedulerActive){$schedulerActive=true;setTimeout($runScheduled,0);}};var $setTimeout=function(f,t){$awakeGoroutines++;return setTimeout(function(){$awakeGoroutines--;f();},t);};var $block=function(){if(!$curGoroutine.canBlock){$throwRuntimeError("cannot block in JavaScript callback, fix by wrapping code in goroutine");}$curGoroutine.asleep=true;};var $send=function(chan,value){if(chan.$closed){$throwRuntimeError("send on closed channel");}var queuedRecv=chan.$recvQueue.shift();if(queuedRecv!==undefined){queuedRecv([value,true]);return;}if(chan.$buffer.length0xFFFF){var h=Math.floor((c-0x10000)/0x400)+0xD800;var l=(c-0x10000)%0x400+0xDC00;s+=String.fromCharCode(h,l);continue;}s+=String.fromCharCode(c);}return s;case $kindStruct:var timePkg=$packages["time"];if(timePkg!==undefined&&v.constructor===timePkg.Time.ptr){var milli=$div64(v.UnixNano(),new $Int64(0,1000000));return new Date($flatten64(milli));}var noJsObject={};var searchJsObject=function(v,t){if(t===$jsObjectPtr){return v;}switch(t.kind){case $kindPtr:if(v===t.nil){return noJsObject;}return searchJsObject(v.$get(),t.elem);case $kindStruct:var f=t.fields[0];return searchJsObject(v[f.prop],f.typ);case $kindInterface:return searchJsObject(v.$val,v.constructor);default:return noJsObject;}};var o=searchJsObject(v,t);if(o!==noJsObject){return o;}o={};for(var i=0;i>24;case $kindInt16:return parseInt(v)<<16>>16;case $kindInt32:return parseInt(v)>>0;case $kindUint:return parseInt(v);case $kindUint8:return parseInt(v)<<24>>>24;case $kindUint16:return parseInt(v)<<16>>>16;case $kindUint32:case $kindUintptr:return parseInt(v)>>>0;case $kindInt64:case $kindUint64:return new t(0,v);case $kindFloat32:case $kindFloat64:return parseFloat(v);case $kindArray:if(v.length!==t.len){$throwRuntimeError("got array with wrong size from JavaScript native");}return $mapArray(v,function(e){return $internalize(e,t.elem);});case $kindFunc:return function(){var args=[];for(var i=0;i>0;};A.prototype.Int=function(){return this.$val.Int();};A.ptr.prototype.Int64=function(){var $ptr,a;a=this;return $internalize(a.object,$Int64);};A.prototype.Int64=function(){return this.$val.Int64();};A.ptr.prototype.Uint64=function(){var $ptr,a;a=this;return $internalize(a.object,$Uint64);};A.prototype.Uint64=function(){return this.$val.Uint64();};A.ptr.prototype.Float=function(){var $ptr,a;a=this;return $parseFloat(a.object);};A.prototype.Float=function(){return this.$val.Float();};A.ptr.prototype.Interface=function(){var $ptr,a;a=this;return $internalize(a.object,$emptyInterface);};A.prototype.Interface=function(){return this.$val.Interface();};A.ptr.prototype.Unsafe=function(){var $ptr,a;a=this;return a.object;};A.prototype.Unsafe=function(){return this.$val.Unsafe();};B.ptr.prototype.Error=function(){var $ptr,a;a=this;return"JavaScript error: "+$internalize(a.Object.message,$String);};B.prototype.Error=function(){return this.$val.Error();};B.ptr.prototype.Stack=function(){var $ptr,a;a=this;return $internalize(a.Object.stack,$String);};B.prototype.Stack=function(){return this.$val.Stack();};K=function(){var $ptr,a;a=new B.ptr(null);};N.methods=[{prop:"Get",name:"Get",pkg:"",typ:$funcType([$String],[N],false)},{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String,$emptyInterface],[],false)},{prop:"Delete",name:"Delete",pkg:"",typ:$funcType([$String],[],false)},{prop:"Length",name:"Length",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Index",name:"Index",pkg:"",typ:$funcType([$Int],[N],false)},{prop:"SetIndex",name:"SetIndex",pkg:"",typ:$funcType([$Int,$emptyInterface],[],false)},{prop:"Call",name:"Call",pkg:"",typ:$funcType([$String,L],[N],true)},{prop:"Invoke",name:"Invoke",pkg:"",typ:$funcType([L],[N],true)},{prop:"New",name:"New",pkg:"",typ:$funcType([L],[N],true)},{prop:"Bool",name:"Bool",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Int",name:"Int",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Int64",name:"Int64",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"Uint64",name:"Uint64",pkg:"",typ:$funcType([],[$Uint64],false)},{prop:"Float",name:"Float",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Interface",name:"Interface",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"Unsafe",name:"Unsafe",pkg:"",typ:$funcType([],[$Uintptr],false)}];Q.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)},{prop:"Stack",name:"Stack",pkg:"",typ:$funcType([],[$String],false)}];A.init([{prop:"object",name:"object",pkg:"github.com/gopherjs/gopherjs/js",typ:N,tag:""}]);B.init([{prop:"Object",name:"",pkg:"",typ:N,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:K();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["runtime/internal/sys"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["runtime"]=(function(){var $pkg={},$init,B,A,AD,AE,AF,AU,D,E,J,K,Q;B=$packages["github.com/gopherjs/gopherjs/js"];A=$packages["runtime/internal/sys"];AD=$pkg.Error=$newType(8,$kindInterface,"runtime.Error","Error","runtime",null);AE=$pkg.TypeAssertionError=$newType(0,$kindStruct,"runtime.TypeAssertionError","TypeAssertionError","runtime",function(interfaceString_,concreteString_,assertedString_,missingMethod_){this.$val=this;if(arguments.length===0){this.interfaceString="";this.concreteString="";this.assertedString="";this.missingMethod="";return;}this.interfaceString=interfaceString_;this.concreteString=concreteString_;this.assertedString=assertedString_;this.missingMethod=missingMethod_;});AF=$pkg.errorString=$newType(8,$kindString,"runtime.errorString","errorString","runtime",null);AU=$ptrType(AE);D=function(){var $ptr,a,b;a=$packages[$externalize("github.com/gopherjs/gopherjs/js",$String)];$jsObjectPtr=a.Object.ptr;$jsErrorPtr=a.Error.ptr;$throwRuntimeError=(function(b){var $ptr,b;$panic(new AF(b));});b=$ifaceNil;b=new AE.ptr("","","","");};E=function(){var $ptr,a,b;a=$global.process;if(a===undefined){return"/";}b=a.env.GOROOT;if(!(b===undefined)){return $internalize(b,$String);}return"/home/mathias/src/go";};$pkg.GOROOT=E;J=function(){var $ptr;$curGoroutine.exit=$externalize(true,$Bool);$throw(null);};$pkg.Goexit=J;K=function(a){var $ptr,a;return 1;};$pkg.GOMAXPROCS=K;Q=function(a,b){var $ptr,a,b;};$pkg.SetFinalizer=Q;AE.ptr.prototype.RuntimeError=function(){var $ptr;};AE.prototype.RuntimeError=function(){return this.$val.RuntimeError();};AE.ptr.prototype.Error=function(){var $ptr,a,b;a=this;b=a.interfaceString;if(b===""){b="interface";}if(a.concreteString===""){return"interface conversion: "+b+" is nil, not "+a.assertedString;}if(a.missingMethod===""){return"interface conversion: "+b+" is "+a.concreteString+", not "+a.assertedString;}return"interface conversion: "+a.concreteString+" is not "+a.assertedString+": missing method "+a.missingMethod;};AE.prototype.Error=function(){return this.$val.Error();};AF.prototype.RuntimeError=function(){var $ptr,a;a=this.$val;};$ptrType(AF).prototype.RuntimeError=function(){return new AF(this.$get()).RuntimeError();};AF.prototype.Error=function(){var $ptr,a;a=this.$val;return"runtime error: "+a;};$ptrType(AF).prototype.Error=function(){return new AF(this.$get()).Error();};AU.methods=[{prop:"RuntimeError",name:"RuntimeError",pkg:"",typ:$funcType([],[],false)},{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];AF.methods=[{prop:"RuntimeError",name:"RuntimeError",pkg:"",typ:$funcType([],[],false)},{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];AD.init([{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)},{prop:"RuntimeError",name:"RuntimeError",pkg:"",typ:$funcType([],[],false)}]);AE.init([{prop:"interfaceString",name:"interfaceString",pkg:"runtime",typ:$String,tag:""},{prop:"concreteString",name:"concreteString",pkg:"runtime",typ:$String,tag:""},{prop:"assertedString",name:"assertedString",pkg:"runtime",typ:$String,tag:""},{prop:"missingMethod",name:"missingMethod",pkg:"runtime",typ:$String,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=B.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}D();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["errors"]=(function(){var $pkg={},$init,B,C,A;B=$pkg.errorString=$newType(0,$kindStruct,"errors.errorString","errorString","errors",function(s_){this.$val=this;if(arguments.length===0){this.s="";return;}this.s=s_;});C=$ptrType(B);A=function(a){var $ptr,a;return new B.ptr(a);};$pkg.New=A;B.ptr.prototype.Error=function(){var $ptr,a;a=this;return a.s;};B.prototype.Error=function(){return this.$val.Error();};C.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];B.init([{prop:"s",name:"s",pkg:"errors",typ:$String,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["internal/race"]=(function(){var $pkg={},$init,A,B,C,D,E,H,I;A=function(a){var $ptr,a;};$pkg.Acquire=A;B=function(a){var $ptr,a;};$pkg.Release=B;C=function(a){var $ptr,a;};$pkg.ReleaseMerge=C;D=function(){var $ptr;};$pkg.Disable=D;E=function(){var $ptr;};$pkg.Enable=E;H=function(a,b){var $ptr,a,b;};$pkg.ReadRange=H;I=function(a,b){var $ptr,a,b;};$pkg.WriteRange=I;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["sync/atomic"]=(function(){var $pkg={},$init,A,H,N,U,AA;A=$packages["github.com/gopherjs/gopherjs/js"];H=function(ad,ae,af){var $ptr,ad,ae,af;if(ad.$get()===ae){ad.$set(af);return true;}return false;};$pkg.CompareAndSwapInt32=H;N=function(ad,ae){var $ptr,ad,ae,af;af=ad.$get()+ae>>0;ad.$set(af);return af;};$pkg.AddInt32=N;U=function(ad){var $ptr,ad;return ad.$get();};$pkg.LoadUint32=U;AA=function(ad,ae){var $ptr,ad,ae;ad.$set(ae);};$pkg.StoreUint32=AA;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["sync"]=(function(){var $pkg={},$init,A,C,B,F,O,P,Q,R,Z,AE,AF,AG,AH,AI,AJ,AK,AO,AR,AS,AT,AU,AX,BC,BD,BE,BF,H,U,E,G,I,J,K,S,V,W,AC,AD;A=$packages["internal/race"];C=$packages["runtime"];B=$packages["sync/atomic"];F=$pkg.Pool=$newType(0,$kindStruct,"sync.Pool","Pool","sync",function(local_,localSize_,store_,New_){this.$val=this;if(arguments.length===0){this.local=0;this.localSize=0;this.store=AS.nil;this.New=$throwNilPointerError;return;}this.local=local_;this.localSize=localSize_;this.store=store_;this.New=New_;});O=$pkg.Mutex=$newType(0,$kindStruct,"sync.Mutex","Mutex","sync",function(state_,sema_){this.$val=this;if(arguments.length===0){this.state=0;this.sema=0;return;}this.state=state_;this.sema=sema_;});P=$pkg.Locker=$newType(8,$kindInterface,"sync.Locker","Locker","sync",null);Q=$pkg.Once=$newType(0,$kindStruct,"sync.Once","Once","sync",function(m_,done_){this.$val=this;if(arguments.length===0){this.m=new O.ptr(0,0);this.done=0;return;}this.m=m_;this.done=done_;});R=$pkg.poolLocal=$newType(0,$kindStruct,"sync.poolLocal","poolLocal","sync",function(private$0_,shared_,Mutex_,pad_){this.$val=this;if(arguments.length===0){this.private$0=$ifaceNil;this.shared=AS.nil;this.Mutex=new O.ptr(0,0);this.pad=BF.zero();return;}this.private$0=private$0_;this.shared=shared_;this.Mutex=Mutex_;this.pad=pad_;});Z=$pkg.syncSema=$newType(0,$kindStruct,"sync.syncSema","syncSema","sync",function(lock_,head_,tail_){this.$val=this;if(arguments.length===0){this.lock=0;this.head=0;this.tail=0;return;}this.lock=lock_;this.head=head_;this.tail=tail_;});AE=$pkg.RWMutex=$newType(0,$kindStruct,"sync.RWMutex","RWMutex","sync",function(w_,writerSem_,readerSem_,readerCount_,readerWait_){this.$val=this;if(arguments.length===0){this.w=new O.ptr(0,0);this.writerSem=0;this.readerSem=0;this.readerCount=0;this.readerWait=0;return;}this.w=w_;this.writerSem=writerSem_;this.readerSem=readerSem_;this.readerCount=readerCount_;this.readerWait=readerWait_;});AF=$pkg.rlocker=$newType(0,$kindStruct,"sync.rlocker","rlocker","sync",function(w_,writerSem_,readerSem_,readerCount_,readerWait_){this.$val=this;if(arguments.length===0){this.w=new O.ptr(0,0);this.writerSem=0;this.readerSem=0;this.readerCount=0;this.readerWait=0;return;}this.w=w_;this.writerSem=writerSem_;this.readerSem=readerSem_;this.readerCount=readerCount_;this.readerWait=readerWait_;});AG=$ptrType(F);AH=$sliceType(AG);AI=$ptrType($Uint32);AJ=$chanType($Bool,false,false);AK=$sliceType(AJ);AO=$ptrType($Int32);AR=$ptrType(R);AS=$sliceType($emptyInterface);AT=$ptrType(AF);AU=$ptrType(AE);AX=$funcType([],[$emptyInterface],false);BC=$ptrType(O);BD=$funcType([],[],false);BE=$ptrType(Q);BF=$arrayType($Uint8,128);E=function(i){var $ptr,i;};F.ptr.prototype.Get=function(){var $ptr,i,j,k,l,m,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:i=this;if(i.store.$length===0){$s=1;continue;}$s=2;continue;case 1:if(!(i.New===$throwNilPointerError)){$s=3;continue;}$s=4;continue;case 3:j=i.New();$s=5;case 5:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}$s=6;case 6:return j;case 4:return $ifaceNil;case 2:m=(k=i.store,l=i.store.$length-1>>0,((l<0||l>=k.$length)?$throwRuntimeError("index out of range"):k.$array[k.$offset+l]));i.store=$subslice(i.store,0,(i.store.$length-1>>0));return m;}return;}if($f===undefined){$f={$blk:F.ptr.prototype.Get};}$f.$ptr=$ptr;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.$s=$s;$f.$r=$r;return $f;};F.prototype.Get=function(){return this.$val.Get();};F.ptr.prototype.Put=function(i){var $ptr,i,j;j=this;if($interfaceIsEqual(i,$ifaceNil)){return;}j.store=$append(j.store,i);};F.prototype.Put=function(i){return this.$val.Put(i);};G=function(i){var $ptr,i;};I=function(i){var $ptr,i,j,k,l,m,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:if(i.$get()===0){$s=1;continue;}$s=2;continue;case 1:j=new $Chan($Bool,0);k=i;(H||$throwRuntimeError("assignment to entry in nil map"))[AI.keyFor(k)]={k:k,v:$append((l=H[AI.keyFor(i)],l!==undefined?l.v:AK.nil),j)};m=$recv(j);$s=3;case 3:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}m[0];case 2:i.$set(i.$get()-(1)>>>0);$s=-1;case-1:}return;}if($f===undefined){$f={$blk:I};}$f.$ptr=$ptr;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.$s=$s;$f.$r=$r;return $f;};J=function(i){var $ptr,i,j,k,l,m,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:i.$set(i.$get()+(1)>>>0);k=(j=H[AI.keyFor(i)],j!==undefined?j.v:AK.nil);if(k.$length===0){return;}l=(0>=k.$length?$throwRuntimeError("index out of range"):k.$array[k.$offset+0]);k=$subslice(k,1);m=i;(H||$throwRuntimeError("assignment to entry in nil map"))[AI.keyFor(m)]={k:m,v:k};if(k.$length===0){delete H[AI.keyFor(i)];}$r=$send(l,true);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:J};}$f.$ptr=$ptr;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.$s=$s;$f.$r=$r;return $f;};K=function(i){var $ptr,i;return false;};O.ptr.prototype.Lock=function(){var $ptr,i,j,k,l,m,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:i=this;if(B.CompareAndSwapInt32((i.$ptr_state||(i.$ptr_state=new AO(function(){return this.$target.state;},function($v){this.$target.state=$v;},i))),0,1)){if(false){A.Acquire(i);}return;}j=false;k=0;case 1:l=i.state;m=l|1;if(!(((l&1)===0))){$s=3;continue;}$s=4;continue;case 3:if(K(k)){if(!j&&((l&2)===0)&&!(((l>>2>>0)===0))&&B.CompareAndSwapInt32((i.$ptr_state||(i.$ptr_state=new AO(function(){return this.$target.state;},function($v){this.$target.state=$v;},i))),l,l|2)){j=true;}AD();k=k+(1)>>0;$s=1;continue;}m=l+4>>0;case 4:if(j){if((m&2)===0){$panic(new $String("sync: inconsistent mutex state"));}m=(m&~(2))>>0;}if(B.CompareAndSwapInt32((i.$ptr_state||(i.$ptr_state=new AO(function(){return this.$target.state;},function($v){this.$target.state=$v;},i))),l,m)){$s=5;continue;}$s=6;continue;case 5:if((l&1)===0){$s=2;continue;}$r=I((i.$ptr_sema||(i.$ptr_sema=new AI(function(){return this.$target.sema;},function($v){this.$target.sema=$v;},i))));$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}j=true;k=0;case 6:$s=1;continue;case 2:if(false){A.Acquire(i);}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:O.ptr.prototype.Lock};}$f.$ptr=$ptr;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.$s=$s;$f.$r=$r;return $f;};O.prototype.Lock=function(){return this.$val.Lock();};O.ptr.prototype.Unlock=function(){var $ptr,i,j,k,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;j=$f.j;k=$f.k;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:i=this;if(false){A.Release(i);}j=B.AddInt32((i.$ptr_state||(i.$ptr_state=new AO(function(){return this.$target.state;},function($v){this.$target.state=$v;},i))),-1);if((((j+1>>0))&1)===0){$panic(new $String("sync: unlock of unlocked mutex"));}k=j;case 1:if(((k>>2>>0)===0)||!(((k&3)===0))){return;}j=((k-4>>0))|2;if(B.CompareAndSwapInt32((i.$ptr_state||(i.$ptr_state=new AO(function(){return this.$target.state;},function($v){this.$target.state=$v;},i))),k,j)){$s=3;continue;}$s=4;continue;case 3:$r=J((i.$ptr_sema||(i.$ptr_sema=new AI(function(){return this.$target.sema;},function($v){this.$target.sema=$v;},i))));$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return;case 4:k=i.state;$s=1;continue;case 2:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:O.ptr.prototype.Unlock};}$f.$ptr=$ptr;$f.i=i;$f.j=j;$f.k=k;$f.$s=$s;$f.$r=$r;return $f;};O.prototype.Unlock=function(){return this.$val.Unlock();};Q.ptr.prototype.Do=function(i){var $ptr,i,j,$s,$deferred,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;j=$f.j;$s=$f.$s;$deferred=$f.$deferred;$r=$f.$r;}var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$deferred.index=$curGoroutine.deferStack.length;$curGoroutine.deferStack.push($deferred);j=this;if(B.LoadUint32((j.$ptr_done||(j.$ptr_done=new AI(function(){return this.$target.done;},function($v){this.$target.done=$v;},j))))===1){return;}$r=j.m.Lock();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$deferred.push([$methodVal(j.m,"Unlock"),[]]);if(j.done===0){$s=2;continue;}$s=3;continue;case 2:$deferred.push([B.StoreUint32,[(j.$ptr_done||(j.$ptr_done=new AI(function(){return this.$target.done;},function($v){this.$target.done=$v;},j))),1]]);$r=i();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 3:$s=-1;case-1:}return;}}catch(err){$err=err;$s=-1;}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){if($f===undefined){$f={$blk:Q.ptr.prototype.Do};}$f.$ptr=$ptr;$f.i=i;$f.j=j;$f.$s=$s;$f.$deferred=$deferred;$f.$r=$r;return $f;}}};Q.prototype.Do=function(i){return this.$val.Do(i);};S=function(){var $ptr,i,j,k,l,m,n,o,p,q,r;i=U;j=0;while(true){if(!(j=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+j]);((k<0||k>=U.$length)?$throwRuntimeError("index out of range"):U.$array[U.$offset+k]=AG.nil);m=0;while(true){if(!(m<(l.localSize>>0))){break;}n=W(l.local,m);n.private$0=$ifaceNil;o=n.shared;p=0;while(true){if(!(p=r.$length)?$throwRuntimeError("index out of range"):r.$array[r.$offset+q]=$ifaceNil));p++;}n.shared=AS.nil;m=m+(1)>>0;}l.local=0;l.localSize=0;j++;}U=new AH([]);};V=function(){var $ptr;G(S);};W=function(i,j){var $ptr,i,j,k;return(k=i,(k.nilCheck,((j<0||j>=k.length)?$throwRuntimeError("index out of range"):k[j])));};AC=function(){var $ptr,i;i=new Z.ptr(0,0,0);E(12);};AD=function(){$throwRuntimeError("native function not implemented: sync.runtime_doSpin");};AE.ptr.prototype.RLock=function(){var $ptr,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:i=this;if(false){A.Disable();}if(B.AddInt32((i.$ptr_readerCount||(i.$ptr_readerCount=new AO(function(){return this.$target.readerCount;},function($v){this.$target.readerCount=$v;},i))),1)<0){$s=1;continue;}$s=2;continue;case 1:$r=I((i.$ptr_readerSem||(i.$ptr_readerSem=new AI(function(){return this.$target.readerSem;},function($v){this.$target.readerSem=$v;},i))));$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:if(false){A.Enable();A.Acquire((i.$ptr_readerSem||(i.$ptr_readerSem=new AI(function(){return this.$target.readerSem;},function($v){this.$target.readerSem=$v;},i))));}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AE.ptr.prototype.RLock};}$f.$ptr=$ptr;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};AE.prototype.RLock=function(){return this.$val.RLock();};AE.ptr.prototype.RUnlock=function(){var $ptr,i,j,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;j=$f.j;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:i=this;if(false){A.ReleaseMerge((i.$ptr_writerSem||(i.$ptr_writerSem=new AI(function(){return this.$target.writerSem;},function($v){this.$target.writerSem=$v;},i))));A.Disable();}j=B.AddInt32((i.$ptr_readerCount||(i.$ptr_readerCount=new AO(function(){return this.$target.readerCount;},function($v){this.$target.readerCount=$v;},i))),-1);if(j<0){$s=1;continue;}$s=2;continue;case 1:if(((j+1>>0)===0)||((j+1>>0)===-1073741824)){A.Enable();$panic(new $String("sync: RUnlock of unlocked RWMutex"));}if(B.AddInt32((i.$ptr_readerWait||(i.$ptr_readerWait=new AO(function(){return this.$target.readerWait;},function($v){this.$target.readerWait=$v;},i))),-1)===0){$s=3;continue;}$s=4;continue;case 3:$r=J((i.$ptr_writerSem||(i.$ptr_writerSem=new AI(function(){return this.$target.writerSem;},function($v){this.$target.writerSem=$v;},i))));$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 4:case 2:if(false){A.Enable();}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AE.ptr.prototype.RUnlock};}$f.$ptr=$ptr;$f.i=i;$f.j=j;$f.$s=$s;$f.$r=$r;return $f;};AE.prototype.RUnlock=function(){return this.$val.RUnlock();};AE.ptr.prototype.Lock=function(){var $ptr,i,j,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;j=$f.j;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:i=this;if(false){A.Disable();}$r=i.w.Lock();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}j=B.AddInt32((i.$ptr_readerCount||(i.$ptr_readerCount=new AO(function(){return this.$target.readerCount;},function($v){this.$target.readerCount=$v;},i))),-1073741824)+1073741824>>0;if(!((j===0))&&!((B.AddInt32((i.$ptr_readerWait||(i.$ptr_readerWait=new AO(function(){return this.$target.readerWait;},function($v){this.$target.readerWait=$v;},i))),j)===0))){$s=2;continue;}$s=3;continue;case 2:$r=I((i.$ptr_writerSem||(i.$ptr_writerSem=new AI(function(){return this.$target.writerSem;},function($v){this.$target.writerSem=$v;},i))));$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 3:if(false){A.Enable();A.Acquire((i.$ptr_readerSem||(i.$ptr_readerSem=new AI(function(){return this.$target.readerSem;},function($v){this.$target.readerSem=$v;},i))));A.Acquire((i.$ptr_writerSem||(i.$ptr_writerSem=new AI(function(){return this.$target.writerSem;},function($v){this.$target.writerSem=$v;},i))));}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AE.ptr.prototype.Lock};}$f.$ptr=$ptr;$f.i=i;$f.j=j;$f.$s=$s;$f.$r=$r;return $f;};AE.prototype.Lock=function(){return this.$val.Lock();};AE.ptr.prototype.Unlock=function(){var $ptr,i,j,k,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;j=$f.j;k=$f.k;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:i=this;if(false){A.Release((i.$ptr_readerSem||(i.$ptr_readerSem=new AI(function(){return this.$target.readerSem;},function($v){this.$target.readerSem=$v;},i))));A.Release((i.$ptr_writerSem||(i.$ptr_writerSem=new AI(function(){return this.$target.writerSem;},function($v){this.$target.writerSem=$v;},i))));A.Disable();}j=B.AddInt32((i.$ptr_readerCount||(i.$ptr_readerCount=new AO(function(){return this.$target.readerCount;},function($v){this.$target.readerCount=$v;},i))),1073741824);if(j>=1073741824){A.Enable();$panic(new $String("sync: Unlock of unlocked RWMutex"));}k=0;case 1:if(!(k<(j>>0))){$s=2;continue;}$r=J((i.$ptr_readerSem||(i.$ptr_readerSem=new AI(function(){return this.$target.readerSem;},function($v){this.$target.readerSem=$v;},i))));$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}k=k+(1)>>0;$s=1;continue;case 2:$r=i.w.Unlock();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(false){A.Enable();}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AE.ptr.prototype.Unlock};}$f.$ptr=$ptr;$f.i=i;$f.j=j;$f.k=k;$f.$s=$s;$f.$r=$r;return $f;};AE.prototype.Unlock=function(){return this.$val.Unlock();};AE.ptr.prototype.RLocker=function(){var $ptr,i;i=this;return $pointerOfStructConversion(i,AT);};AE.prototype.RLocker=function(){return this.$val.RLocker();};AF.ptr.prototype.Lock=function(){var $ptr,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:i=this;$r=$pointerOfStructConversion(i,AU).RLock();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AF.ptr.prototype.Lock};}$f.$ptr=$ptr;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};AF.prototype.Lock=function(){return this.$val.Lock();};AF.ptr.prototype.Unlock=function(){var $ptr,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:i=this;$r=$pointerOfStructConversion(i,AU).RUnlock();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AF.ptr.prototype.Unlock};}$f.$ptr=$ptr;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};AF.prototype.Unlock=function(){return this.$val.Unlock();};AG.methods=[{prop:"Get",name:"Get",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"Put",name:"Put",pkg:"",typ:$funcType([$emptyInterface],[],false)},{prop:"getSlow",name:"getSlow",pkg:"sync",typ:$funcType([],[$emptyInterface],false)},{prop:"pin",name:"pin",pkg:"sync",typ:$funcType([],[AR],false)},{prop:"pinSlow",name:"pinSlow",pkg:"sync",typ:$funcType([],[AR],false)}];BC.methods=[{prop:"Lock",name:"Lock",pkg:"",typ:$funcType([],[],false)},{prop:"Unlock",name:"Unlock",pkg:"",typ:$funcType([],[],false)}];BE.methods=[{prop:"Do",name:"Do",pkg:"",typ:$funcType([BD],[],false)}];AU.methods=[{prop:"RLock",name:"RLock",pkg:"",typ:$funcType([],[],false)},{prop:"RUnlock",name:"RUnlock",pkg:"",typ:$funcType([],[],false)},{prop:"Lock",name:"Lock",pkg:"",typ:$funcType([],[],false)},{prop:"Unlock",name:"Unlock",pkg:"",typ:$funcType([],[],false)},{prop:"RLocker",name:"RLocker",pkg:"",typ:$funcType([],[P],false)}];AT.methods=[{prop:"Lock",name:"Lock",pkg:"",typ:$funcType([],[],false)},{prop:"Unlock",name:"Unlock",pkg:"",typ:$funcType([],[],false)}];F.init([{prop:"local",name:"local",pkg:"sync",typ:$UnsafePointer,tag:""},{prop:"localSize",name:"localSize",pkg:"sync",typ:$Uintptr,tag:""},{prop:"store",name:"store",pkg:"sync",typ:AS,tag:""},{prop:"New",name:"New",pkg:"",typ:AX,tag:""}]);O.init([{prop:"state",name:"state",pkg:"sync",typ:$Int32,tag:""},{prop:"sema",name:"sema",pkg:"sync",typ:$Uint32,tag:""}]);P.init([{prop:"Lock",name:"Lock",pkg:"",typ:$funcType([],[],false)},{prop:"Unlock",name:"Unlock",pkg:"",typ:$funcType([],[],false)}]);Q.init([{prop:"m",name:"m",pkg:"sync",typ:O,tag:""},{prop:"done",name:"done",pkg:"sync",typ:$Uint32,tag:""}]);R.init([{prop:"private$0",name:"private",pkg:"sync",typ:$emptyInterface,tag:""},{prop:"shared",name:"shared",pkg:"sync",typ:AS,tag:""},{prop:"Mutex",name:"",pkg:"",typ:O,tag:""},{prop:"pad",name:"pad",pkg:"sync",typ:BF,tag:""}]);Z.init([{prop:"lock",name:"lock",pkg:"sync",typ:$Uintptr,tag:""},{prop:"head",name:"head",pkg:"sync",typ:$UnsafePointer,tag:""},{prop:"tail",name:"tail",pkg:"sync",typ:$UnsafePointer,tag:""}]);AE.init([{prop:"w",name:"w",pkg:"sync",typ:O,tag:""},{prop:"writerSem",name:"writerSem",pkg:"sync",typ:$Uint32,tag:""},{prop:"readerSem",name:"readerSem",pkg:"sync",typ:$Uint32,tag:""},{prop:"readerCount",name:"readerCount",pkg:"sync",typ:$Int32,tag:""},{prop:"readerWait",name:"readerWait",pkg:"sync",typ:$Int32,tag:""}]);AF.init([{prop:"w",name:"w",pkg:"sync",typ:O,tag:""},{prop:"writerSem",name:"writerSem",pkg:"sync",typ:$Uint32,tag:""},{prop:"readerSem",name:"readerSem",pkg:"sync",typ:$Uint32,tag:""},{prop:"readerCount",name:"readerCount",pkg:"sync",typ:$Int32,tag:""},{prop:"readerWait",name:"readerWait",pkg:"sync",typ:$Int32,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}U=AH.nil;H={};V();AC();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["io"]=(function(){var $pkg={},$init,A,B,C,D,S,U,W,AX,AI,AJ,X,Y,Z;A=$packages["errors"];B=$packages["sync"];C=$pkg.Reader=$newType(8,$kindInterface,"io.Reader","Reader","io",null);D=$pkg.Writer=$newType(8,$kindInterface,"io.Writer","Writer","io",null);S=$pkg.ByteScanner=$newType(8,$kindInterface,"io.ByteScanner","ByteScanner","io",null);U=$pkg.RuneReader=$newType(8,$kindInterface,"io.RuneReader","RuneReader","io",null);W=$pkg.stringWriter=$newType(8,$kindInterface,"io.stringWriter","stringWriter","io",null);AX=$sliceType($Uint8);X=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=0;d=$ifaceNil;e=$assertType(a,W,true);f=e[0];g=e[1];if(g){$s=1;continue;}$s=2;continue;case 1:i=f.WriteString(b);$s=3;case 3:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}h=i;c=h[0];d=h[1];$s=4;case 4:return[c,d];case 2:k=a.Write(new AX($stringToBytes(b)));$s=5;case 5:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}j=k;c=j[0];d=j[1];$s=6;case 6:return[c,d];}return;}if($f===undefined){$f={$blk:X};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.$s=$s;$f.$r=$r;return $f;};$pkg.WriteString=X;Y=function(a,b,c){var $ptr,a,b,c,d,e,f,g,h,i,j,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=0;e=$ifaceNil;if(b.$length>0;$s=1;continue;case 2:if(d>=c){e=$ifaceNil;}else if(d>0&&$interfaceIsEqual(e,$pkg.EOF)){e=$pkg.ErrUnexpectedEOF;}return[d,e];}return;}if($f===undefined){$f={$blk:Y};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.$s=$s;$f.$r=$r;return $f;};$pkg.ReadAtLeast=Y;Z=function(a,b){var $ptr,a,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=0;d=$ifaceNil;f=Y(a,b,b.$length);$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}e=f;c=e[0];d=e[1];$s=2;case 2:return[c,d];}return;}if($f===undefined){$f={$blk:Z};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};$pkg.ReadFull=Z;C.init([{prop:"Read",name:"Read",pkg:"",typ:$funcType([AX],[$Int,$error],false)}]);D.init([{prop:"Write",name:"Write",pkg:"",typ:$funcType([AX],[$Int,$error],false)}]);S.init([{prop:"ReadByte",name:"ReadByte",pkg:"",typ:$funcType([],[$Uint8,$error],false)},{prop:"UnreadByte",name:"UnreadByte",pkg:"",typ:$funcType([],[$error],false)}]);U.init([{prop:"ReadRune",name:"ReadRune",pkg:"",typ:$funcType([],[$Int32,$Int,$error],false)}]);W.init([{prop:"WriteString",name:"WriteString",pkg:"",typ:$funcType([$String],[$Int,$error],false)}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.ErrShortWrite=A.New("short write");$pkg.ErrShortBuffer=A.New("short buffer");$pkg.EOF=A.New("EOF");$pkg.ErrUnexpectedEOF=A.New("unexpected EOF");$pkg.ErrNoProgress=A.New("multiple Read calls return no data or error");AI=A.New("Seek: invalid whence");AJ=A.New("Seek: invalid offset");$pkg.ErrClosedPipe=A.New("io: read/write on closed pipe");}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["unicode"]=(function(){var $pkg={},$init,O,P,Q,R,T,AF,IK,IL,IM,IP,IQ,AM,AX,HY,HZ,IA,A,C,I,U,V,X,AB,AC,AD,AG;O=$pkg.RangeTable=$newType(0,$kindStruct,"unicode.RangeTable","RangeTable","unicode",function(R16_,R32_,LatinOffset_){this.$val=this;if(arguments.length===0){this.R16=IL.nil;this.R32=IM.nil;this.LatinOffset=0;return;}this.R16=R16_;this.R32=R32_;this.LatinOffset=LatinOffset_;});P=$pkg.Range16=$newType(0,$kindStruct,"unicode.Range16","Range16","unicode",function(Lo_,Hi_,Stride_){this.$val=this;if(arguments.length===0){this.Lo=0;this.Hi=0;this.Stride=0;return;}this.Lo=Lo_;this.Hi=Hi_;this.Stride=Stride_;});Q=$pkg.Range32=$newType(0,$kindStruct,"unicode.Range32","Range32","unicode",function(Lo_,Hi_,Stride_){this.$val=this;if(arguments.length===0){this.Lo=0;this.Hi=0;this.Stride=0;return;}this.Lo=Lo_;this.Hi=Hi_;this.Stride=Stride_;});R=$pkg.CaseRange=$newType(0,$kindStruct,"unicode.CaseRange","CaseRange","unicode",function(Lo_,Hi_,Delta_){this.$val=this;if(arguments.length===0){this.Lo=0;this.Hi=0;this.Delta=IK.zero();return;}this.Lo=Lo_;this.Hi=Hi_;this.Delta=Delta_;});T=$pkg.d=$newType(12,$kindArray,"unicode.d","d","unicode",null);AF=$pkg.foldPair=$newType(0,$kindStruct,"unicode.foldPair","foldPair","unicode",function(From_,To_){this.$val=this;if(arguments.length===0){this.From=0;this.To=0;return;}this.From=From_;this.To=To_;});IK=$arrayType($Int32,3);IL=$sliceType(P);IM=$sliceType(Q);IP=$sliceType(R);IQ=$sliceType(AF);A=function(b,c,d){var $ptr,b,c,d,e,f,g,h,i,j,k;if(b<0||3<=b){return 65533;}e=0;f=d.$length;while(true){if(!(e>0))/2,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero"))>>0;i=((h<0||h>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+h]);if((i.Lo>>0)<=c&&c<=(i.Hi>>0)){k=(j=i.Delta,((b<0||b>=j.length)?$throwRuntimeError("index out of range"):j[b]));if(k>1114111){return(i.Lo>>0)+((((((c-(i.Lo>>0)>>0))&~1)>>0)|((b&1)>>0)))>>0;}return c+k>>0;}if(c<(i.Lo>>0)){f=h;}else{e=h+1>>0;}}return c;};C=function(b){var $ptr,b;if(b<=255){return 48<=b&&b<=57;}return X($pkg.Digit,b);};$pkg.IsDigit=C;I=function(b){var $ptr,b,c;if((b>>>0)<=255){return!(((((c=(b<<24>>>24),((c<0||c>=HZ.length)?$throwRuntimeError("index out of range"):HZ[c]))&96)>>>0)===0));}return X($pkg.Letter,b);};$pkg.IsLetter=I;U=function(b,c){var $ptr,b,c,d,e,f,g,h,i,j,k,l,m,n;if(b.$length<=18||c<=255){d=b;e=0;while(true){if(!(e=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+f]);if(c>>16))%g.Stride,h===h?h:$throwRuntimeError("integer divide by zero"))===0;}e++;}return false;}i=0;j=b.$length;while(true){if(!(i>0))/2,(k===k&&k!==1/0&&k!==-1/0)?k>>0:$throwRuntimeError("integer divide by zero"))>>0;m=((l<0||l>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+l]);if(m.Lo<=c&&c<=m.Hi){return(n=((c-m.Lo<<16>>>16))%m.Stride,n===n?n:$throwRuntimeError("integer divide by zero"))===0;}if(c>0;}}return false;};V=function(b,c){var $ptr,b,c,d,e,f,g,h,i,j,k,l,m,n;if(b.$length<=18){d=b;e=0;while(true){if(!(e=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+f]);if(c>>0))%g.Stride,h===h?h:$throwRuntimeError("integer divide by zero"))===0;}e++;}return false;}i=0;j=b.$length;while(true){if(!(i>0))/2,(k===k&&k!==1/0&&k!==-1/0)?k>>0:$throwRuntimeError("integer divide by zero"))>>0;m=$clone(((l<0||l>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+l]),Q);if(m.Lo<=c&&c<=m.Hi){return(n=((c-m.Lo>>>0))%m.Stride,n===n?n:$throwRuntimeError("integer divide by zero"))===0;}if(c>0;}}return false;};X=function(b,c){var $ptr,b,c,d,e,f,g;d=b.R16;e=b.LatinOffset;if(d.$length>e&&c<=((f=d.$length-1>>0,((f<0||f>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+f])).Hi>>0)){return U($subslice(d,e),(c<<16>>>16));}g=b.R32;if(g.$length>0&&c>=((0>=g.$length?$throwRuntimeError("index out of range"):g.$array[g.$offset+0]).Lo>>0)){return V(g,(c>>>0));}return false;};AB=function(b,c){var $ptr,b,c;return A(b,c,$pkg.CaseRanges);};$pkg.To=AB;AC=function(b){var $ptr,b;if(b<=127){if(97<=b&&b<=122){b=b-(32)>>0;}return b;}return AB(0,b);};$pkg.ToUpper=AC;AD=function(b){var $ptr,b;if(b<=127){if(65<=b&&b<=90){b=b+(32)>>0;}return b;}return AB(1,b);};$pkg.ToLower=AD;AG=function(b){var $ptr,b,c,d,e,f,g;c=0;d=IA.$length;while(true){if(!(c>0))/2,(e===e&&e!==1/0&&e!==-1/0)?e>>0:$throwRuntimeError("integer divide by zero"))>>0;if((((f<0||f>=IA.$length)?$throwRuntimeError("index out of range"):IA.$array[IA.$offset+f]).From>>0)>0;}else{d=f;}}if(c=IA.$length)?$throwRuntimeError("index out of range"):IA.$array[IA.$offset+c]).From>>0)===b)){return(((c<0||c>=IA.$length)?$throwRuntimeError("index out of range"):IA.$array[IA.$offset+c]).To>>0);}g=AD(b);if(!((g===b))){return g;}return AC(b);};$pkg.SimpleFold=AG;O.init([{prop:"R16",name:"R16",pkg:"",typ:IL,tag:""},{prop:"R32",name:"R32",pkg:"",typ:IM,tag:""},{prop:"LatinOffset",name:"LatinOffset",pkg:"",typ:$Int,tag:""}]);P.init([{prop:"Lo",name:"Lo",pkg:"",typ:$Uint16,tag:""},{prop:"Hi",name:"Hi",pkg:"",typ:$Uint16,tag:""},{prop:"Stride",name:"Stride",pkg:"",typ:$Uint16,tag:""}]);Q.init([{prop:"Lo",name:"Lo",pkg:"",typ:$Uint32,tag:""},{prop:"Hi",name:"Hi",pkg:"",typ:$Uint32,tag:""},{prop:"Stride",name:"Stride",pkg:"",typ:$Uint32,tag:""}]);R.init([{prop:"Lo",name:"Lo",pkg:"",typ:$Uint32,tag:""},{prop:"Hi",name:"Hi",pkg:"",typ:$Uint32,tag:""},{prop:"Delta",name:"Delta",pkg:"",typ:T,tag:""}]);T.init($Int32,3);AF.init([{prop:"From",name:"From",pkg:"",typ:$Uint16,tag:""},{prop:"To",name:"To",pkg:"",typ:$Uint16,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:AM=new O.ptr(new IL([new P.ptr(65,90,1),new P.ptr(97,122,1),new P.ptr(170,181,11),new P.ptr(186,192,6),new P.ptr(193,214,1),new P.ptr(216,246,1),new P.ptr(248,705,1),new P.ptr(710,721,1),new P.ptr(736,740,1),new P.ptr(748,750,2),new P.ptr(880,884,1),new P.ptr(886,887,1),new P.ptr(890,893,1),new P.ptr(895,902,7),new P.ptr(904,906,1),new P.ptr(908,910,2),new P.ptr(911,929,1),new P.ptr(931,1013,1),new P.ptr(1015,1153,1),new P.ptr(1162,1327,1),new P.ptr(1329,1366,1),new P.ptr(1369,1377,8),new P.ptr(1378,1415,1),new P.ptr(1488,1514,1),new P.ptr(1520,1522,1),new P.ptr(1568,1610,1),new P.ptr(1646,1647,1),new P.ptr(1649,1747,1),new P.ptr(1749,1765,16),new P.ptr(1766,1774,8),new P.ptr(1775,1786,11),new P.ptr(1787,1788,1),new P.ptr(1791,1808,17),new P.ptr(1810,1839,1),new P.ptr(1869,1957,1),new P.ptr(1969,1994,25),new P.ptr(1995,2026,1),new P.ptr(2036,2037,1),new P.ptr(2042,2048,6),new P.ptr(2049,2069,1),new P.ptr(2074,2084,10),new P.ptr(2088,2112,24),new P.ptr(2113,2136,1),new P.ptr(2208,2228,1),new P.ptr(2308,2361,1),new P.ptr(2365,2384,19),new P.ptr(2392,2401,1),new P.ptr(2417,2432,1),new P.ptr(2437,2444,1),new P.ptr(2447,2448,1),new P.ptr(2451,2472,1),new P.ptr(2474,2480,1),new P.ptr(2482,2486,4),new P.ptr(2487,2489,1),new P.ptr(2493,2510,17),new P.ptr(2524,2525,1),new P.ptr(2527,2529,1),new P.ptr(2544,2545,1),new P.ptr(2565,2570,1),new P.ptr(2575,2576,1),new P.ptr(2579,2600,1),new P.ptr(2602,2608,1),new P.ptr(2610,2611,1),new P.ptr(2613,2614,1),new P.ptr(2616,2617,1),new P.ptr(2649,2652,1),new P.ptr(2654,2674,20),new P.ptr(2675,2676,1),new P.ptr(2693,2701,1),new P.ptr(2703,2705,1),new P.ptr(2707,2728,1),new P.ptr(2730,2736,1),new P.ptr(2738,2739,1),new P.ptr(2741,2745,1),new P.ptr(2749,2768,19),new P.ptr(2784,2785,1),new P.ptr(2809,2821,12),new P.ptr(2822,2828,1),new P.ptr(2831,2832,1),new P.ptr(2835,2856,1),new P.ptr(2858,2864,1),new P.ptr(2866,2867,1),new P.ptr(2869,2873,1),new P.ptr(2877,2908,31),new P.ptr(2909,2911,2),new P.ptr(2912,2913,1),new P.ptr(2929,2947,18),new P.ptr(2949,2954,1),new P.ptr(2958,2960,1),new P.ptr(2962,2965,1),new P.ptr(2969,2970,1),new P.ptr(2972,2974,2),new P.ptr(2975,2979,4),new P.ptr(2980,2984,4),new P.ptr(2985,2986,1),new P.ptr(2990,3001,1),new P.ptr(3024,3077,53),new P.ptr(3078,3084,1),new P.ptr(3086,3088,1),new P.ptr(3090,3112,1),new P.ptr(3114,3129,1),new P.ptr(3133,3160,27),new P.ptr(3161,3162,1),new P.ptr(3168,3169,1),new P.ptr(3205,3212,1),new P.ptr(3214,3216,1),new P.ptr(3218,3240,1),new P.ptr(3242,3251,1),new P.ptr(3253,3257,1),new P.ptr(3261,3294,33),new P.ptr(3296,3297,1),new P.ptr(3313,3314,1),new P.ptr(3333,3340,1),new P.ptr(3342,3344,1),new P.ptr(3346,3386,1),new P.ptr(3389,3423,17),new P.ptr(3424,3425,1),new P.ptr(3450,3455,1),new P.ptr(3461,3478,1),new P.ptr(3482,3505,1),new P.ptr(3507,3515,1),new P.ptr(3517,3520,3),new P.ptr(3521,3526,1),new P.ptr(3585,3632,1),new P.ptr(3634,3635,1),new P.ptr(3648,3654,1),new P.ptr(3713,3714,1),new P.ptr(3716,3719,3),new P.ptr(3720,3722,2),new P.ptr(3725,3732,7),new P.ptr(3733,3735,1),new P.ptr(3737,3743,1),new P.ptr(3745,3747,1),new P.ptr(3749,3751,2),new P.ptr(3754,3755,1),new P.ptr(3757,3760,1),new P.ptr(3762,3763,1),new P.ptr(3773,3776,3),new P.ptr(3777,3780,1),new P.ptr(3782,3804,22),new P.ptr(3805,3807,1),new P.ptr(3840,3904,64),new P.ptr(3905,3911,1),new P.ptr(3913,3948,1),new P.ptr(3976,3980,1),new P.ptr(4096,4138,1),new P.ptr(4159,4176,17),new P.ptr(4177,4181,1),new P.ptr(4186,4189,1),new P.ptr(4193,4197,4),new P.ptr(4198,4206,8),new P.ptr(4207,4208,1),new P.ptr(4213,4225,1),new P.ptr(4238,4256,18),new P.ptr(4257,4293,1),new P.ptr(4295,4301,6),new P.ptr(4304,4346,1),new P.ptr(4348,4680,1),new P.ptr(4682,4685,1),new P.ptr(4688,4694,1),new P.ptr(4696,4698,2),new P.ptr(4699,4701,1),new P.ptr(4704,4744,1),new P.ptr(4746,4749,1),new P.ptr(4752,4784,1),new P.ptr(4786,4789,1),new P.ptr(4792,4798,1),new P.ptr(4800,4802,2),new P.ptr(4803,4805,1),new P.ptr(4808,4822,1),new P.ptr(4824,4880,1),new P.ptr(4882,4885,1),new P.ptr(4888,4954,1),new P.ptr(4992,5007,1),new P.ptr(5024,5109,1),new P.ptr(5112,5117,1),new P.ptr(5121,5740,1),new P.ptr(5743,5759,1),new P.ptr(5761,5786,1),new P.ptr(5792,5866,1),new P.ptr(5873,5880,1),new P.ptr(5888,5900,1),new P.ptr(5902,5905,1),new P.ptr(5920,5937,1),new P.ptr(5952,5969,1),new P.ptr(5984,5996,1),new P.ptr(5998,6000,1),new P.ptr(6016,6067,1),new P.ptr(6103,6108,5),new P.ptr(6176,6263,1),new P.ptr(6272,6312,1),new P.ptr(6314,6320,6),new P.ptr(6321,6389,1),new P.ptr(6400,6430,1),new P.ptr(6480,6509,1),new P.ptr(6512,6516,1),new P.ptr(6528,6571,1),new P.ptr(6576,6601,1),new P.ptr(6656,6678,1),new P.ptr(6688,6740,1),new P.ptr(6823,6917,94),new P.ptr(6918,6963,1),new P.ptr(6981,6987,1),new P.ptr(7043,7072,1),new P.ptr(7086,7087,1),new P.ptr(7098,7141,1),new P.ptr(7168,7203,1),new P.ptr(7245,7247,1),new P.ptr(7258,7293,1),new P.ptr(7401,7404,1),new P.ptr(7406,7409,1),new P.ptr(7413,7414,1),new P.ptr(7424,7615,1),new P.ptr(7680,7957,1),new P.ptr(7960,7965,1),new P.ptr(7968,8005,1),new P.ptr(8008,8013,1),new P.ptr(8016,8023,1),new P.ptr(8025,8031,2),new P.ptr(8032,8061,1),new P.ptr(8064,8116,1),new P.ptr(8118,8124,1),new P.ptr(8126,8130,4),new P.ptr(8131,8132,1),new P.ptr(8134,8140,1),new P.ptr(8144,8147,1),new P.ptr(8150,8155,1),new P.ptr(8160,8172,1),new P.ptr(8178,8180,1),new P.ptr(8182,8188,1),new P.ptr(8305,8319,14),new P.ptr(8336,8348,1),new P.ptr(8450,8455,5),new P.ptr(8458,8467,1),new P.ptr(8469,8473,4),new P.ptr(8474,8477,1),new P.ptr(8484,8490,2),new P.ptr(8491,8493,1),new P.ptr(8495,8505,1),new P.ptr(8508,8511,1),new P.ptr(8517,8521,1),new P.ptr(8526,8579,53),new P.ptr(8580,11264,2684),new P.ptr(11265,11310,1),new P.ptr(11312,11358,1),new P.ptr(11360,11492,1),new P.ptr(11499,11502,1),new P.ptr(11506,11507,1),new P.ptr(11520,11557,1),new P.ptr(11559,11565,6),new P.ptr(11568,11623,1),new P.ptr(11631,11648,17),new P.ptr(11649,11670,1),new P.ptr(11680,11686,1),new P.ptr(11688,11694,1),new P.ptr(11696,11702,1),new P.ptr(11704,11710,1),new P.ptr(11712,11718,1),new P.ptr(11720,11726,1),new P.ptr(11728,11734,1),new P.ptr(11736,11742,1),new P.ptr(11823,12293,470),new P.ptr(12294,12337,43),new P.ptr(12338,12341,1),new P.ptr(12347,12348,1),new P.ptr(12353,12438,1),new P.ptr(12445,12447,1),new P.ptr(12449,12538,1),new P.ptr(12540,12543,1),new P.ptr(12549,12589,1),new P.ptr(12593,12686,1),new P.ptr(12704,12730,1),new P.ptr(12784,12799,1),new P.ptr(13312,19893,1),new P.ptr(19968,40917,1),new P.ptr(40960,42124,1),new P.ptr(42192,42237,1),new P.ptr(42240,42508,1),new P.ptr(42512,42527,1),new P.ptr(42538,42539,1),new P.ptr(42560,42606,1),new P.ptr(42623,42653,1),new P.ptr(42656,42725,1),new P.ptr(42775,42783,1),new P.ptr(42786,42888,1),new P.ptr(42891,42925,1),new P.ptr(42928,42935,1),new P.ptr(42999,43009,1),new P.ptr(43011,43013,1),new P.ptr(43015,43018,1),new P.ptr(43020,43042,1),new P.ptr(43072,43123,1),new P.ptr(43138,43187,1),new P.ptr(43250,43255,1),new P.ptr(43259,43261,2),new P.ptr(43274,43301,1),new P.ptr(43312,43334,1),new P.ptr(43360,43388,1),new P.ptr(43396,43442,1),new P.ptr(43471,43488,17),new P.ptr(43489,43492,1),new P.ptr(43494,43503,1),new P.ptr(43514,43518,1),new P.ptr(43520,43560,1),new P.ptr(43584,43586,1),new P.ptr(43588,43595,1),new P.ptr(43616,43638,1),new P.ptr(43642,43646,4),new P.ptr(43647,43695,1),new P.ptr(43697,43701,4),new P.ptr(43702,43705,3),new P.ptr(43706,43709,1),new P.ptr(43712,43714,2),new P.ptr(43739,43741,1),new P.ptr(43744,43754,1),new P.ptr(43762,43764,1),new P.ptr(43777,43782,1),new P.ptr(43785,43790,1),new P.ptr(43793,43798,1),new P.ptr(43808,43814,1),new P.ptr(43816,43822,1),new P.ptr(43824,43866,1),new P.ptr(43868,43877,1),new P.ptr(43888,44002,1),new P.ptr(44032,55203,1),new P.ptr(55216,55238,1),new P.ptr(55243,55291,1),new P.ptr(63744,64109,1),new P.ptr(64112,64217,1),new P.ptr(64256,64262,1),new P.ptr(64275,64279,1),new P.ptr(64285,64287,2),new P.ptr(64288,64296,1),new P.ptr(64298,64310,1),new P.ptr(64312,64316,1),new P.ptr(64318,64320,2),new P.ptr(64321,64323,2),new P.ptr(64324,64326,2),new P.ptr(64327,64433,1),new P.ptr(64467,64829,1),new P.ptr(64848,64911,1),new P.ptr(64914,64967,1),new P.ptr(65008,65019,1),new P.ptr(65136,65140,1),new P.ptr(65142,65276,1),new P.ptr(65313,65338,1),new P.ptr(65345,65370,1),new P.ptr(65382,65470,1),new P.ptr(65474,65479,1),new P.ptr(65482,65487,1),new P.ptr(65490,65495,1),new P.ptr(65498,65500,1)]),new IM([new Q.ptr(65536,65547,1),new Q.ptr(65549,65574,1),new Q.ptr(65576,65594,1),new Q.ptr(65596,65597,1),new Q.ptr(65599,65613,1),new Q.ptr(65616,65629,1),new Q.ptr(65664,65786,1),new Q.ptr(66176,66204,1),new Q.ptr(66208,66256,1),new Q.ptr(66304,66335,1),new Q.ptr(66352,66368,1),new Q.ptr(66370,66377,1),new Q.ptr(66384,66421,1),new Q.ptr(66432,66461,1),new Q.ptr(66464,66499,1),new Q.ptr(66504,66511,1),new Q.ptr(66560,66717,1),new Q.ptr(66816,66855,1),new Q.ptr(66864,66915,1),new Q.ptr(67072,67382,1),new Q.ptr(67392,67413,1),new Q.ptr(67424,67431,1),new Q.ptr(67584,67589,1),new Q.ptr(67592,67594,2),new Q.ptr(67595,67637,1),new Q.ptr(67639,67640,1),new Q.ptr(67644,67647,3),new Q.ptr(67648,67669,1),new Q.ptr(67680,67702,1),new Q.ptr(67712,67742,1),new Q.ptr(67808,67826,1),new Q.ptr(67828,67829,1),new Q.ptr(67840,67861,1),new Q.ptr(67872,67897,1),new Q.ptr(67968,68023,1),new Q.ptr(68030,68031,1),new Q.ptr(68096,68112,16),new Q.ptr(68113,68115,1),new Q.ptr(68117,68119,1),new Q.ptr(68121,68147,1),new Q.ptr(68192,68220,1),new Q.ptr(68224,68252,1),new Q.ptr(68288,68295,1),new Q.ptr(68297,68324,1),new Q.ptr(68352,68405,1),new Q.ptr(68416,68437,1),new Q.ptr(68448,68466,1),new Q.ptr(68480,68497,1),new Q.ptr(68608,68680,1),new Q.ptr(68736,68786,1),new Q.ptr(68800,68850,1),new Q.ptr(69635,69687,1),new Q.ptr(69763,69807,1),new Q.ptr(69840,69864,1),new Q.ptr(69891,69926,1),new Q.ptr(69968,70002,1),new Q.ptr(70006,70019,13),new Q.ptr(70020,70066,1),new Q.ptr(70081,70084,1),new Q.ptr(70106,70108,2),new Q.ptr(70144,70161,1),new Q.ptr(70163,70187,1),new Q.ptr(70272,70278,1),new Q.ptr(70280,70282,2),new Q.ptr(70283,70285,1),new Q.ptr(70287,70301,1),new Q.ptr(70303,70312,1),new Q.ptr(70320,70366,1),new Q.ptr(70405,70412,1),new Q.ptr(70415,70416,1),new Q.ptr(70419,70440,1),new Q.ptr(70442,70448,1),new Q.ptr(70450,70451,1),new Q.ptr(70453,70457,1),new Q.ptr(70461,70480,19),new Q.ptr(70493,70497,1),new Q.ptr(70784,70831,1),new Q.ptr(70852,70853,1),new Q.ptr(70855,71040,185),new Q.ptr(71041,71086,1),new Q.ptr(71128,71131,1),new Q.ptr(71168,71215,1),new Q.ptr(71236,71296,60),new Q.ptr(71297,71338,1),new Q.ptr(71424,71449,1),new Q.ptr(71840,71903,1),new Q.ptr(71935,72384,449),new Q.ptr(72385,72440,1),new Q.ptr(73728,74649,1),new Q.ptr(74880,75075,1),new Q.ptr(77824,78894,1),new Q.ptr(82944,83526,1),new Q.ptr(92160,92728,1),new Q.ptr(92736,92766,1),new Q.ptr(92880,92909,1),new Q.ptr(92928,92975,1),new Q.ptr(92992,92995,1),new Q.ptr(93027,93047,1),new Q.ptr(93053,93071,1),new Q.ptr(93952,94020,1),new Q.ptr(94032,94099,67),new Q.ptr(94100,94111,1),new Q.ptr(110592,110593,1),new Q.ptr(113664,113770,1),new Q.ptr(113776,113788,1),new Q.ptr(113792,113800,1),new Q.ptr(113808,113817,1),new Q.ptr(119808,119892,1),new Q.ptr(119894,119964,1),new Q.ptr(119966,119967,1),new Q.ptr(119970,119973,3),new Q.ptr(119974,119977,3),new Q.ptr(119978,119980,1),new Q.ptr(119982,119993,1),new Q.ptr(119995,119997,2),new Q.ptr(119998,120003,1),new Q.ptr(120005,120069,1),new Q.ptr(120071,120074,1),new Q.ptr(120077,120084,1),new Q.ptr(120086,120092,1),new Q.ptr(120094,120121,1),new Q.ptr(120123,120126,1),new Q.ptr(120128,120132,1),new Q.ptr(120134,120138,4),new Q.ptr(120139,120144,1),new Q.ptr(120146,120485,1),new Q.ptr(120488,120512,1),new Q.ptr(120514,120538,1),new Q.ptr(120540,120570,1),new Q.ptr(120572,120596,1),new Q.ptr(120598,120628,1),new Q.ptr(120630,120654,1),new Q.ptr(120656,120686,1),new Q.ptr(120688,120712,1),new Q.ptr(120714,120744,1),new Q.ptr(120746,120770,1),new Q.ptr(120772,120779,1),new Q.ptr(124928,125124,1),new Q.ptr(126464,126467,1),new Q.ptr(126469,126495,1),new Q.ptr(126497,126498,1),new Q.ptr(126500,126503,3),new Q.ptr(126505,126514,1),new Q.ptr(126516,126519,1),new Q.ptr(126521,126523,2),new Q.ptr(126530,126535,5),new Q.ptr(126537,126541,2),new Q.ptr(126542,126543,1),new Q.ptr(126545,126546,1),new Q.ptr(126548,126551,3),new Q.ptr(126553,126561,2),new Q.ptr(126562,126564,2),new Q.ptr(126567,126570,1),new Q.ptr(126572,126578,1),new Q.ptr(126580,126583,1),new Q.ptr(126585,126588,1),new Q.ptr(126590,126592,2),new Q.ptr(126593,126601,1),new Q.ptr(126603,126619,1),new Q.ptr(126625,126627,1),new Q.ptr(126629,126633,1),new Q.ptr(126635,126651,1),new Q.ptr(131072,173782,1),new Q.ptr(173824,177972,1),new Q.ptr(177984,178205,1),new Q.ptr(178208,183969,1),new Q.ptr(194560,195101,1)]),6);AX=new O.ptr(new IL([new P.ptr(48,57,1),new P.ptr(1632,1641,1),new P.ptr(1776,1785,1),new P.ptr(1984,1993,1),new P.ptr(2406,2415,1),new P.ptr(2534,2543,1),new P.ptr(2662,2671,1),new P.ptr(2790,2799,1),new P.ptr(2918,2927,1),new P.ptr(3046,3055,1),new P.ptr(3174,3183,1),new P.ptr(3302,3311,1),new P.ptr(3430,3439,1),new P.ptr(3558,3567,1),new P.ptr(3664,3673,1),new P.ptr(3792,3801,1),new P.ptr(3872,3881,1),new P.ptr(4160,4169,1),new P.ptr(4240,4249,1),new P.ptr(6112,6121,1),new P.ptr(6160,6169,1),new P.ptr(6470,6479,1),new P.ptr(6608,6617,1),new P.ptr(6784,6793,1),new P.ptr(6800,6809,1),new P.ptr(6992,7001,1),new P.ptr(7088,7097,1),new P.ptr(7232,7241,1),new P.ptr(7248,7257,1),new P.ptr(42528,42537,1),new P.ptr(43216,43225,1),new P.ptr(43264,43273,1),new P.ptr(43472,43481,1),new P.ptr(43504,43513,1),new P.ptr(43600,43609,1),new P.ptr(44016,44025,1),new P.ptr(65296,65305,1)]),new IM([new Q.ptr(66720,66729,1),new Q.ptr(69734,69743,1),new Q.ptr(69872,69881,1),new Q.ptr(69942,69951,1),new Q.ptr(70096,70105,1),new Q.ptr(70384,70393,1),new Q.ptr(70864,70873,1),new Q.ptr(71248,71257,1),new Q.ptr(71360,71369,1),new Q.ptr(71472,71481,1),new Q.ptr(71904,71913,1),new Q.ptr(92768,92777,1),new Q.ptr(93008,93017,1),new Q.ptr(120782,120831,1)]),1);$pkg.Digit=AX;$pkg.Letter=AM;HY=new IP([new R.ptr(65,90,$toNativeArray($kindInt32,[0,32,0])),new R.ptr(97,122,$toNativeArray($kindInt32,[-32,0,-32])),new R.ptr(181,181,$toNativeArray($kindInt32,[743,0,743])),new R.ptr(192,214,$toNativeArray($kindInt32,[0,32,0])),new R.ptr(216,222,$toNativeArray($kindInt32,[0,32,0])),new R.ptr(224,246,$toNativeArray($kindInt32,[-32,0,-32])),new R.ptr(248,254,$toNativeArray($kindInt32,[-32,0,-32])),new R.ptr(255,255,$toNativeArray($kindInt32,[121,0,121])),new R.ptr(256,303,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(304,304,$toNativeArray($kindInt32,[0,-199,0])),new R.ptr(305,305,$toNativeArray($kindInt32,[-232,0,-232])),new R.ptr(306,311,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(313,328,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(330,375,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(376,376,$toNativeArray($kindInt32,[0,-121,0])),new R.ptr(377,382,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(383,383,$toNativeArray($kindInt32,[-300,0,-300])),new R.ptr(384,384,$toNativeArray($kindInt32,[195,0,195])),new R.ptr(385,385,$toNativeArray($kindInt32,[0,210,0])),new R.ptr(386,389,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(390,390,$toNativeArray($kindInt32,[0,206,0])),new R.ptr(391,392,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(393,394,$toNativeArray($kindInt32,[0,205,0])),new R.ptr(395,396,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(398,398,$toNativeArray($kindInt32,[0,79,0])),new R.ptr(399,399,$toNativeArray($kindInt32,[0,202,0])),new R.ptr(400,400,$toNativeArray($kindInt32,[0,203,0])),new R.ptr(401,402,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(403,403,$toNativeArray($kindInt32,[0,205,0])),new R.ptr(404,404,$toNativeArray($kindInt32,[0,207,0])),new R.ptr(405,405,$toNativeArray($kindInt32,[97,0,97])),new R.ptr(406,406,$toNativeArray($kindInt32,[0,211,0])),new R.ptr(407,407,$toNativeArray($kindInt32,[0,209,0])),new R.ptr(408,409,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(410,410,$toNativeArray($kindInt32,[163,0,163])),new R.ptr(412,412,$toNativeArray($kindInt32,[0,211,0])),new R.ptr(413,413,$toNativeArray($kindInt32,[0,213,0])),new R.ptr(414,414,$toNativeArray($kindInt32,[130,0,130])),new R.ptr(415,415,$toNativeArray($kindInt32,[0,214,0])),new R.ptr(416,421,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(422,422,$toNativeArray($kindInt32,[0,218,0])),new R.ptr(423,424,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(425,425,$toNativeArray($kindInt32,[0,218,0])),new R.ptr(428,429,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(430,430,$toNativeArray($kindInt32,[0,218,0])),new R.ptr(431,432,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(433,434,$toNativeArray($kindInt32,[0,217,0])),new R.ptr(435,438,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(439,439,$toNativeArray($kindInt32,[0,219,0])),new R.ptr(440,441,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(444,445,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(447,447,$toNativeArray($kindInt32,[56,0,56])),new R.ptr(452,452,$toNativeArray($kindInt32,[0,2,1])),new R.ptr(453,453,$toNativeArray($kindInt32,[-1,1,0])),new R.ptr(454,454,$toNativeArray($kindInt32,[-2,0,-1])),new R.ptr(455,455,$toNativeArray($kindInt32,[0,2,1])),new R.ptr(456,456,$toNativeArray($kindInt32,[-1,1,0])),new R.ptr(457,457,$toNativeArray($kindInt32,[-2,0,-1])),new R.ptr(458,458,$toNativeArray($kindInt32,[0,2,1])),new R.ptr(459,459,$toNativeArray($kindInt32,[-1,1,0])),new R.ptr(460,460,$toNativeArray($kindInt32,[-2,0,-1])),new R.ptr(461,476,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(477,477,$toNativeArray($kindInt32,[-79,0,-79])),new R.ptr(478,495,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(497,497,$toNativeArray($kindInt32,[0,2,1])),new R.ptr(498,498,$toNativeArray($kindInt32,[-1,1,0])),new R.ptr(499,499,$toNativeArray($kindInt32,[-2,0,-1])),new R.ptr(500,501,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(502,502,$toNativeArray($kindInt32,[0,-97,0])),new R.ptr(503,503,$toNativeArray($kindInt32,[0,-56,0])),new R.ptr(504,543,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(544,544,$toNativeArray($kindInt32,[0,-130,0])),new R.ptr(546,563,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(570,570,$toNativeArray($kindInt32,[0,10795,0])),new R.ptr(571,572,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(573,573,$toNativeArray($kindInt32,[0,-163,0])),new R.ptr(574,574,$toNativeArray($kindInt32,[0,10792,0])),new R.ptr(575,576,$toNativeArray($kindInt32,[10815,0,10815])),new R.ptr(577,578,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(579,579,$toNativeArray($kindInt32,[0,-195,0])),new R.ptr(580,580,$toNativeArray($kindInt32,[0,69,0])),new R.ptr(581,581,$toNativeArray($kindInt32,[0,71,0])),new R.ptr(582,591,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(592,592,$toNativeArray($kindInt32,[10783,0,10783])),new R.ptr(593,593,$toNativeArray($kindInt32,[10780,0,10780])),new R.ptr(594,594,$toNativeArray($kindInt32,[10782,0,10782])),new R.ptr(595,595,$toNativeArray($kindInt32,[-210,0,-210])),new R.ptr(596,596,$toNativeArray($kindInt32,[-206,0,-206])),new R.ptr(598,599,$toNativeArray($kindInt32,[-205,0,-205])),new R.ptr(601,601,$toNativeArray($kindInt32,[-202,0,-202])),new R.ptr(603,603,$toNativeArray($kindInt32,[-203,0,-203])),new R.ptr(604,604,$toNativeArray($kindInt32,[42319,0,42319])),new R.ptr(608,608,$toNativeArray($kindInt32,[-205,0,-205])),new R.ptr(609,609,$toNativeArray($kindInt32,[42315,0,42315])),new R.ptr(611,611,$toNativeArray($kindInt32,[-207,0,-207])),new R.ptr(613,613,$toNativeArray($kindInt32,[42280,0,42280])),new R.ptr(614,614,$toNativeArray($kindInt32,[42308,0,42308])),new R.ptr(616,616,$toNativeArray($kindInt32,[-209,0,-209])),new R.ptr(617,617,$toNativeArray($kindInt32,[-211,0,-211])),new R.ptr(619,619,$toNativeArray($kindInt32,[10743,0,10743])),new R.ptr(620,620,$toNativeArray($kindInt32,[42305,0,42305])),new R.ptr(623,623,$toNativeArray($kindInt32,[-211,0,-211])),new R.ptr(625,625,$toNativeArray($kindInt32,[10749,0,10749])),new R.ptr(626,626,$toNativeArray($kindInt32,[-213,0,-213])),new R.ptr(629,629,$toNativeArray($kindInt32,[-214,0,-214])),new R.ptr(637,637,$toNativeArray($kindInt32,[10727,0,10727])),new R.ptr(640,640,$toNativeArray($kindInt32,[-218,0,-218])),new R.ptr(643,643,$toNativeArray($kindInt32,[-218,0,-218])),new R.ptr(647,647,$toNativeArray($kindInt32,[42282,0,42282])),new R.ptr(648,648,$toNativeArray($kindInt32,[-218,0,-218])),new R.ptr(649,649,$toNativeArray($kindInt32,[-69,0,-69])),new R.ptr(650,651,$toNativeArray($kindInt32,[-217,0,-217])),new R.ptr(652,652,$toNativeArray($kindInt32,[-71,0,-71])),new R.ptr(658,658,$toNativeArray($kindInt32,[-219,0,-219])),new R.ptr(669,669,$toNativeArray($kindInt32,[42261,0,42261])),new R.ptr(670,670,$toNativeArray($kindInt32,[42258,0,42258])),new R.ptr(837,837,$toNativeArray($kindInt32,[84,0,84])),new R.ptr(880,883,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(886,887,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(891,893,$toNativeArray($kindInt32,[130,0,130])),new R.ptr(895,895,$toNativeArray($kindInt32,[0,116,0])),new R.ptr(902,902,$toNativeArray($kindInt32,[0,38,0])),new R.ptr(904,906,$toNativeArray($kindInt32,[0,37,0])),new R.ptr(908,908,$toNativeArray($kindInt32,[0,64,0])),new R.ptr(910,911,$toNativeArray($kindInt32,[0,63,0])),new R.ptr(913,929,$toNativeArray($kindInt32,[0,32,0])),new R.ptr(931,939,$toNativeArray($kindInt32,[0,32,0])),new R.ptr(940,940,$toNativeArray($kindInt32,[-38,0,-38])),new R.ptr(941,943,$toNativeArray($kindInt32,[-37,0,-37])),new R.ptr(945,961,$toNativeArray($kindInt32,[-32,0,-32])),new R.ptr(962,962,$toNativeArray($kindInt32,[-31,0,-31])),new R.ptr(963,971,$toNativeArray($kindInt32,[-32,0,-32])),new R.ptr(972,972,$toNativeArray($kindInt32,[-64,0,-64])),new R.ptr(973,974,$toNativeArray($kindInt32,[-63,0,-63])),new R.ptr(975,975,$toNativeArray($kindInt32,[0,8,0])),new R.ptr(976,976,$toNativeArray($kindInt32,[-62,0,-62])),new R.ptr(977,977,$toNativeArray($kindInt32,[-57,0,-57])),new R.ptr(981,981,$toNativeArray($kindInt32,[-47,0,-47])),new R.ptr(982,982,$toNativeArray($kindInt32,[-54,0,-54])),new R.ptr(983,983,$toNativeArray($kindInt32,[-8,0,-8])),new R.ptr(984,1007,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(1008,1008,$toNativeArray($kindInt32,[-86,0,-86])),new R.ptr(1009,1009,$toNativeArray($kindInt32,[-80,0,-80])),new R.ptr(1010,1010,$toNativeArray($kindInt32,[7,0,7])),new R.ptr(1011,1011,$toNativeArray($kindInt32,[-116,0,-116])),new R.ptr(1012,1012,$toNativeArray($kindInt32,[0,-60,0])),new R.ptr(1013,1013,$toNativeArray($kindInt32,[-96,0,-96])),new R.ptr(1015,1016,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(1017,1017,$toNativeArray($kindInt32,[0,-7,0])),new R.ptr(1018,1019,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(1021,1023,$toNativeArray($kindInt32,[0,-130,0])),new R.ptr(1024,1039,$toNativeArray($kindInt32,[0,80,0])),new R.ptr(1040,1071,$toNativeArray($kindInt32,[0,32,0])),new R.ptr(1072,1103,$toNativeArray($kindInt32,[-32,0,-32])),new R.ptr(1104,1119,$toNativeArray($kindInt32,[-80,0,-80])),new R.ptr(1120,1153,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(1162,1215,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(1216,1216,$toNativeArray($kindInt32,[0,15,0])),new R.ptr(1217,1230,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(1231,1231,$toNativeArray($kindInt32,[-15,0,-15])),new R.ptr(1232,1327,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(1329,1366,$toNativeArray($kindInt32,[0,48,0])),new R.ptr(1377,1414,$toNativeArray($kindInt32,[-48,0,-48])),new R.ptr(4256,4293,$toNativeArray($kindInt32,[0,7264,0])),new R.ptr(4295,4295,$toNativeArray($kindInt32,[0,7264,0])),new R.ptr(4301,4301,$toNativeArray($kindInt32,[0,7264,0])),new R.ptr(5024,5103,$toNativeArray($kindInt32,[0,38864,0])),new R.ptr(5104,5109,$toNativeArray($kindInt32,[0,8,0])),new R.ptr(5112,5117,$toNativeArray($kindInt32,[-8,0,-8])),new R.ptr(7545,7545,$toNativeArray($kindInt32,[35332,0,35332])),new R.ptr(7549,7549,$toNativeArray($kindInt32,[3814,0,3814])),new R.ptr(7680,7829,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(7835,7835,$toNativeArray($kindInt32,[-59,0,-59])),new R.ptr(7838,7838,$toNativeArray($kindInt32,[0,-7615,0])),new R.ptr(7840,7935,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(7936,7943,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(7944,7951,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(7952,7957,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(7960,7965,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(7968,7975,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(7976,7983,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(7984,7991,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(7992,7999,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8000,8005,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8008,8013,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8017,8017,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8019,8019,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8021,8021,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8023,8023,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8025,8025,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8027,8027,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8029,8029,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8031,8031,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8032,8039,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8040,8047,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8048,8049,$toNativeArray($kindInt32,[74,0,74])),new R.ptr(8050,8053,$toNativeArray($kindInt32,[86,0,86])),new R.ptr(8054,8055,$toNativeArray($kindInt32,[100,0,100])),new R.ptr(8056,8057,$toNativeArray($kindInt32,[128,0,128])),new R.ptr(8058,8059,$toNativeArray($kindInt32,[112,0,112])),new R.ptr(8060,8061,$toNativeArray($kindInt32,[126,0,126])),new R.ptr(8064,8071,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8072,8079,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8080,8087,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8088,8095,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8096,8103,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8104,8111,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8112,8113,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8115,8115,$toNativeArray($kindInt32,[9,0,9])),new R.ptr(8120,8121,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8122,8123,$toNativeArray($kindInt32,[0,-74,0])),new R.ptr(8124,8124,$toNativeArray($kindInt32,[0,-9,0])),new R.ptr(8126,8126,$toNativeArray($kindInt32,[-7205,0,-7205])),new R.ptr(8131,8131,$toNativeArray($kindInt32,[9,0,9])),new R.ptr(8136,8139,$toNativeArray($kindInt32,[0,-86,0])),new R.ptr(8140,8140,$toNativeArray($kindInt32,[0,-9,0])),new R.ptr(8144,8145,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8152,8153,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8154,8155,$toNativeArray($kindInt32,[0,-100,0])),new R.ptr(8160,8161,$toNativeArray($kindInt32,[8,0,8])),new R.ptr(8165,8165,$toNativeArray($kindInt32,[7,0,7])),new R.ptr(8168,8169,$toNativeArray($kindInt32,[0,-8,0])),new R.ptr(8170,8171,$toNativeArray($kindInt32,[0,-112,0])),new R.ptr(8172,8172,$toNativeArray($kindInt32,[0,-7,0])),new R.ptr(8179,8179,$toNativeArray($kindInt32,[9,0,9])),new R.ptr(8184,8185,$toNativeArray($kindInt32,[0,-128,0])),new R.ptr(8186,8187,$toNativeArray($kindInt32,[0,-126,0])),new R.ptr(8188,8188,$toNativeArray($kindInt32,[0,-9,0])),new R.ptr(8486,8486,$toNativeArray($kindInt32,[0,-7517,0])),new R.ptr(8490,8490,$toNativeArray($kindInt32,[0,-8383,0])),new R.ptr(8491,8491,$toNativeArray($kindInt32,[0,-8262,0])),new R.ptr(8498,8498,$toNativeArray($kindInt32,[0,28,0])),new R.ptr(8526,8526,$toNativeArray($kindInt32,[-28,0,-28])),new R.ptr(8544,8559,$toNativeArray($kindInt32,[0,16,0])),new R.ptr(8560,8575,$toNativeArray($kindInt32,[-16,0,-16])),new R.ptr(8579,8580,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(9398,9423,$toNativeArray($kindInt32,[0,26,0])),new R.ptr(9424,9449,$toNativeArray($kindInt32,[-26,0,-26])),new R.ptr(11264,11310,$toNativeArray($kindInt32,[0,48,0])),new R.ptr(11312,11358,$toNativeArray($kindInt32,[-48,0,-48])),new R.ptr(11360,11361,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(11362,11362,$toNativeArray($kindInt32,[0,-10743,0])),new R.ptr(11363,11363,$toNativeArray($kindInt32,[0,-3814,0])),new R.ptr(11364,11364,$toNativeArray($kindInt32,[0,-10727,0])),new R.ptr(11365,11365,$toNativeArray($kindInt32,[-10795,0,-10795])),new R.ptr(11366,11366,$toNativeArray($kindInt32,[-10792,0,-10792])),new R.ptr(11367,11372,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(11373,11373,$toNativeArray($kindInt32,[0,-10780,0])),new R.ptr(11374,11374,$toNativeArray($kindInt32,[0,-10749,0])),new R.ptr(11375,11375,$toNativeArray($kindInt32,[0,-10783,0])),new R.ptr(11376,11376,$toNativeArray($kindInt32,[0,-10782,0])),new R.ptr(11378,11379,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(11381,11382,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(11390,11391,$toNativeArray($kindInt32,[0,-10815,0])),new R.ptr(11392,11491,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(11499,11502,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(11506,11507,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(11520,11557,$toNativeArray($kindInt32,[-7264,0,-7264])),new R.ptr(11559,11559,$toNativeArray($kindInt32,[-7264,0,-7264])),new R.ptr(11565,11565,$toNativeArray($kindInt32,[-7264,0,-7264])),new R.ptr(42560,42605,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(42624,42651,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(42786,42799,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(42802,42863,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(42873,42876,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(42877,42877,$toNativeArray($kindInt32,[0,-35332,0])),new R.ptr(42878,42887,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(42891,42892,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(42893,42893,$toNativeArray($kindInt32,[0,-42280,0])),new R.ptr(42896,42899,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(42902,42921,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(42922,42922,$toNativeArray($kindInt32,[0,-42308,0])),new R.ptr(42923,42923,$toNativeArray($kindInt32,[0,-42319,0])),new R.ptr(42924,42924,$toNativeArray($kindInt32,[0,-42315,0])),new R.ptr(42925,42925,$toNativeArray($kindInt32,[0,-42305,0])),new R.ptr(42928,42928,$toNativeArray($kindInt32,[0,-42258,0])),new R.ptr(42929,42929,$toNativeArray($kindInt32,[0,-42282,0])),new R.ptr(42930,42930,$toNativeArray($kindInt32,[0,-42261,0])),new R.ptr(42931,42931,$toNativeArray($kindInt32,[0,928,0])),new R.ptr(42932,42935,$toNativeArray($kindInt32,[1114112,1114112,1114112])),new R.ptr(43859,43859,$toNativeArray($kindInt32,[-928,0,-928])),new R.ptr(43888,43967,$toNativeArray($kindInt32,[-38864,0,-38864])),new R.ptr(65313,65338,$toNativeArray($kindInt32,[0,32,0])),new R.ptr(65345,65370,$toNativeArray($kindInt32,[-32,0,-32])),new R.ptr(66560,66599,$toNativeArray($kindInt32,[0,40,0])),new R.ptr(66600,66639,$toNativeArray($kindInt32,[-40,0,-40])),new R.ptr(68736,68786,$toNativeArray($kindInt32,[0,64,0])),new R.ptr(68800,68850,$toNativeArray($kindInt32,[-64,0,-64])),new R.ptr(71840,71871,$toNativeArray($kindInt32,[0,32,0])),new R.ptr(71872,71903,$toNativeArray($kindInt32,[-32,0,-32]))]);$pkg.CaseRanges=HY;HZ=$toNativeArray($kindUint8,[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,144,130,130,130,136,130,130,130,130,130,130,136,130,130,130,130,132,132,132,132,132,132,132,132,132,132,130,130,136,136,136,130,130,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,130,130,130,136,130,136,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,130,136,130,136,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,16,130,136,136,136,136,136,130,136,136,224,130,136,0,136,136,136,136,132,132,136,192,130,130,136,132,224,130,132,132,132,130,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,136,160,160,160,160,160,160,160,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,136,192,192,192,192,192,192,192,192]);IA=new IQ([new AF.ptr(75,107),new AF.ptr(83,115),new AF.ptr(107,8490),new AF.ptr(115,383),new AF.ptr(181,924),new AF.ptr(197,229),new AF.ptr(223,7838),new AF.ptr(229,8491),new AF.ptr(304,304),new AF.ptr(305,305),new AF.ptr(383,83),new AF.ptr(452,453),new AF.ptr(453,454),new AF.ptr(454,452),new AF.ptr(455,456),new AF.ptr(456,457),new AF.ptr(457,455),new AF.ptr(458,459),new AF.ptr(459,460),new AF.ptr(460,458),new AF.ptr(497,498),new AF.ptr(498,499),new AF.ptr(499,497),new AF.ptr(837,921),new AF.ptr(914,946),new AF.ptr(917,949),new AF.ptr(920,952),new AF.ptr(921,953),new AF.ptr(922,954),new AF.ptr(924,956),new AF.ptr(928,960),new AF.ptr(929,961),new AF.ptr(931,962),new AF.ptr(934,966),new AF.ptr(937,969),new AF.ptr(946,976),new AF.ptr(949,1013),new AF.ptr(952,977),new AF.ptr(953,8126),new AF.ptr(954,1008),new AF.ptr(956,181),new AF.ptr(960,982),new AF.ptr(961,1009),new AF.ptr(962,963),new AF.ptr(963,931),new AF.ptr(966,981),new AF.ptr(969,8486),new AF.ptr(976,914),new AF.ptr(977,1012),new AF.ptr(981,934),new AF.ptr(982,928),new AF.ptr(1008,922),new AF.ptr(1009,929),new AF.ptr(1012,920),new AF.ptr(1013,917),new AF.ptr(7776,7777),new AF.ptr(7777,7835),new AF.ptr(7835,7776),new AF.ptr(7838,223),new AF.ptr(8126,837),new AF.ptr(8486,937),new AF.ptr(8490,75),new AF.ptr(8491,197)]);}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["unicode/utf8"]=(function(){var $pkg={},$init,B,A,C,F,G,H,J,K,L,M,N;B=$pkg.acceptRange=$newType(0,$kindStruct,"utf8.acceptRange","acceptRange","unicode/utf8",function(lo_,hi_){this.$val=this;if(arguments.length===0){this.lo=0;this.hi=0;return;}this.lo=lo_;this.hi=hi_;});F=function(a){var $ptr,a,aa,ab,ac,ad,ae,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b=0;c=0;d=a.$length;if(d<1){e=65533;f=0;b=e;c=f;return[b,c];}g=(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0]);h=((g<0||g>=A.length)?$throwRuntimeError("index out of range"):A[g]);if(h>=240){i=((h>>0)<<31>>0)>>31>>0;j=((((0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0])>>0)&~i)>>0)|(65533&i);k=1;b=j;c=k;return[b,c];}l=(h&7)>>>0;n=$clone((m=h>>>4<<24>>>24,((m<0||m>=C.length)?$throwRuntimeError("index out of range"):C[m])),B);if(d<(l>>0)){o=65533;p=1;b=o;c=p;return[b,c];}q=(1>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+1]);if(q>>0)>>0)<<6>>0)|(((q&63)>>>0)>>0);u=2;b=t;c=u;return[b,c];}v=(2>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+2]);if(v<128||191>>0)>>0)<<12>>0)|((((q&63)>>>0)>>0)<<6>>0))|(((v&63)>>>0)>>0);z=3;b=y;c=z;return[b,c];}aa=(3>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+3]);if(aa<128||191>>0)>>0)<<18>>0)|((((q&63)>>>0)>>0)<<12>>0))|((((v&63)>>>0)>>0)<<6>>0))|(((aa&63)>>>0)>>0);ae=4;b=ad;c=ae;return[b,c];};$pkg.DecodeRune=F;G=function(a){var $ptr,a,aa,ab,ac,ad,ae,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b=0;c=0;d=a.length;if(d<1){e=65533;f=0;b=e;c=f;return[b,c];}g=a.charCodeAt(0);h=((g<0||g>=A.length)?$throwRuntimeError("index out of range"):A[g]);if(h>=240){i=((h>>0)<<31>>0)>>31>>0;j=(((a.charCodeAt(0)>>0)&~i)>>0)|(65533&i);k=1;b=j;c=k;return[b,c];}l=(h&7)>>>0;n=$clone((m=h>>>4<<24>>>24,((m<0||m>=C.length)?$throwRuntimeError("index out of range"):C[m])),B);if(d<(l>>0)){o=65533;p=1;b=o;c=p;return[b,c];}q=a.charCodeAt(1);if(q>>0)>>0)<<6>>0)|(((q&63)>>>0)>>0);u=2;b=t;c=u;return[b,c];}v=a.charCodeAt(2);if(v<128||191>>0)>>0)<<12>>0)|((((q&63)>>>0)>>0)<<6>>0))|(((v&63)>>>0)>>0);z=3;b=y;c=z;return[b,c];}aa=a.charCodeAt(3);if(aa<128||191>>0)>>0)<<18>>0)|((((q&63)>>>0)>>0)<<12>>0))|((((v&63)>>>0)>>0)<<6>>0))|(((aa&63)>>>0)>>0);ae=4;b=ad;c=ae;return[b,c];};$pkg.DecodeRuneInString=G;H=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;b=0;c=0;d=a.$length;if(d===0){e=65533;f=0;b=e;c=f;return[b,c];}g=d-1>>0;b=(((g<0||g>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+g])>>0);if(b<128){h=b;i=1;b=h;c=i;return[b,c];}j=d-4>>0;if(j<0){j=0;}g=g-(1)>>0;while(true){if(!(g>=j)){break;}if(N(((g<0||g>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+g]))){break;}g=g-(1)>>0;}if(g<0){g=0;}k=F($subslice(a,g,d));b=k[0];c=k[1];if(!(((g+c>>0)===d))){l=65533;m=1;b=l;c=m;return[b,c];}n=b;o=c;b=n;c=o;return[b,c];};$pkg.DecodeLastRune=H;J=function(a){var $ptr,a;if(a<0){return-1;}else if(a<=127){return 1;}else if(a<=2047){return 2;}else if(55296<=a&&a<=57343){return-1;}else if(a<=65535){return 3;}else if(a<=1114111){return 4;}return-1;};$pkg.RuneLen=J;K=function(a,b){var $ptr,a,b,c;c=(b>>>0);if(c<=127){(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0]=(b<<24>>>24));return 1;}else if(c<=2047){(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0]=((192|((b>>6>>0)<<24>>>24))>>>0));(1>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+1]=((128|(((b<<24>>>24)&63)>>>0))>>>0));return 2;}else if((c>1114111)||(55296<=c&&c<=57343)){b=65533;(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0]=((224|((b>>12>>0)<<24>>>24))>>>0));(1>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+1]=((128|((((b>>6>>0)<<24>>>24)&63)>>>0))>>>0));(2>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+2]=((128|(((b<<24>>>24)&63)>>>0))>>>0));return 3;}else if(c<=65535){(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0]=((224|((b>>12>>0)<<24>>>24))>>>0));(1>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+1]=((128|((((b>>6>>0)<<24>>>24)&63)>>>0))>>>0));(2>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+2]=((128|(((b<<24>>>24)&63)>>>0))>>>0));return 3;}else{(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0]=((240|((b>>18>>0)<<24>>>24))>>>0));(1>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+1]=((128|((((b>>12>>0)<<24>>>24)&63)>>>0))>>>0));(2>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+2]=((128|((((b>>6>>0)<<24>>>24)&63)>>>0))>>>0));(3>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+3]=((128|(((b<<24>>>24)&63)>>>0))>>>0));return 4;}};$pkg.EncodeRune=K;L=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;b=a.$length;c=0;d=0;while(true){if(!(d>0;e=((d<0||d>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+d]);if(e<128){d=d+(1)>>0;continue;}f=((e<0||e>=A.length)?$throwRuntimeError("index out of range"):A[e]);if(f===241){d=d+(1)>>0;continue;}g=(((f&7)>>>0)>>0);if((d+g>>0)>b){d=d+(1)>>0;continue;}i=$clone((h=f>>>4<<24>>>24,((h<0||h>=C.length)?$throwRuntimeError("index out of range"):C[h])),B);k=(j=d+1>>0,((j<0||j>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+j]));if(k>0,((l<0||l>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+l]));if(m<128||191>0,((n<0||n>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+n]));if(o<128||191>0;}return c;};$pkg.RuneCount=L;M=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l;b=0;c=a.length;d=0;while(true){if(!(d>0;b=b+(1)>>0;continue;}f=((e<0||e>=A.length)?$throwRuntimeError("index out of range"):A[e]);if(f===241){d=d+(1)>>0;b=b+(1)>>0;continue;}g=(((f&7)>>>0)>>0);if((d+g>>0)>c){d=d+(1)>>0;b=b+(1)>>0;continue;}i=$clone((h=f>>>4<<24>>>24,((h<0||h>=C.length)?$throwRuntimeError("index out of range"):C[h])),B);j=a.charCodeAt((d+1>>0));if(j>0));if(k<128||191>0));if(l<128||191>0;b=b+(1)>>0;}b=b;return b;};$pkg.RuneCountInString=M;N=function(a){var $ptr,a;return!((((a&192)>>>0)===128));};$pkg.RuneStart=N;B.init([{prop:"lo",name:"lo",pkg:"unicode/utf8",typ:$Uint8,tag:""},{prop:"hi",name:"hi",pkg:"unicode/utf8",typ:$Uint8,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:A=$toNativeArray($kindUint8,[240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,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,19,3,3,3,3,3,3,3,3,3,3,3,3,35,3,3,52,4,4,4,68,241,241,241,241,241,241,241,241,241,241,241]);C=$toNativeArray($kindStruct,[new B.ptr(128,191),new B.ptr(160,191),new B.ptr(128,159),new B.ptr(144,191),new B.ptr(128,143)]);}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["bytes"]=(function(){var $pkg={},$init,A,B,D,C,H,I,BK,BL,BM,BN,E,J,BH;A=$packages["errors"];B=$packages["io"];D=$packages["unicode"];C=$packages["unicode/utf8"];H=$pkg.Buffer=$newType(0,$kindStruct,"bytes.Buffer","Buffer","bytes",function(buf_,off_,runeBytes_,bootstrap_,lastRead_){this.$val=this;if(arguments.length===0){this.buf=BL.nil;this.off=0;this.runeBytes=BM.zero();this.bootstrap=BN.zero();this.lastRead=0;return;}this.buf=buf_;this.off=off_;this.runeBytes=runeBytes_;this.bootstrap=bootstrap_;this.lastRead=lastRead_;});I=$pkg.readOp=$newType(4,$kindInt,"bytes.readOp","readOp","bytes",null);BK=$ptrType(H);BL=$sliceType($Uint8);BM=$arrayType($Uint8,4);BN=$arrayType($Uint8,64);E=function(d,e){var $ptr,d,e,f,g,h,i;f=d;g=0;while(true){if(!(g=f.$length)?$throwRuntimeError("index out of range"):f.$array[f.$offset+g]);if(i===e){return h;}g++;}return-1;};$pkg.IndexByte=E;H.ptr.prototype.Bytes=function(){var $ptr,d;d=this;return $subslice(d.buf,d.off);};H.prototype.Bytes=function(){return this.$val.Bytes();};H.ptr.prototype.String=function(){var $ptr,d;d=this;if(d===BK.nil){return"";}return $bytesToString($subslice(d.buf,d.off));};H.prototype.String=function(){return this.$val.String();};H.ptr.prototype.Len=function(){var $ptr,d;d=this;return d.buf.$length-d.off>>0;};H.prototype.Len=function(){return this.$val.Len();};H.ptr.prototype.Cap=function(){var $ptr,d;d=this;return d.buf.$capacity;};H.prototype.Cap=function(){return this.$val.Cap();};H.ptr.prototype.Truncate=function(d){var $ptr,d,e;e=this;e.lastRead=0;if(d<0||d>e.Len()){$panic(new $String("bytes.Buffer: truncation out of range"));}else if((d===0)){e.off=0;}e.buf=$subslice(e.buf,0,(e.off+d>>0));};H.prototype.Truncate=function(d){return this.$val.Truncate(d);};H.ptr.prototype.Reset=function(){var $ptr,d;d=this;d.Truncate(0);};H.prototype.Reset=function(){return this.$val.Reset();};H.ptr.prototype.grow=function(d){var $ptr,d,e,f,g,h;e=this;f=e.Len();if((f===0)&&!((e.off===0))){e.Truncate(0);}if((e.buf.$length+d>>0)>e.buf.$capacity){g=BL.nil;if(e.buf===BL.nil&&d<=64){g=$subslice(new BL(e.bootstrap),0);}else if((f+d>>0)<=(h=e.buf.$capacity/2,(h===h&&h!==1/0&&h!==-1/0)?h>>0:$throwRuntimeError("integer divide by zero"))){$copySlice(e.buf,$subslice(e.buf,e.off));g=$subslice(e.buf,0,f);}else{g=J(($imul(2,e.buf.$capacity))+d>>0);$copySlice(g,$subslice(e.buf,e.off));}e.buf=g;e.off=0;}e.buf=$subslice(e.buf,0,((e.off+f>>0)+d>>0));return e.off+f>>0;};H.prototype.grow=function(d){return this.$val.grow(d);};H.ptr.prototype.Grow=function(d){var $ptr,d,e,f;e=this;if(d<0){$panic(new $String("bytes.Buffer.Grow: negative count"));}f=e.grow(d);e.buf=$subslice(e.buf,0,f);};H.prototype.Grow=function(d){return this.$val.Grow(d);};H.ptr.prototype.Write=function(d){var $ptr,d,e,f,g,h,i,j;e=0;f=$ifaceNil;g=this;g.lastRead=0;h=g.grow(d.$length);i=$copySlice($subslice(g.buf,h),d);j=$ifaceNil;e=i;f=j;return[e,f];};H.prototype.Write=function(d){return this.$val.Write(d);};H.ptr.prototype.WriteString=function(d){var $ptr,d,e,f,g,h,i,j;e=0;f=$ifaceNil;g=this;g.lastRead=0;h=g.grow(d.length);i=$copyString($subslice(g.buf,h),d);j=$ifaceNil;e=i;f=j;return[e,f];};H.prototype.WriteString=function(d){return this.$val.WriteString(d);};H.ptr.prototype.ReadFrom=function(d){var $ptr,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=new $Int64(0,0);f=$ifaceNil;g=this;g.lastRead=0;if(g.off>=g.buf.$length){g.Truncate(0);}case 1:h=g.buf.$capacity-g.buf.$length>>0;if(h<512){i=g.buf;if((g.off+h>>0)<512){i=J(($imul(2,g.buf.$capacity))+512>>0);}$copySlice(i,$subslice(g.buf,g.off));g.buf=$subslice(i,0,(g.buf.$length-g.off>>0));g.off=0;}k=d.Read($subslice(g.buf,g.buf.$length,g.buf.$capacity));$s=3;case 3:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}j=k;l=j[0];m=j[1];g.buf=$subslice(g.buf,0,(g.buf.$length+l>>0));e=(n=new $Int64(0,l),new $Int64(e.$high+n.$high,e.$low+n.$low));if($interfaceIsEqual(m,B.EOF)){$s=2;continue;}if(!($interfaceIsEqual(m,$ifaceNil))){o=e;p=m;e=o;f=p;return[e,f];}$s=1;continue;case 2:q=e;r=$ifaceNil;e=q;f=r;return[e,f];}return;}if($f===undefined){$f={$blk:H.ptr.prototype.ReadFrom};}$f.$ptr=$ptr;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.$s=$s;$f.$r=$r;return $f;};H.prototype.ReadFrom=function(d){return this.$val.ReadFrom(d);};J=function(d){var $ptr,d,$deferred;var $err=null;try{$deferred=[];$deferred.index=$curGoroutine.deferStack.length;$curGoroutine.deferStack.push($deferred);$deferred.push([(function(){var $ptr;if(!($interfaceIsEqual($recover(),$ifaceNil))){$panic($pkg.ErrTooLarge);}}),[]]);return $makeSlice(BL,d);}catch(err){$err=err;return BL.nil;}finally{$callDeferred($deferred,$err);}};H.ptr.prototype.WriteTo=function(d){var $ptr,d,e,f,g,h,i,j,k,l,m,n,o,p,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=new $Int64(0,0);f=$ifaceNil;g=this;g.lastRead=0;if(g.offh){$panic(new $String("bytes.Buffer.WriteTo: invalid Write count"));}g.off=g.off+(k)>>0;e=new $Int64(0,k);if(!($interfaceIsEqual(l,$ifaceNil))){m=e;n=l;e=m;f=n;return[e,f];}if(!((k===h))){o=e;p=B.ErrShortWrite;e=o;f=p;return[e,f];}case 2:g.Truncate(0);return[e,f];}return;}if($f===undefined){$f={$blk:H.ptr.prototype.WriteTo};}$f.$ptr=$ptr;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.$s=$s;$f.$r=$r;return $f;};H.prototype.WriteTo=function(d){return this.$val.WriteTo(d);};H.ptr.prototype.WriteByte=function(d){var $ptr,d,e,f,g;e=this;e.lastRead=0;f=e.grow(1);(g=e.buf,((f<0||f>=g.$length)?$throwRuntimeError("index out of range"):g.$array[g.$offset+f]=d));return $ifaceNil;};H.prototype.WriteByte=function(d){return this.$val.WriteByte(d);};H.ptr.prototype.WriteRune=function(d){var $ptr,d,e,f,g,h,i,j,k;e=0;f=$ifaceNil;g=this;if(d<128){g.WriteByte((d<<24>>>24));h=1;i=$ifaceNil;e=h;f=i;return[e,f];}e=C.EncodeRune($subslice(new BL(g.runeBytes),0),d);g.Write($subslice(new BL(g.runeBytes),0,e));j=e;k=$ifaceNil;e=j;f=k;return[e,f];};H.prototype.WriteRune=function(d){return this.$val.WriteRune(d);};H.ptr.prototype.Read=function(d){var $ptr,d,e,f,g,h,i;e=0;f=$ifaceNil;g=this;g.lastRead=0;if(g.off>=g.buf.$length){g.Truncate(0);if(d.$length===0){return[e,f];}h=0;i=B.EOF;e=h;f=i;return[e,f];}e=$copySlice(d,$subslice(g.buf,g.off));g.off=g.off+(e)>>0;if(e>0){g.lastRead=2;}return[e,f];};H.prototype.Read=function(d){return this.$val.Read(d);};H.ptr.prototype.Next=function(d){var $ptr,d,e,f,g;e=this;e.lastRead=0;f=e.Len();if(d>f){d=f;}g=$subslice(e.buf,e.off,(e.off+d>>0));e.off=e.off+(d)>>0;if(d>0){e.lastRead=2;}return g;};H.prototype.Next=function(d){return this.$val.Next(d);};H.ptr.prototype.ReadByte=function(){var $ptr,d,e,f,g,h,i,j,k,l;d=0;e=$ifaceNil;f=this;f.lastRead=0;if(f.off>=f.buf.$length){f.Truncate(0);g=0;h=B.EOF;d=g;e=h;return[d,e];}d=(i=f.buf,j=f.off,((j<0||j>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+j]));f.off=f.off+(1)>>0;f.lastRead=2;k=d;l=$ifaceNil;d=k;e=l;return[d,e];};H.prototype.ReadByte=function(){return this.$val.ReadByte();};H.ptr.prototype.ReadRune=function(){var $ptr,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;d=0;e=0;f=$ifaceNil;g=this;g.lastRead=0;if(g.off>=g.buf.$length){g.Truncate(0);h=0;i=0;j=B.EOF;d=h;e=i;f=j;return[d,e,f];}g.lastRead=1;m=(k=g.buf,l=g.off,((l<0||l>=k.$length)?$throwRuntimeError("index out of range"):k.$array[k.$offset+l]));if(m<128){g.off=g.off+(1)>>0;n=(m>>0);o=1;p=$ifaceNil;d=n;e=o;f=p;return[d,e,f];}q=C.DecodeRune($subslice(g.buf,g.off));d=q[0];r=q[1];g.off=g.off+(r)>>0;s=d;t=r;u=$ifaceNil;d=s;e=t;f=u;return[d,e,f];};H.prototype.ReadRune=function(){return this.$val.ReadRune();};H.ptr.prototype.UnreadRune=function(){var $ptr,d,e,f;d=this;if(!((d.lastRead===1))){return A.New("bytes.Buffer: UnreadRune: previous operation was not ReadRune");}d.lastRead=0;if(d.off>0){e=C.DecodeLastRune($subslice(d.buf,0,d.off));f=e[1];d.off=d.off-(f)>>0;}return $ifaceNil;};H.prototype.UnreadRune=function(){return this.$val.UnreadRune();};H.ptr.prototype.UnreadByte=function(){var $ptr,d;d=this;if(!((d.lastRead===1))&&!((d.lastRead===2))){return A.New("bytes.Buffer: UnreadByte: previous operation was not a read");}d.lastRead=0;if(d.off>0){d.off=d.off-(1)>>0;}return $ifaceNil;};H.prototype.UnreadByte=function(){return this.$val.UnreadByte();};H.ptr.prototype.ReadBytes=function(d){var $ptr,d,e,f,g,h,i;e=BL.nil;f=$ifaceNil;g=this;h=g.readSlice(d);i=h[0];f=h[1];e=$appendSlice(e,i);return[e,f];};H.prototype.ReadBytes=function(d){return this.$val.ReadBytes(d);};H.ptr.prototype.readSlice=function(d){var $ptr,d,e,f,g,h,i,j,k;e=BL.nil;f=$ifaceNil;g=this;h=E($subslice(g.buf,g.off),d);i=(g.off+h>>0)+1>>0;if(h<0){i=g.buf.$length;f=B.EOF;}e=$subslice(g.buf,g.off,i);g.off=i;g.lastRead=2;j=e;k=f;e=j;f=k;return[e,f];};H.prototype.readSlice=function(d){return this.$val.readSlice(d);};H.ptr.prototype.ReadString=function(d){var $ptr,d,e,f,g,h,i,j,k;e="";f=$ifaceNil;g=this;h=g.readSlice(d);i=h[0];f=h[1];j=$bytesToString(i);k=f;e=j;f=k;return[e,f];};H.prototype.ReadString=function(d){return this.$val.ReadString(d);};BH=function(d,e){var $ptr,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;while(true){if(!(!((d.$length===0))&&!((e.$length===0)))){break;}f=0;g=0;h=f;i=g;if((0>=d.$length?$throwRuntimeError("index out of range"):d.$array[d.$offset+0])<128){j=((0>=d.$length?$throwRuntimeError("index out of range"):d.$array[d.$offset+0])>>0);k=$subslice(d,1);h=j;d=k;}else{l=C.DecodeRune(d);m=l[0];n=l[1];o=m;p=$subslice(d,n);h=o;d=p;}if((0>=e.$length?$throwRuntimeError("index out of range"):e.$array[e.$offset+0])<128){q=((0>=e.$length?$throwRuntimeError("index out of range"):e.$array[e.$offset+0])>>0);r=$subslice(e,1);i=q;e=r;}else{s=C.DecodeRune(e);t=s[0];u=s[1];v=t;w=$subslice(e,u);i=v;e=w;}if(i===h){continue;}if(i>0)-65>>0)){continue;}return false;}z=D.SimpleFold(h);while(true){if(!(!((z===h))&&z=0){return D;}else{return E;}};$pkg.Inf=U;V=function(an,ao){var $ptr,an,ao;if(an===D){return ao>=0;}if(an===E){return ao<=0;}return false;};$pkg.IsInf=V;W=function(an){var $ptr,an,ao;ao=false;ao=!((an===an));return ao;};$pkg.IsNaN=W;Y=function(an){var $ptr,an;if(!((an===an))){return F;}return $parseFloat(B.log(an));};$pkg.Log=Y;AB=function(an){var $ptr,an;return ED(an);};$pkg.Log2=AB;AG=function(){var $ptr;return F;};$pkg.NaN=AG;AQ=function(){var $ptr,an;an=new($global.ArrayBuffer)(8);AP.uint32array=new($global.Uint32Array)(an);AP.float32array=new($global.Float32Array)(an);AP.float64array=new($global.Float64Array)(an);};AR=function(an){var $ptr,an;AP.float32array[0]=an;return AP.uint32array[0];};$pkg.Float32bits=AR;AS=function(an){var $ptr,an;AP.uint32array[0]=an;return AP.float32array[0];};$pkg.Float32frombits=AS;AT=function(an){var $ptr,an,ao,ap;AP.float64array[0]=an;return(ao=$shiftLeft64(new $Uint64(0,AP.uint32array[1]),32),ap=new $Uint64(0,AP.uint32array[0]),new $Uint64(ao.$high+ap.$high,ao.$low+ap.$low));};$pkg.Float64bits=AT;AU=function(an){var $ptr,an;AP.uint32array[0]=(an.$low>>>0);AP.uint32array[1]=($shiftRightUint64(an,32).$low>>>0);return AP.float64array[0];};$pkg.Float64frombits=AU;AV=function(an){var $ptr,an;if(an<0){return-an;}if(an===0){return 0;}return an;};$pkg.Abs=AV;BF=function(an){var $ptr,an,ao,ap,aq,ar,as,at;ao=0;ap=0;if(AV(an)<2.2250738585072014e-308){aq=an*4.503599627370496e+15;ar=-52;ao=aq;ap=ar;return[ao,ap];}as=an;at=0;ao=as;ap=at;return[ao,ap];};BT=function(an){var $ptr,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay;ao=0;ap=0;if((an===0)){aq=an;ar=0;ao=aq;ap=ar;return[ao,ap];}else if(V(an,0)||W(an)){as=an;at=0;ao=as;ap=at;return[ao,ap];}au=BF(an);an=au[0];ap=au[1];av=AT(an);ap=ap+(((((aw=$shiftRightUint64(av,52),new $Uint64(aw.$high&0,(aw.$low&2047)>>>0)).$low>>0)-1023>>0)+1>>0))>>0;av=(ax=new $Uint64(2146435072,0),new $Uint64(av.$high&~ax.$high,(av.$low&~ax.$low)>>>0));av=(ay=new $Uint64(1071644672,0),new $Uint64(av.$high|ay.$high,(av.$low|ay.$low)>>>0));ao=AU(av);return[ao,ap];};ED=function(an){var $ptr,an,ao,ap,aq;ao=S(an);ap=ao[0];aq=ao[1];if(ap===0.5){return(aq-1>>0);}return Y(ap)*1.4426950408889634+aq;};EP=function(){var $ptr,an,ao,ap,aq;EN[0]=1;EN[1]=10;an=2;while(true){if(!(an<70)){break;}ap=(ao=an/2,(ao===ao&&ao!==1/0&&ao!==-1/0)?ao>>0:$throwRuntimeError("integer divide by zero"));((an<0||an>=EN.length)?$throwRuntimeError("index out of range"):EN[an]=((ap<0||ap>=EN.length)?$throwRuntimeError("index out of range"):EN[ap])*(aq=an-ap>>0,((aq<0||aq>=EN.length)?$throwRuntimeError("index out of range"):EN[aq])));an=an+(1)>>0;}};$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}AP=new FJ.ptr(FG.zero(),FH.zero(),FI.zero());EN=FK.zero();B=$global.Math;C=0;D=1/C;E=-1/C;F=0/C;AQ();EP();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["strconv"]=(function(){var $pkg={},$init,B,A,C,S,Y,AC,AH,AO,AX,CO,CP,CQ,CR,CS,CT,CU,CV,CW,CX,CY,CZ,DA,DB,DC,DD,DE,G,K,L,M,AD,AI,AJ,AK,AP,CM,AQ,CN,BD,BE,BF,BG,BH,BN,D,H,I,J,N,O,P,Q,R,T,U,V,W,Z,AA,AB,AE,AF,AG,AL,AM,AN,AR,AS,AT,AU,AV,AW,AY,AZ,BA,BB,BC,BJ,BK,BL,BM,BO,BP,BQ,BS,BW,BX,BY,BZ,CC,CD,CE,CF,CG,CH,CI,CJ,CL;B=$packages["errors"];A=$packages["math"];C=$packages["unicode/utf8"];S=$pkg.NumError=$newType(0,$kindStruct,"strconv.NumError","NumError","strconv",function(Func_,Num_,Err_){this.$val=this;if(arguments.length===0){this.Func="";this.Num="";this.Err=$ifaceNil;return;}this.Func=Func_;this.Num=Num_;this.Err=Err_;});Y=$pkg.decimal=$newType(0,$kindStruct,"strconv.decimal","decimal","strconv",function(d_,nd_,dp_,neg_,trunc_){this.$val=this;if(arguments.length===0){this.d=CU.zero();this.nd=0;this.dp=0;this.neg=false;this.trunc=false;return;}this.d=d_;this.nd=nd_;this.dp=dp_;this.neg=neg_;this.trunc=trunc_;});AC=$pkg.leftCheat=$newType(0,$kindStruct,"strconv.leftCheat","leftCheat","strconv",function(delta_,cutoff_){this.$val=this;if(arguments.length===0){this.delta=0;this.cutoff="";return;}this.delta=delta_;this.cutoff=cutoff_;});AH=$pkg.extFloat=$newType(0,$kindStruct,"strconv.extFloat","extFloat","strconv",function(mant_,exp_,neg_){this.$val=this;if(arguments.length===0){this.mant=new $Uint64(0,0);this.exp=0;this.neg=false;return;}this.mant=mant_;this.exp=exp_;this.neg=neg_;});AO=$pkg.floatInfo=$newType(0,$kindStruct,"strconv.floatInfo","floatInfo","strconv",function(mantbits_,expbits_,bias_){this.$val=this;if(arguments.length===0){this.mantbits=0;this.expbits=0;this.bias=0;return;}this.mantbits=mantbits_;this.expbits=expbits_;this.bias=bias_;});AX=$pkg.decimalSlice=$newType(0,$kindStruct,"strconv.decimalSlice","decimalSlice","strconv",function(d_,nd_,dp_,neg_){this.$val=this;if(arguments.length===0){this.d=CW.nil;this.nd=0;this.dp=0;this.neg=false;return;}this.d=d_;this.nd=nd_;this.dp=dp_;this.neg=neg_;});CO=$sliceType($Int);CP=$sliceType($Float64);CQ=$sliceType($Float32);CR=$sliceType(AC);CS=$sliceType($Uint16);CT=$sliceType($Uint32);CU=$arrayType($Uint8,800);CV=$ptrType(S);CW=$sliceType($Uint8);CX=$arrayType($Uint8,24);CY=$arrayType($Uint8,32);CZ=$ptrType(AO);DA=$arrayType($Uint8,65);DB=$arrayType($Uint8,4);DC=$ptrType(Y);DD=$ptrType(AX);DE=$ptrType(AH);D=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j;b=false;c=$ifaceNil;d=a;if(d===("1")||d===("t")||d===("T")||d===("true")||d===("TRUE")||d===("True")){e=true;f=$ifaceNil;b=e;c=f;return[b,c];}else if(d===("0")||d===("f")||d===("F")||d===("false")||d===("FALSE")||d===("False")){g=false;h=$ifaceNil;b=g;c=h;return[b,c];}i=false;j=T("ParseBool",a);b=i;c=j;return[b,c];};$pkg.ParseBool=D;H=function(a,b){var $ptr,a,b,c,d,e;if(!((a.length===b.length))){return false;}c=0;while(true){if(!(c>>24;}e=b.charCodeAt(c);if(65<=e&&e<=90){e=e+(32)<<24>>>24;}if(!((d===e))){return false;}c=c+(1)>>0;}return true;};I=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l;b=0;c=false;if(a.length===0){return[b,c];}d=a.charCodeAt(0);if(d===(43)){if(H(a,"+inf")||H(a,"+infinity")){e=A.Inf(1);f=true;b=e;c=f;return[b,c];}}else if(d===(45)){if(H(a,"-inf")||H(a,"-infinity")){g=A.Inf(-1);h=true;b=g;c=h;return[b,c];}}else if((d===(110))||(d===(78))){if(H(a,"nan")){i=A.NaN();j=true;b=i;c=j;return[b,c];}}else if((d===(105))||(d===(73))){if(H(a,"inf")||H(a,"infinity")){k=A.Inf(1);l=true;b=k;c=l;return[b,c];}}else{return[b,c];}return[b,c];};Y.ptr.prototype.set=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j;b=false;c=this;d=0;c.neg=false;c.trunc=false;if(d>=a.length){return b;}if((a.charCodeAt(d)===43)){d=d+(1)>>0;}else if((a.charCodeAt(d)===45)){c.neg=true;d=d+(1)>>0;}e=false;f=false;while(true){if(!(d>0;continue;}else if(48<=a.charCodeAt(d)&&a.charCodeAt(d)<=57){f=true;if((a.charCodeAt(d)===48)&&(c.nd===0)){c.dp=c.dp-(1)>>0;d=d+(1)>>0;continue;}if(c.nd<800){(g=c.d,h=c.nd,((h<0||h>=g.length)?$throwRuntimeError("index out of range"):g[h]=a.charCodeAt(d)));c.nd=c.nd+(1)>>0;}else if(!((a.charCodeAt(d)===48))){c.trunc=true;}d=d+(1)>>0;continue;}break;}if(!f){return b;}if(!e){c.dp=c.nd;}if(d>0;if(d>=a.length){return b;}i=1;if(a.charCodeAt(d)===43){d=d+(1)>>0;}else if(a.charCodeAt(d)===45){d=d+(1)>>0;i=-1;}if(d>=a.length||a.charCodeAt(d)<48||a.charCodeAt(d)>57){return b;}j=0;while(true){if(!(d>0)>>0)-48>>0;}d=d+(1)>>0;}c.dp=c.dp+(($imul(j,i)))>>0;}if(!((d===a.length))){return b;}b=true;return b;};Y.prototype.set=function(a){return this.$val.set(a);};J=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;b=new $Uint64(0,0);c=0;d=false;e=false;f=false;g=0;if(g>=a.length){return[b,c,d,e,f];}if((a.charCodeAt(g)===43)){g=g+(1)>>0;}else if((a.charCodeAt(g)===45)){d=true;g=g+(1)>>0;}h=false;i=false;j=0;k=0;l=0;while(true){if(!(g>0;continue;}else if(n===(48<=m&&m<=57)){i=true;if((m===48)&&(j===0)){l=l-(1)>>0;g=g+(1)>>0;continue;}j=j+(1)>>0;if(k<19){b=$mul64(b,(new $Uint64(0,10)));b=(o=new $Uint64(0,(m-48<<24>>>24)),new $Uint64(b.$high+o.$high,b.$low+o.$low));k=k+(1)>>0;}else if(!((a.charCodeAt(g)===48))){e=true;}g=g+(1)>>0;continue;}break;}if(!i){return[b,c,d,e,f];}if(!h){l=j;}if(g>0;if(g>=a.length){return[b,c,d,e,f];}p=1;if(a.charCodeAt(g)===43){g=g+(1)>>0;}else if(a.charCodeAt(g)===45){g=g+(1)>>0;p=-1;}if(g>=a.length||a.charCodeAt(g)<48||a.charCodeAt(g)>57){return[b,c,d,e,f];}q=0;while(true){if(!(g>0)>>0)-48>>0;}g=g+(1)>>0;}l=l+(($imul(q,p)))>>0;}if(!((g===a.length))){return[b,c,d,e,f];}c=l-k>>0;f=true;return[b,c,d,e,f];};Y.ptr.prototype.floatBits=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,$s;$s=0;s:while(true){switch($s){case 0:b=new $Uint64(0,0);c=false;d=this;e=0;f=new $Uint64(0,0);if(d.nd===0){$s=1;continue;}$s=2;continue;case 1:f=new $Uint64(0,0);e=a.bias;$s=3;continue;case 2:if(d.dp>310){$s=4;continue;}$s=5;continue;case 4:$s=6;continue;case 5:if(d.dp<-330){$s=7;continue;}$s=8;continue;case 7:f=new $Uint64(0,0);e=a.bias;$s=3;continue;case 8:e=0;while(true){if(!(d.dp>0)){break;}g=0;if(d.dp>=K.$length){g=27;}else{g=(h=d.dp,((h<0||h>=K.$length)?$throwRuntimeError("index out of range"):K.$array[K.$offset+h]));}d.Shift(-g);e=e+(g)>>0;}while(true){if(!(d.dp<0||(d.dp===0)&&d.d[0]<53)){break;}i=0;if(-d.dp>=K.$length){i=27;}else{i=(j=-d.dp,((j<0||j>=K.$length)?$throwRuntimeError("index out of range"):K.$array[K.$offset+j]));}d.Shift(i);e=e-(i)>>0;}e=e-(1)>>0;if(e<(a.bias+1>>0)){k=(a.bias+1>>0)-e>>0;d.Shift(-k);e=e+(k)>>0;}if((e-a.bias>>0)>=(((l=a.expbits,l<32?(1<>0)-1>>0)){$s=9;continue;}$s=10;continue;case 9:$s=6;continue;case 10:d.Shift(((1+a.mantbits>>>0)>>0));f=d.RoundedInteger();if((m=$shiftLeft64(new $Uint64(0,2),a.mantbits),(f.$high===m.$high&&f.$low===m.$low))){$s=11;continue;}$s=12;continue;case 11:f=$shiftRightUint64(f,(1));e=e+(1)>>0;if((e-a.bias>>0)>=(((n=a.expbits,n<32?(1<>0)-1>>0)){$s=13;continue;}$s=14;continue;case 13:$s=6;continue;case 14:case 12:if((o=(p=$shiftLeft64(new $Uint64(0,1),a.mantbits),new $Uint64(f.$high&p.$high,(f.$low&p.$low)>>>0)),(o.$high===0&&o.$low===0))){e=a.bias;}$s=3;continue;case 6:f=new $Uint64(0,0);e=(((q=a.expbits,q<32?(1<>0)-1>>0)+a.bias>>0;c=true;case 3:t=(r=(s=$shiftLeft64(new $Uint64(0,1),a.mantbits),new $Uint64(s.$high-0,s.$low-1)),new $Uint64(f.$high&r.$high,(f.$low&r.$low)>>>0));t=(u=$shiftLeft64(new $Uint64(0,(((e-a.bias>>0))&((((v=a.expbits,v<32?(1<>0)-1>>0)))),a.mantbits),new $Uint64(t.$high|u.$high,(t.$low|u.$low)>>>0));if(d.neg){t=(w=$shiftLeft64($shiftLeft64(new $Uint64(0,1),a.mantbits),a.expbits),new $Uint64(t.$high|w.$high,(t.$low|w.$low)>>>0));}x=t;y=c;b=x;c=y;return[b,c];}return;}};Y.prototype.floatBits=function(a){return this.$val.floatBits(a);};N=function(a,b,c){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n;d=0;e=false;if(!((f=$shiftRightUint64(a,AQ.mantbits),(f.$high===0&&f.$low===0)))){return[d,e];}d=$flatten64(a);if(c){d=-d;}if((b===0)){g=d;h=true;d=g;e=h;return[d,e];}else if(b>0&&b<=37){if(b>22){d=d*((i=b-22>>0,((i<0||i>=L.$length)?$throwRuntimeError("index out of range"):L.$array[L.$offset+i])));b=22;}if(d>1e+15||d<-1e+15){return[d,e];}j=d*((b<0||b>=L.$length)?$throwRuntimeError("index out of range"):L.$array[L.$offset+b]);k=true;d=j;e=k;return[d,e];}else if(b<0&&b>=-22){l=d/(m=-b,((m<0||m>=L.$length)?$throwRuntimeError("index out of range"):L.$array[L.$offset+m]));n=true;d=l;e=n;return[d,e];}return[d,e];};O=function(a,b,c){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n;d=0;e=false;if(!((f=$shiftRightUint64(a,AP.mantbits),(f.$high===0&&f.$low===0)))){return[d,e];}d=$flatten64(a);if(c){d=-d;}if((b===0)){g=d;h=true;d=g;e=h;return[d,e];}else if(b>0&&b<=17){if(b>10){d=$fround(d*((i=b-10>>0,((i<0||i>=M.$length)?$throwRuntimeError("index out of range"):M.$array[M.$offset+i]))));b=10;}if(d>1e+07||d<-1e+07){return[d,e];}j=$fround(d*((b<0||b>=M.$length)?$throwRuntimeError("index out of range"):M.$array[M.$offset+b]));k=true;d=j;e=k;return[d,e];}else if(b<0&&b>=-10){l=$fround(d/(m=-b,((m<0||m>=M.$length)?$throwRuntimeError("index out of range"):M.$array[M.$offset+m])));n=true;d=l;e=n;return[d,e];}return[d,e];};P=function(a){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b=0;c=$ifaceNil;d=I(a);e=d[0];f=d[1];if(f){g=$fround(e);h=$ifaceNil;b=g;c=h;return[b,c];}if(G){i=J(a);j=i[0];k=i[1];l=i[2];m=i[3];n=i[4];if(n){if(!m){o=O(j,k,l);p=o[0];q=o[1];if(q){r=p;s=$ifaceNil;b=r;c=s;return[b,c];}}t=new AH.ptr(new $Uint64(0,0),0,false);u=t.AssignDecimal(j,k,l,m,AP);if(u){v=t.floatBits(AP);w=v[0];x=v[1];b=A.Float32frombits((w.$low>>>0));if(x){c=U("ParseFloat",a);}y=b;z=c;b=y;c=z;return[b,c];}}}aa=new Y.ptr(CU.zero(),0,0,false,false);if(!aa.set(a)){ab=0;ac=T("ParseFloat",a);b=ab;c=ac;return[b,c];}ad=aa.floatBits(AP);ae=ad[0];af=ad[1];b=A.Float32frombits((ae.$low>>>0));if(af){c=U("ParseFloat",a);}ag=b;ah=c;b=ag;c=ah;return[b,c];};Q=function(a){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b=0;c=$ifaceNil;d=I(a);e=d[0];f=d[1];if(f){g=e;h=$ifaceNil;b=g;c=h;return[b,c];}if(G){i=J(a);j=i[0];k=i[1];l=i[2];m=i[3];n=i[4];if(n){if(!m){o=N(j,k,l);p=o[0];q=o[1];if(q){r=p;s=$ifaceNil;b=r;c=s;return[b,c];}}t=new AH.ptr(new $Uint64(0,0),0,false);u=t.AssignDecimal(j,k,l,m,AQ);if(u){v=t.floatBits(AQ);w=v[0];x=v[1];b=A.Float64frombits(w);if(x){c=U("ParseFloat",a);}y=b;z=c;b=y;c=z;return[b,c];}}}aa=new Y.ptr(CU.zero(),0,0,false,false);if(!aa.set(a)){ab=0;ac=T("ParseFloat",a);b=ab;c=ac;return[b,c];}ad=aa.floatBits(AQ);ae=ad[0];af=ad[1];b=A.Float64frombits(ae);if(af){c=U("ParseFloat",a);}ag=b;ah=c;b=ag;c=ah;return[b,c];};R=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n;c=0;d=$ifaceNil;if(b===32){e=P(a);f=e[0];g=e[1];h=f;i=g;c=h;d=i;return[c,d];}j=Q(a);k=j[0];l=j[1];m=k;n=l;c=m;d=n;return[c,d];};$pkg.ParseFloat=R;S.ptr.prototype.Error=function(){var $ptr,a,b,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=this;b=a.Err.Error();$s=1;case 1:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}$s=2;case 2:return"strconv."+a.Func+": "+"parsing "+BQ(a.Num)+": "+b;}return;}if($f===undefined){$f={$blk:S.ptr.prototype.Error};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.$s=$s;$f.$r=$r;return $f;};S.prototype.Error=function(){return this.$val.Error();};T=function(a,b){var $ptr,a,b;return new S.ptr(a,b,$pkg.ErrSyntax);};U=function(a,b){var $ptr,a,b;return new S.ptr(a,b,$pkg.ErrRange);};V=function(a,b,c){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,$s;$s=0;s:while(true){switch($s){case 0:d=new $Uint64(0,0);e=$ifaceNil;f=new $Uint64(0,0);g=new $Uint64(0,0);h=f;i=g;if(c===0){c=32;}j=0;if(a.length<1){$s=2;continue;}if(2<=b&&b<=36){$s=3;continue;}if((b===0)){$s=4;continue;}$s=5;continue;case 2:e=$pkg.ErrSyntax;$s=7;continue;$s=6;continue;case 3:$s=6;continue;case 4:if((a.charCodeAt(0)===48)&&a.length>1&&((a.charCodeAt(1)===120)||(a.charCodeAt(1)===88))){$s=9;continue;}if((a.charCodeAt(0)===48)){$s=10;continue;}$s=11;continue;case 9:if(a.length<3){$s=13;continue;}$s=14;continue;case 13:e=$pkg.ErrSyntax;$s=7;continue;case 14:b=16;j=2;$s=12;continue;case 10:b=8;j=1;$s=12;continue;case 11:b=10;case 12:case 8:$s=6;continue;case 5:e=B.New("invalid base "+BK(b));$s=7;continue;case 6:case 1:k=b;if(k===(10)){h=new $Uint64(429496729,2576980378);}else if(k===(16)){h=new $Uint64(268435456,0);}else{h=(l=$div64(new $Uint64(4294967295,4294967295),new $Uint64(0,b),false),new $Uint64(l.$high+0,l.$low+1));}i=(m=$shiftLeft64(new $Uint64(0,1),(c>>>0)),new $Uint64(m.$high-0,m.$low-1));case 15:if(!(j>>24;$s=22;continue;case 19:n=(o-97<<24>>>24)+10<<24>>>24;$s=22;continue;case 20:n=(o-65<<24>>>24)+10<<24>>>24;$s=22;continue;case 21:d=new $Uint64(0,0);e=$pkg.ErrSyntax;$s=7;continue;case 22:case 17:if(n>=(b<<24>>>24)){$s=23;continue;}$s=24;continue;case 23:d=new $Uint64(0,0);e=$pkg.ErrSyntax;$s=7;continue;case 24:if((d.$high>h.$high||(d.$high===h.$high&&d.$low>=h.$low))){$s=25;continue;}$s=26;continue;case 25:d=new $Uint64(4294967295,4294967295);e=$pkg.ErrRange;$s=7;continue;case 26:d=$mul64(d,(new $Uint64(0,b)));q=(p=new $Uint64(0,n),new $Uint64(d.$high+p.$high,d.$low+p.$low));if((q.$highi.$high||(q.$high===i.$high&&q.$low>i.$low))){$s=27;continue;}$s=28;continue;case 27:d=new $Uint64(4294967295,4294967295);e=$pkg.ErrRange;$s=7;continue;case 28:d=q;j=j+(1)>>0;$s=15;continue;case 16:r=d;s=$ifaceNil;d=r;e=s;return[d,e];case 7:t=d;u=new S.ptr("ParseUint",a,e);d=t;e=u;return[d,e];$s=-1;case-1:}return;}};$pkg.ParseUint=V;W=function(a,b,c){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;d=new $Int64(0,0);e=$ifaceNil;if(c===0){c=32;}if(a.length===0){f=new $Int64(0,0);g=T("ParseInt",a);d=f;e=g;return[d,e];}h=a;i=false;if(a.charCodeAt(0)===43){a=a.substring(1);}else if(a.charCodeAt(0)===45){i=true;a=a.substring(1);}j=new $Uint64(0,0);k=V(a,b,c);j=k[0];e=k[1];if(!($interfaceIsEqual(e,$ifaceNil))&&!($interfaceIsEqual($assertType(e,CV).Err,$pkg.ErrRange))){$assertType(e,CV).Func="ParseInt";$assertType(e,CV).Num=h;l=new $Int64(0,0);m=e;d=l;e=m;return[d,e];}n=$shiftLeft64(new $Uint64(0,1),((c-1>>0)>>>0));if(!i&&(j.$high>n.$high||(j.$high===n.$high&&j.$low>=n.$low))){o=(p=new $Uint64(n.$high-0,n.$low-1),new $Int64(p.$high,p.$low));q=U("ParseInt",h);d=o;e=q;return[d,e];}if(i&&(j.$high>n.$high||(j.$high===n.$high&&j.$low>n.$low))){r=(s=new $Int64(n.$high,n.$low),new $Int64(-s.$high,-s.$low));t=U("ParseInt",h);d=r;e=t;return[d,e];}u=new $Int64(j.$high,j.$low);if(i){u=new $Int64(-u.$high,-u.$low);}v=u;w=$ifaceNil;d=v;e=w;return[d,e];};$pkg.ParseInt=W;Y.ptr.prototype.String=function(){var $ptr,a,b,c,d;a=this;b=10+a.nd>>0;if(a.dp>0){b=b+(a.dp)>>0;}if(a.dp<0){b=b+(-a.dp)>>0;}c=$makeSlice(CW,b);d=0;if((a.nd===0)){return"0";}else if(a.dp<=0){((d<0||d>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+d]=48);d=d+(1)>>0;((d<0||d>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+d]=46);d=d+(1)>>0;d=d+(Z($subslice(c,d,(d+-a.dp>>0))))>>0;d=d+($copySlice($subslice(c,d),$subslice(new CW(a.d),0,a.nd)))>>0;}else if(a.dp>0;((d<0||d>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+d]=46);d=d+(1)>>0;d=d+($copySlice($subslice(c,d),$subslice(new CW(a.d),a.dp,a.nd)))>>0;}else{d=d+($copySlice($subslice(c,d),$subslice(new CW(a.d),0,a.nd)))>>0;d=d+(Z($subslice(c,d,((d+a.dp>>0)-a.nd>>0))))>>0;}return $bytesToString($subslice(c,0,d));};Y.prototype.String=function(){return this.$val.String();};Z=function(a){var $ptr,a,b,c,d;b=a;c=0;while(true){if(!(c=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+d]=48);c++;}return a.$length;};AA=function(a){var $ptr,a,b,c;while(true){if(!(a.nd>0&&((b=a.d,c=a.nd-1>>0,((c<0||c>=b.length)?$throwRuntimeError("index out of range"):b[c]))===48))){break;}a.nd=a.nd-(1)>>0;}if(a.nd===0){a.dp=0;}};Y.ptr.prototype.Assign=function(a){var $ptr,a,b,c,d,e,f,g,h;b=this;c=CX.zero();d=0;while(true){if(!((a.$high>0||(a.$high===0&&a.$low>0)))){break;}e=$div64(a,new $Uint64(0,10),false);a=(f=$mul64(new $Uint64(0,10),e),new $Uint64(a.$high-f.$high,a.$low-f.$low));((d<0||d>=c.length)?$throwRuntimeError("index out of range"):c[d]=(new $Uint64(a.$high+0,a.$low+48).$low<<24>>>24));d=d+(1)>>0;a=e;}b.nd=0;d=d-(1)>>0;while(true){if(!(d>=0)){break;}(g=b.d,h=b.nd,((h<0||h>=g.length)?$throwRuntimeError("index out of range"):g[h]=((d<0||d>=c.length)?$throwRuntimeError("index out of range"):c[d])));b.nd=b.nd+(1)>>0;d=d-(1)>>0;}b.dp=b.nd;AA(b);};Y.prototype.Assign=function(a){return this.$val.Assign(a);};AB=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;c=0;d=0;e=0;while(true){if(!(((f=b,f<32?(e>>>f):0)>>>0)===0)){break;}if(c>=a.nd){if(e===0){a.nd=0;return;}while(true){if(!(((g=b,g<32?(e>>>g):0)>>>0)===0)){break;}e=e*10>>>0;c=c+(1)>>0;}break;}i=((h=a.d,((c<0||c>=h.length)?$throwRuntimeError("index out of range"):h[c]))>>>0);e=((e*10>>>0)+i>>>0)-48>>>0;c=c+(1)>>0;}a.dp=a.dp-((c-1>>0))>>0;while(true){if(!(c=j.length)?$throwRuntimeError("index out of range"):j[c]))>>>0);m=(l=b,l<32?(e>>>l):0)>>>0;e=e-(((n=b,n<32?(m<>>0))>>>0;(o=a.d,((d<0||d>=o.length)?$throwRuntimeError("index out of range"):o[d]=((m+48>>>0)<<24>>>24)));d=d+(1)>>0;e=((e*10>>>0)+k>>>0)-48>>>0;c=c+(1)>>0;}while(true){if(!(e>0)){break;}q=(p=b,p<32?(e>>>p):0)>>>0;e=e-(((r=b,r<32?(q<>>0))>>>0;if(d<800){(s=a.d,((d<0||d>=s.length)?$throwRuntimeError("index out of range"):s[d]=((q+48>>>0)<<24>>>24)));d=d+(1)>>0;}else if(q>0){a.trunc=true;}e=e*10>>>0;}a.nd=d;AA(a);};AE=function(a,b){var $ptr,a,b,c;c=0;while(true){if(!(c=a.$length){return true;}if(!((((c<0||c>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+c])===b.charCodeAt(c)))){return((c<0||c>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+c])>0;}return false;};AF=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;c=((b<0||b>=AD.$length)?$throwRuntimeError("index out of range"):AD.$array[AD.$offset+b]).delta;if(AE($subslice(new CW(a.d),0,a.nd),((b<0||b>=AD.$length)?$throwRuntimeError("index out of range"):AD.$array[AD.$offset+b]).cutoff)){c=c-(1)>>0;}d=a.nd;e=a.nd+c>>0;f=0;d=d-(1)>>0;while(true){if(!(d>=0)){break;}f=f+(((g=b,g<32?(((((h=a.d,((d<0||d>=h.length)?$throwRuntimeError("index out of range"):h[d]))>>>0)-48>>>0))<>>0))>>>0;j=(i=f/10,(i===i&&i!==1/0&&i!==-1/0)?i>>>0:$throwRuntimeError("integer divide by zero"));k=f-(10*j>>>0)>>>0;e=e-(1)>>0;if(e<800){(l=a.d,((e<0||e>=l.length)?$throwRuntimeError("index out of range"):l[e]=((k+48>>>0)<<24>>>24)));}else if(!((k===0))){a.trunc=true;}f=j;d=d-(1)>>0;}while(true){if(!(f>0)){break;}n=(m=f/10,(m===m&&m!==1/0&&m!==-1/0)?m>>>0:$throwRuntimeError("integer divide by zero"));o=f-(10*n>>>0)>>>0;e=e-(1)>>0;if(e<800){(p=a.d,((e<0||e>=p.length)?$throwRuntimeError("index out of range"):p[e]=((o+48>>>0)<<24>>>24)));}else if(!((o===0))){a.trunc=true;}f=n;}a.nd=a.nd+(c)>>0;if(a.nd>=800){a.nd=800;}a.dp=a.dp+(c)>>0;AA(a);};Y.ptr.prototype.Shift=function(a){var $ptr,a,b;b=this;if((b.nd===0)){}else if(a>0){while(true){if(!(a>28)){break;}AF(b,28);a=a-(28)>>0;}AF(b,(a>>>0));}else if(a<0){while(true){if(!(a<-28)){break;}AB(b,28);a=a+(28)>>0;}AB(b,(-a>>>0));}};Y.prototype.Shift=function(a){return this.$val.Shift(a);};AG=function(a,b){var $ptr,a,b,c,d,e,f,g;if(b<0||b>=a.nd){return false;}if(((c=a.d,((b<0||b>=c.length)?$throwRuntimeError("index out of range"):c[b]))===53)&&((b+1>>0)===a.nd)){if(a.trunc){return true;}return b>0&&!(((d=(((e=a.d,f=b-1>>0,((f<0||f>=e.length)?$throwRuntimeError("index out of range"):e[f]))-48<<24>>>24))%2,d===d?d:$throwRuntimeError("integer divide by zero"))===0));}return(g=a.d,((b<0||b>=g.length)?$throwRuntimeError("index out of range"):g[b]))>=53;};Y.ptr.prototype.Round=function(a){var $ptr,a,b;b=this;if(a<0||a>=b.nd){return;}if(AG(b,a)){b.RoundUp(a);}else{b.RoundDown(a);}};Y.prototype.Round=function(a){return this.$val.Round(a);};Y.ptr.prototype.RoundDown=function(a){var $ptr,a,b;b=this;if(a<0||a>=b.nd){return;}b.nd=a;AA(b);};Y.prototype.RoundDown=function(a){return this.$val.RoundDown(a);};Y.ptr.prototype.RoundUp=function(a){var $ptr,a,b,c,d,e,f,g;b=this;if(a<0||a>=b.nd){return;}c=a-1>>0;while(true){if(!(c>=0)){break;}e=(d=b.d,((c<0||c>=d.length)?$throwRuntimeError("index out of range"):d[c]));if(e<57){(g=b.d,((c<0||c>=g.length)?$throwRuntimeError("index out of range"):g[c]=((f=b.d,((c<0||c>=f.length)?$throwRuntimeError("index out of range"):f[c]))+(1)<<24>>>24)));b.nd=c+1>>0;return;}c=c-(1)>>0;}b.d[0]=49;b.nd=1;b.dp=b.dp+(1)>>0;};Y.prototype.RoundUp=function(a){return this.$val.RoundUp(a);};Y.ptr.prototype.RoundedInteger=function(){var $ptr,a,b,c,d,e,f,g;a=this;if(a.dp>20){return new $Uint64(4294967295,4294967295);}b=0;c=new $Uint64(0,0);b=0;while(true){if(!(b=f.length)?$throwRuntimeError("index out of range"):f[b]))-48<<24>>>24)),new $Uint64(d.$high+e.$high,d.$low+e.$low));b=b+(1)>>0;}while(true){if(!(b>0;}if(AG(a,a.dp)){c=(g=new $Uint64(0,1),new $Uint64(c.$high+g.$high,c.$low+g.$low));}return c;};Y.prototype.RoundedInteger=function(){return this.$val.RoundedInteger();};AH.ptr.prototype.floatBits=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;b=new $Uint64(0,0);c=false;d=this;d.Normalize();e=d.exp+63>>0;if(e<(a.bias+1>>0)){f=(a.bias+1>>0)-e>>0;d.mant=$shiftRightUint64(d.mant,((f>>>0)));e=e+(f)>>0;}g=$shiftRightUint64(d.mant,((63-a.mantbits>>>0)));if(!((h=(i=d.mant,j=$shiftLeft64(new $Uint64(0,1),((62-a.mantbits>>>0))),new $Uint64(i.$high&j.$high,(i.$low&j.$low)>>>0)),(h.$high===0&&h.$low===0)))){g=(k=new $Uint64(0,1),new $Uint64(g.$high+k.$high,g.$low+k.$low));}if((l=$shiftLeft64(new $Uint64(0,2),a.mantbits),(g.$high===l.$high&&g.$low===l.$low))){g=$shiftRightUint64(g,(1));e=e+(1)>>0;}if((e-a.bias>>0)>=(((m=a.expbits,m<32?(1<>0)-1>>0)){g=new $Uint64(0,0);e=(((p=a.expbits,p<32?(1<>0)-1>>0)+a.bias>>0;c=true;}else if((n=(o=$shiftLeft64(new $Uint64(0,1),a.mantbits),new $Uint64(g.$high&o.$high,(g.$low&o.$low)>>>0)),(n.$high===0&&n.$low===0))){e=a.bias;}b=(q=(r=$shiftLeft64(new $Uint64(0,1),a.mantbits),new $Uint64(r.$high-0,r.$low-1)),new $Uint64(g.$high&q.$high,(g.$low&q.$low)>>>0));b=(s=$shiftLeft64(new $Uint64(0,(((e-a.bias>>0))&((((t=a.expbits,t<32?(1<>0)-1>>0)))),a.mantbits),new $Uint64(b.$high|s.$high,(b.$low|s.$low)>>>0));if(d.neg){b=(u=$shiftLeft64(new $Uint64(0,1),((a.mantbits+a.expbits>>>0))),new $Uint64(b.$high|u.$high,(b.$low|u.$low)>>>0));}return[b,c];};AH.prototype.floatBits=function(a){return this.$val.floatBits(a);};AH.ptr.prototype.AssignComputeBounds=function(a,b,c,d){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;e=new AH.ptr(new $Uint64(0,0),0,false);f=new AH.ptr(new $Uint64(0,0),0,false);g=this;g.mant=a;g.exp=b-(d.mantbits>>0)>>0;g.neg=c;if(g.exp<=0&&(h=$shiftLeft64(($shiftRightUint64(a,(-g.exp>>>0))),(-g.exp>>>0)),(a.$high===h.$high&&a.$low===h.$low))){g.mant=$shiftRightUint64(g.mant,((-g.exp>>>0)));g.exp=0;i=$clone(g,AH);j=$clone(g,AH);AH.copy(e,i);AH.copy(f,j);return[e,f];}k=b-d.bias>>0;AH.copy(f,new AH.ptr((l=$mul64(new $Uint64(0,2),g.mant),new $Uint64(l.$high+0,l.$low+1)),g.exp-1>>0,g.neg));if(!((m=$shiftLeft64(new $Uint64(0,1),d.mantbits),(a.$high===m.$high&&a.$low===m.$low)))||(k===1)){AH.copy(e,new AH.ptr((n=$mul64(new $Uint64(0,2),g.mant),new $Uint64(n.$high-0,n.$low-1)),g.exp-1>>0,g.neg));}else{AH.copy(e,new AH.ptr((o=$mul64(new $Uint64(0,4),g.mant),new $Uint64(o.$high-0,o.$low-1)),g.exp-2>>0,g.neg));}return[e,f];};AH.prototype.AssignComputeBounds=function(a,b,c,d){return this.$val.AssignComputeBounds(a,b,c,d);};AH.ptr.prototype.Normalize=function(){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n;a=0;b=this;c=b.mant;d=b.exp;e=c;f=d;if((e.$high===0&&e.$low===0)){a=0;return a;}if((g=$shiftRightUint64(e,32),(g.$high===0&&g.$low===0))){e=$shiftLeft64(e,(32));f=f-(32)>>0;}if((h=$shiftRightUint64(e,48),(h.$high===0&&h.$low===0))){e=$shiftLeft64(e,(16));f=f-(16)>>0;}if((i=$shiftRightUint64(e,56),(i.$high===0&&i.$low===0))){e=$shiftLeft64(e,(8));f=f-(8)>>0;}if((j=$shiftRightUint64(e,60),(j.$high===0&&j.$low===0))){e=$shiftLeft64(e,(4));f=f-(4)>>0;}if((k=$shiftRightUint64(e,62),(k.$high===0&&k.$low===0))){e=$shiftLeft64(e,(2));f=f-(2)>>0;}if((l=$shiftRightUint64(e,63),(l.$high===0&&l.$low===0))){e=$shiftLeft64(e,(1));f=f-(1)>>0;}a=((b.exp-f>>0)>>>0);m=e;n=f;b.mant=m;b.exp=n;return a;};AH.prototype.Normalize=function(){return this.$val.Normalize();};AH.ptr.prototype.Multiply=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;a=$clone(a,AH);b=this;c=$shiftRightUint64(b.mant,32);d=new $Uint64(0,(b.mant.$low>>>0));e=c;f=d;g=$shiftRightUint64(a.mant,32);h=new $Uint64(0,(a.mant.$low>>>0));i=g;j=h;k=$mul64(e,j);l=$mul64(f,i);b.mant=(m=(n=$mul64(e,i),o=$shiftRightUint64(k,32),new $Uint64(n.$high+o.$high,n.$low+o.$low)),p=$shiftRightUint64(l,32),new $Uint64(m.$high+p.$high,m.$low+p.$low));u=(q=(r=new $Uint64(0,(k.$low>>>0)),s=new $Uint64(0,(l.$low>>>0)),new $Uint64(r.$high+s.$high,r.$low+s.$low)),t=$shiftRightUint64(($mul64(f,j)),32),new $Uint64(q.$high+t.$high,q.$low+t.$low));u=(v=new $Uint64(0,2147483648),new $Uint64(u.$high+v.$high,u.$low+v.$low));b.mant=(w=b.mant,x=($shiftRightUint64(u,32)),new $Uint64(w.$high+x.$high,w.$low+x.$low));b.exp=(b.exp+a.exp>>0)+64>>0;};AH.prototype.Multiply=function(a){return this.$val.Multiply(a);};AH.ptr.prototype.AssignDecimal=function(a,b,c,d,e){var $ptr,a,aa,ab,ac,ad,ae,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;f=false;g=this;h=0;if(d){h=h+(4)>>0;}g.mant=a;g.exp=0;g.neg=c;j=(i=((b- -348>>0))/8,(i===i&&i!==1/0&&i!==-1/0)?i>>0:$throwRuntimeError("integer divide by zero"));if(b<-348||j>=87){f=false;return f;}l=(k=((b- -348>>0))%8,k===k?k:$throwRuntimeError("integer divide by zero"));if(l<19&&(m=(n=19-l>>0,((n<0||n>=AK.length)?$throwRuntimeError("index out of range"):AK[n])),(a.$high=AK.length)?$throwRuntimeError("index out of range"):AK[l])));g.Normalize();}else{g.Normalize();g.Multiply(((l<0||l>=AI.length)?$throwRuntimeError("index out of range"):AI[l]));h=h+(4)>>0;}g.Multiply(((j<0||j>=AJ.length)?$throwRuntimeError("index out of range"):AJ[j]));if(h>0){h=h+(1)>>0;}h=h+(4)>>0;o=g.Normalize();h=(p=(o),p<32?(h<>0;q=e.bias-63>>0;r=0;if(g.exp<=q){r=(((63-e.mantbits>>>0)+1>>>0)+((q-g.exp>>0)>>>0)>>>0);}else{r=(63-e.mantbits>>>0);}s=$shiftLeft64(new $Uint64(0,1),((r-1>>>0)));w=(t=g.mant,u=(v=$shiftLeft64(new $Uint64(0,1),r),new $Uint64(v.$high-0,v.$low-1)),new $Uint64(t.$high&u.$high,(t.$low&u.$low)>>>0));if((x=(y=new $Int64(s.$high,s.$low),z=new $Int64(0,h),new $Int64(y.$high-z.$high,y.$low-z.$low)),aa=new $Int64(w.$high,w.$low),(x.$high>0)),28))/93,(d===d&&d!==1/0&&d!==-1/0)?d>>0:$throwRuntimeError("integer divide by zero"));g=(f=((e- -348>>0))/8,(f===f&&f!==1/0&&f!==-1/0)?f>>0:$throwRuntimeError("integer divide by zero"));Loop:while(true){h=(c.exp+((g<0||g>=AJ.length)?$throwRuntimeError("index out of range"):AJ[g]).exp>>0)+64>>0;if(h<-60){g=g+(1)>>0;}else if(h>-32){g=g-(1)>>0;}else{break Loop;}}c.Multiply(((g<0||g>=AJ.length)?$throwRuntimeError("index out of range"):AJ[g]));i=-((-348+($imul(g,8))>>0));j=g;a=i;b=j;return[a,b];};AH.prototype.frexp10=function(){return this.$val.frexp10();};AL=function(a,b,c){var $ptr,a,b,c,d,e,f;d=0;e=c.frexp10();d=e[0];f=e[1];a.Multiply(((f<0||f>=AJ.length)?$throwRuntimeError("index out of range"):AJ[f]));b.Multiply(((f<0||f>=AJ.length)?$throwRuntimeError("index out of range"):AJ[f]));return d;};AH.ptr.prototype.FixedDecimal=function(a,b){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;c=this;if((d=c.mant,(d.$high===0&&d.$low===0))){a.nd=0;a.dp=0;a.neg=c.neg;return true;}if(b===0){$panic(new $String("strconv: internal error: extFloat.FixedDecimal called with n == 0"));}c.Normalize();e=c.frexp10();f=e[0];g=(-c.exp>>>0);h=($shiftRightUint64(c.mant,g).$low>>>0);k=(i=c.mant,j=$shiftLeft64(new $Uint64(0,h),g),new $Uint64(i.$high-j.$high,i.$low-j.$low));l=new $Uint64(0,1);m=b;n=0;o=new $Uint64(0,1);p=0;q=new $Uint64(0,1);r=p;s=q;while(true){if(!(r<20)){break;}if((t=new $Uint64(0,h),(s.$high>t.$high||(s.$high===t.$high&&s.$low>t.$low)))){n=r;break;}s=$mul64(s,(new $Uint64(0,10)));r=r+(1)>>0;}u=h;if(n>m){o=(v=n-m>>0,((v<0||v>=AK.length)?$throwRuntimeError("index out of range"):AK[v]));h=(w=h/((o.$low>>>0)),(w===w&&w!==1/0&&w!==-1/0)?w>>>0:$throwRuntimeError("integer divide by zero"));u=u-(($imul(h,(o.$low>>>0))>>>0))>>>0;}else{u=0;}x=CY.zero();y=32;z=h;while(true){if(!(z>0)){break;}ab=(aa=z/10,(aa===aa&&aa!==1/0&&aa!==-1/0)?aa>>>0:$throwRuntimeError("integer divide by zero"));z=z-(($imul(10,ab)>>>0))>>>0;y=y-(1)>>0;((y<0||y>=x.length)?$throwRuntimeError("index out of range"):x[y]=((z+48>>>0)<<24>>>24));z=ab;}ac=y;while(true){if(!(ac<32)){break;}(ad=a.d,ae=ac-y>>0,((ae<0||ae>=ad.$length)?$throwRuntimeError("index out of range"):ad.$array[ad.$offset+ae]=((ac<0||ac>=x.length)?$throwRuntimeError("index out of range"):x[ac])));ac=ac+(1)>>0;}af=32-y>>0;a.nd=af;a.dp=n+f>>0;m=m-(af)>>0;if(m>0){if(!((u===0))||!((o.$high===0&&o.$low===1))){$panic(new $String("strconv: internal error, rest != 0 but needed > 0"));}while(true){if(!(m>0)){break;}k=$mul64(k,(new $Uint64(0,10)));l=$mul64(l,(new $Uint64(0,10)));if((ag=$mul64(new $Uint64(0,2),l),ah=$shiftLeft64(new $Uint64(0,1),g),(ag.$high>ah.$high||(ag.$high===ah.$high&&ag.$low>ah.$low)))){return false;}ai=$shiftRightUint64(k,g);(aj=a.d,((af<0||af>=aj.$length)?$throwRuntimeError("index out of range"):aj.$array[aj.$offset+af]=(new $Uint64(ai.$high+0,ai.$low+48).$low<<24>>>24)));k=(ak=$shiftLeft64(ai,g),new $Uint64(k.$high-ak.$high,k.$low-ak.$low));af=af+(1)>>0;m=m-(1)>>0;}a.nd=af;}am=AM(a,(al=$shiftLeft64(new $Uint64(0,u),g),new $Uint64(al.$high|k.$high,(al.$low|k.$low)>>>0)),o,g,l);if(!am){return false;}an=a.nd-1>>0;while(true){if(!(an>=0)){break;}if(!(((ao=a.d,((an<0||an>=ao.$length)?$throwRuntimeError("index out of range"):ao.$array[ao.$offset+an]))===48))){a.nd=an+1>>0;break;}an=an-(1)>>0;}return true;};AH.prototype.FixedDecimal=function(a,b){return this.$val.FixedDecimal(a,b);};AM=function(a,b,c,d,e){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;if((f=$shiftLeft64(c,d),(b.$high>f.$high||(b.$high===f.$high&&b.$low>f.$low)))){$panic(new $String("strconv: num > den<h.$high||(g.$high===h.$high&&g.$low>h.$low)))){$panic(new $String("strconv: \xCE\xB5 > (den<l.$high||(k.$high===l.$high&&k.$low>l.$low)))){m=a.nd-1>>0;while(true){if(!(m>=0)){break;}if((n=a.d,((m<0||m>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+m]))===57){a.nd=a.nd-(1)>>0;}else{break;}m=m-(1)>>0;}if(m<0){(o=a.d,(0>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0]=49));a.nd=1;a.dp=a.dp+(1)>>0;}else{(q=a.d,((m<0||m>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+m]=((p=a.d,((m<0||m>=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+m]))+(1)<<24>>>24)));}return true;}return false;};AH.ptr.prototype.ShortestDecimal=function(a,b,c){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;d=this;if((e=d.mant,(e.$high===0&&e.$low===0))){a.nd=0;a.dp=0;a.neg=d.neg;return true;}if((d.exp===0)&&$equal(b,d,AH)&&$equal(b,c,AH)){f=CX.zero();g=23;h=d.mant;while(true){if(!((h.$high>0||(h.$high===0&&h.$low>0)))){break;}i=$div64(h,new $Uint64(0,10),false);h=(j=$mul64(new $Uint64(0,10),i),new $Uint64(h.$high-j.$high,h.$low-j.$low));((g<0||g>=f.length)?$throwRuntimeError("index out of range"):f[g]=(new $Uint64(h.$high+0,h.$low+48).$low<<24>>>24));g=g-(1)>>0;h=i;}k=(24-g>>0)-1>>0;l=0;while(true){if(!(l=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+l]=(m=(g+1>>0)+l>>0,((m<0||m>=f.length)?$throwRuntimeError("index out of range"):f[m]))));l=l+(1)>>0;}o=k;p=k;a.nd=o;a.dp=p;while(true){if(!(a.nd>0&&((q=a.d,r=a.nd-1>>0,((r<0||r>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+r]))===48))){break;}a.nd=a.nd-(1)>>0;}if(a.nd===0){a.dp=0;}a.neg=d.neg;return true;}c.Normalize();if(d.exp>c.exp){d.mant=$shiftLeft64(d.mant,(((d.exp-c.exp>>0)>>>0)));d.exp=c.exp;}if(b.exp>c.exp){b.mant=$shiftLeft64(b.mant,(((b.exp-c.exp>>0)>>>0)));b.exp=c.exp;}s=AL(b,d,c);c.mant=(t=c.mant,u=new $Uint64(0,1),new $Uint64(t.$high+u.$high,t.$low+u.$low));b.mant=(v=b.mant,w=new $Uint64(0,1),new $Uint64(v.$high-w.$high,v.$low-w.$low));x=(-c.exp>>>0);y=($shiftRightUint64(c.mant,x).$low>>>0);ab=(z=c.mant,aa=$shiftLeft64(new $Uint64(0,y),x),new $Uint64(z.$high-aa.$high,z.$low-aa.$low));ae=(ac=c.mant,ad=b.mant,new $Uint64(ac.$high-ad.$high,ac.$low-ad.$low));ah=(af=c.mant,ag=d.mant,new $Uint64(af.$high-ag.$high,af.$low-ag.$low));ai=0;aj=0;ak=new $Uint64(0,1);al=aj;am=ak;while(true){if(!(al<20)){break;}if((an=new $Uint64(0,y),(am.$high>an.$high||(am.$high===an.$high&&am.$low>an.$low)))){ai=al;break;}am=$mul64(am,(new $Uint64(0,10)));al=al+(1)>>0;}ao=0;while(true){if(!(ao>0)-1>>0,((ap<0||ap>=AK.length)?$throwRuntimeError("index out of range"):AK[ap]));as=(ar=y/(aq.$low>>>0),(ar===ar&&ar!==1/0&&ar!==-1/0)?ar>>>0:$throwRuntimeError("integer divide by zero"));(at=a.d,((ao<0||ao>=at.$length)?$throwRuntimeError("index out of range"):at.$array[at.$offset+ao]=((as+48>>>0)<<24>>>24)));y=y-(($imul(as,(aq.$low>>>0))>>>0))>>>0;av=(au=$shiftLeft64(new $Uint64(0,y),x),new $Uint64(au.$high+ab.$high,au.$low+ab.$low));if((av.$high>0;a.dp=ai+s>>0;a.neg=d.neg;return AN(a,av,ah,ae,$shiftLeft64(aq,x),new $Uint64(0,2));}ao=ao+(1)>>0;}a.nd=ai;a.dp=a.nd+s>>0;a.neg=d.neg;aw=0;ax=new $Uint64(0,1);while(true){ab=$mul64(ab,(new $Uint64(0,10)));ax=$mul64(ax,(new $Uint64(0,10)));aw=($shiftRightUint64(ab,x).$low>>0);(ay=a.d,az=a.nd,((az<0||az>=ay.$length)?$throwRuntimeError("index out of range"):ay.$array[ay.$offset+az]=((aw+48>>0)<<24>>>24)));a.nd=a.nd+(1)>>0;ab=(ba=$shiftLeft64(new $Uint64(0,aw),x),new $Uint64(ab.$high-ba.$high,ab.$low-ba.$low));if((bb=$mul64(ae,ax),(ab.$high>0;(m=a.d,((k<0||k>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+k]=((l=a.d,((k<0||k>=l.$length)?$throwRuntimeError("index out of range"):l.$array[l.$offset+k]))-(1)<<24>>>24)));b=(n=e,new $Uint64(b.$high+n.$high,b.$low+n.$low));}if((o=new $Uint64(b.$high+e.$high,b.$low+e.$low),p=(q=(r=$div64(e,new $Uint64(0,2),false),new $Uint64(c.$high+r.$high,c.$low+r.$low)),new $Uint64(q.$high+f.$high,q.$low+f.$low)),(o.$highs.$high||(b.$high===s.$high&&b.$low>s.$low)))){return false;}if((a.nd===1)&&((t=a.d,(0>=t.$length?$throwRuntimeError("index out of range"):t.$array[t.$offset+0]))===48)){a.nd=0;a.dp=0;}return true;};AR=function(a,b,c,d){var $ptr,a,b,c,d;return $bytesToString(AT($makeSlice(CW,0,BC(c+4>>0,24)),a,b,c,d));};$pkg.FormatFloat=AR;AS=function(a,b,c,d,e){var $ptr,a,b,c,d,e;return AT(a,b,c,d,e);};$pkg.AppendFloat=AS;AT=function(a,b,c,d,e){var $ptr,a,aa,ab,ac,ad,ae,af,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;f=new $Uint64(0,0);g=CZ.nil;h=e;if(h===(32)){f=new $Uint64(0,A.Float32bits($fround(b)));g=AP;}else if(h===(64)){f=A.Float64bits(b);g=AQ;}else{$panic(new $String("strconv: illegal AppendFloat/FormatFloat bitSize"));}j=!((i=$shiftRightUint64(f,((g.expbits+g.mantbits>>>0))),(i.$high===0&&i.$low===0)));l=($shiftRightUint64(f,g.mantbits).$low>>0)&((((k=g.expbits,k<32?(1<>0)-1>>0));o=(m=(n=$shiftLeft64(new $Uint64(0,1),g.mantbits),new $Uint64(n.$high-0,n.$low-1)),new $Uint64(f.$high&m.$high,(f.$low&m.$low)>>>0));p=l;if(p===((((q=g.expbits,q<32?(1<>0)-1>>0))){r="";if(!((o.$high===0&&o.$low===0))){r="NaN";}else if(j){r="-Inf";}else{r="+Inf";}return $appendSlice(a,r);}else if(p===(0)){l=l+(1)>>0;}else{o=(s=$shiftLeft64(new $Uint64(0,1),g.mantbits),new $Uint64(o.$high|s.$high,(o.$low|s.$low)>>>0));}l=l+(g.bias)>>0;if(c===98){return BA(a,j,o,l,g);}if(!G){return AU(a,d,c,j,o,l,g);}t=new AX.ptr(CW.nil,0,0,false);u=false;v=d<0;if(v){w=new AH.ptr(new $Uint64(0,0),0,false);x=w.AssignComputeBounds(o,l,j,g);y=$clone(x[0],AH);z=$clone(x[1],AH);aa=CY.zero();t.d=new CW(aa);u=w.ShortestDecimal(t,y,z);if(!u){return AU(a,d,c,j,o,l,g);}ab=c;if((ab===(101))||(ab===(69))){d=BC(t.nd-1>>0,0);}else if(ab===(102)){d=BC(t.nd-t.dp>>0,0);}else if((ab===(103))||(ab===(71))){d=t.nd;}}else if(!((c===102))){ac=d;ad=c;if((ad===(101))||(ad===(69))){ac=ac+(1)>>0;}else if((ad===(103))||(ad===(71))){if(d===0){d=1;}ac=d;}if(ac<=15){ae=CX.zero();t.d=new CW(ae);af=new AH.ptr(o,l-(g.mantbits>>0)>>0,j);u=af.FixedDecimal(t,ac);}}if(!u){return AU(a,d,c,j,o,l,g);}return AV(a,v,j,t,d,c);};AU=function(a,b,c,d,e,f,g){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l;h=new Y.ptr(CU.zero(),0,0,false,false);h.Assign(e);h.Shift(f-(g.mantbits>>0)>>0);i=new AX.ptr(CW.nil,0,0,false);j=b<0;if(j){AW(h,e,f,g);AX.copy(i,new AX.ptr(new CW(h.d),h.nd,h.dp,false));k=c;if((k===(101))||(k===(69))){b=i.nd-1>>0;}else if(k===(102)){b=BC(i.nd-i.dp>>0,0);}else if((k===(103))||(k===(71))){b=i.nd;}}else{l=c;if((l===(101))||(l===(69))){h.Round(b+1>>0);}else if(l===(102)){h.Round(h.dp+b>>0);}else if((l===(103))||(l===(71))){if(b===0){b=1;}h.Round(b);}AX.copy(i,new AX.ptr(new CW(h.d),h.nd,h.dp,false));}return AV(a,j,d,i,b,c);};AV=function(a,b,c,d,e,f){var $ptr,a,b,c,d,e,f,g,h,i;d=$clone(d,AX);g=f;if((g===(101))||(g===(69))){return AY(a,c,d,e,f);}else if(g===(102)){return AZ(a,c,d,e);}else if((g===(103))||(g===(71))){h=e;if(h>d.nd&&d.nd>=d.dp){h=d.nd;}if(b){h=6;}i=d.dp-1>>0;if(i<-4||i>=h){if(e>d.nd){e=d.nd;}return AY(a,c,d,e-1>>0,(f+101<<24>>>24)-103<<24>>>24);}if(e>d.dp){e=d.nd;}return AZ(a,c,d,BC(e-d.dp>>0,0));}return $append(a,37,f);};AW=function(a,b,c,d){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;if((b.$high===0&&b.$low===0)){a.nd=0;return;}e=d.bias+1>>0;if(c>e&&($imul(332,((a.dp-a.nd>>0))))>=($imul(100,((c-(d.mantbits>>0)>>0))))){return;}f=new Y.ptr(CU.zero(),0,0,false,false);f.Assign((g=$mul64(b,new $Uint64(0,2)),new $Uint64(g.$high+0,g.$low+1)));f.Shift((c-(d.mantbits>>0)>>0)-1>>0);h=new $Uint64(0,0);i=0;if((j=$shiftLeft64(new $Uint64(0,1),d.mantbits),(b.$high>j.$high||(b.$high===j.$high&&b.$low>j.$low)))||(c===e)){h=new $Uint64(b.$high-0,b.$low-1);i=c;}else{h=(k=$mul64(b,new $Uint64(0,2)),new $Uint64(k.$high-0,k.$low-1));i=c-1>>0;}l=new Y.ptr(CU.zero(),0,0,false,false);l.Assign((m=$mul64(h,new $Uint64(0,2)),new $Uint64(m.$high+0,m.$low+1)));l.Shift((i-(d.mantbits>>0)>>0)-1>>0);o=(n=$div64(b,new $Uint64(0,2),true),(n.$high===0&&n.$low===0));p=0;while(true){if(!(p=r.length)?$throwRuntimeError("index out of range"):r[p]));}t=(s=a.d,((p<0||p>=s.length)?$throwRuntimeError("index out of range"):s[p]));u=48;if(p=v.length)?$throwRuntimeError("index out of range"):v[p]));}w=!((q===t))||o&&((p+1>>0)===l.nd);x=!((t===u))&&(o||(t+1<<24>>>24)>0)>0);return;}else if(w){a.RoundDown(p+1>>0);return;}else if(x){a.RoundUp(p+1>>0);return;}p=p+(1)>>0;}};AY=function(a,b,c,d,e){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;c=$clone(c,AX);if(b){a=$append(a,45);}f=48;if(!((c.nd===0))){f=(g=c.d,(0>=g.$length?$throwRuntimeError("index out of range"):g.$array[g.$offset+0]));}a=$append(a,f);if(d>0){a=$append(a,46);h=1;i=BB(c.nd,d+1>>0);if(h>0;}}a=$append(a,e);j=c.dp-1>>0;if(c.nd===0){j=0;}if(j<0){f=45;j=-j;}else{f=43;}a=$append(a,f);if(j<10){a=$append(a,48,(j<<24>>>24)+48<<24>>>24);}else if(j<100){a=$append(a,((k=j/10,(k===k&&k!==1/0&&k!==-1/0)?k>>0:$throwRuntimeError("integer divide by zero"))<<24>>>24)+48<<24>>>24,((l=j%10,l===l?l:$throwRuntimeError("integer divide by zero"))<<24>>>24)+48<<24>>>24);}else{a=$append(a,((m=j/100,(m===m&&m!==1/0&&m!==-1/0)?m>>0:$throwRuntimeError("integer divide by zero"))<<24>>>24)+48<<24>>>24,(n=((o=j/10,(o===o&&o!==1/0&&o!==-1/0)?o>>0:$throwRuntimeError("integer divide by zero"))<<24>>>24)%10,n===n?n:$throwRuntimeError("integer divide by zero"))+48<<24>>>24,((p=j%10,p===p?p:$throwRuntimeError("integer divide by zero"))<<24>>>24)+48<<24>>>24);}return a;};AZ=function(a,b,c,d){var $ptr,a,b,c,d,e,f,g,h,i;c=$clone(c,AX);if(b){a=$append(a,45);}if(c.dp>0){e=BB(c.nd,c.dp);a=$appendSlice(a,$subslice(c.d,0,e));while(true){if(!(e>0;}}else{a=$append(a,48);}if(d>0){a=$append(a,46);f=0;while(true){if(!(f>0;if(0<=h&&h=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+h]));}a=$append(a,g);f=f+(1)>>0;}}return a;};BA=function(a,b,c,d,e){var $ptr,a,b,c,d,e,f,g;if(b){a=$append(a,45);}f=BO(a,c,10,false,true);a=f[0];a=$append(a,112);d=d-((e.mantbits>>0))>>0;if(d>=0){a=$append(a,43);}g=BO(a,new $Uint64(0,d),10,d<0,true);a=g[0];return a;};BB=function(a,b){var $ptr,a,b;if(ab){return a;}return b;};BJ=function(a,b){var $ptr,a,b,c,d;c=BO(CW.nil,new $Uint64(a.$high,a.$low),b,(a.$high<0||(a.$high===0&&a.$low<0)),false);d=c[1];return d;};$pkg.FormatInt=BJ;BK=function(a){var $ptr,a;return BJ(new $Int64(0,a),10);};$pkg.Itoa=BK;BL=function(a,b,c){var $ptr,a,b,c,d;d=BO(a,new $Uint64(b.$high,b.$low),c,(b.$high<0||(b.$high===0&&b.$low<0)),true);a=d[0];return a;};$pkg.AppendInt=BL;BM=function(a,b,c){var $ptr,a,b,c,d;d=BO(a,b,c,false,true);a=d[0];return a;};$pkg.AppendUint=BM;BO=function(a,b,c,d,e){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;f=CW.nil;g="";if(c<2||c>36){$panic(new $String("strconv: illegal AppendInt/FormatInt base"));}h=DA.zero();i=65;if(d){b=new $Uint64(-b.$high,-b.$low);}if(c===10){if(true){while(true){if(!((b.$high>0||(b.$high===0&&b.$low>4294967295)))){break;}j=$div64(b,new $Uint64(0,1000000000),false);l=((k=$mul64(j,new $Uint64(0,1000000000)),new $Uint64(b.$high-k.$high,b.$low-k.$low)).$low>>>0);m=9;while(true){if(!(m>0)){break;}i=i-(1)>>0;o=(n=l/10,(n===n&&n!==1/0&&n!==-1/0)?n>>>0:$throwRuntimeError("integer divide by zero"));((i<0||i>=h.length)?$throwRuntimeError("index out of range"):h[i]=(((l-($imul(o,10)>>>0)>>>0)+48>>>0)<<24>>>24));l=o;m=m-(1)>>0;}b=j;}}p=(b.$low>>>0);while(true){if(!(p>=10)){break;}i=i-(1)>>0;r=(q=p/10,(q===q&&q!==1/0&&q!==-1/0)?q>>>0:$throwRuntimeError("integer divide by zero"));((i<0||i>=h.length)?$throwRuntimeError("index out of range"):h[i]=(((p-($imul(r,10)>>>0)>>>0)+48>>>0)<<24>>>24));p=r;}i=i-(1)>>0;((i<0||i>=h.length)?$throwRuntimeError("index out of range"):h[i]=((p+48>>>0)<<24>>>24));}else{s=((c<0||c>=BN.length)?$throwRuntimeError("index out of range"):BN[c]);if(s>0){t=new $Uint64(0,c);u=(t.$low>>>0)-1>>>0;while(true){if(!((b.$high>t.$high||(b.$high===t.$high&&b.$low>=t.$low)))){break;}i=i-(1)>>0;((i<0||i>=h.length)?$throwRuntimeError("index out of range"):h[i]="0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((((b.$low>>>0)&u)>>>0)));b=$shiftRightUint64(b,(s));}i=i-(1)>>0;((i<0||i>=h.length)?$throwRuntimeError("index out of range"):h[i]="0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((b.$low>>>0)));}else{v=new $Uint64(0,c);while(true){if(!((b.$high>v.$high||(b.$high===v.$high&&b.$low>=v.$low)))){break;}i=i-(1)>>0;w=$div64(b,v,false);((i<0||i>=h.length)?$throwRuntimeError("index out of range"):h[i]="0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((x=$mul64(w,v),new $Uint64(b.$high-x.$high,b.$low-x.$low)).$low>>>0)));b=w;}i=i-(1)>>0;((i<0||i>=h.length)?$throwRuntimeError("index out of range"):h[i]="0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((b.$low>>>0)));}}if(d){i=i-(1)>>0;((i<0||i>=h.length)?$throwRuntimeError("index out of range"):h[i]=45);}if(e){f=$appendSlice(a,$subslice(new CW(h),i));return[f,g];}g=$bytesToString($subslice(new CW(h),i));return[f,g];};BP=function(a,b,c,d){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n;e=DB.zero();g=$makeSlice(CW,0,(f=($imul(3,a.length))/2,(f===f&&f!==1/0&&f!==-1/0)?f>>0:$throwRuntimeError("integer divide by zero")));g=$append(g,b);h=0;while(true){if(!(a.length>0)){break;}i=(a.charCodeAt(0)>>0);h=1;if(i>=128){j=C.DecodeRuneInString(a);i=j[0];h=j[1];}if((h===1)&&(i===65533)){g=$appendSlice(g,"\\x");g=$append(g,"0123456789abcdef".charCodeAt((a.charCodeAt(0)>>>4<<24>>>24)));g=$append(g,"0123456789abcdef".charCodeAt(((a.charCodeAt(0)&15)>>>0)));a=a.substring(h);continue;}if((i===(b>>0))||(i===92)){g=$append(g,92);g=$append(g,(i<<24>>>24));a=a.substring(h);continue;}if(c){if(i<128&&CJ(i)){g=$append(g,(i<<24>>>24));a=a.substring(h);continue;}}else if(CJ(i)||d&&CL(i)){k=C.EncodeRune(new CW(e),i);g=$appendSlice(g,$subslice(new CW(e),0,k));a=a.substring(h);continue;}l=i;if(l===(7)){g=$appendSlice(g,"\\a");}else if(l===(8)){g=$appendSlice(g,"\\b");}else if(l===(12)){g=$appendSlice(g,"\\f");}else if(l===(10)){g=$appendSlice(g,"\\n");}else if(l===(13)){g=$appendSlice(g,"\\r");}else if(l===(9)){g=$appendSlice(g,"\\t");}else if(l===(11)){g=$appendSlice(g,"\\v");}else{if(i<32){g=$appendSlice(g,"\\x");g=$append(g,"0123456789abcdef".charCodeAt((a.charCodeAt(0)>>>4<<24>>>24)));g=$append(g,"0123456789abcdef".charCodeAt(((a.charCodeAt(0)&15)>>>0)));}else if(i>1114111){i=65533;g=$appendSlice(g,"\\u");m=12;while(true){if(!(m>=0)){break;}g=$append(g,"0123456789abcdef".charCodeAt((((i>>$min((m>>>0),31))>>0)&15)));m=m-(4)>>0;}}else if(i<65536){g=$appendSlice(g,"\\u");m=12;while(true){if(!(m>=0)){break;}g=$append(g,"0123456789abcdef".charCodeAt((((i>>$min((m>>>0),31))>>0)&15)));m=m-(4)>>0;}}else{g=$appendSlice(g,"\\U");n=28;while(true){if(!(n>=0)){break;}g=$append(g,"0123456789abcdef".charCodeAt((((i>>$min((n>>>0),31))>>0)&15)));n=n-(4)>>0;}}}a=a.substring(h);}g=$append(g,b);return $bytesToString(g);};BQ=function(a){var $ptr,a;return BP(a,34,false,false);};$pkg.Quote=BQ;BS=function(a){var $ptr,a;return BP(a,34,true,false);};$pkg.QuoteToASCII=BS;BW=function(a){var $ptr,a;return BP($encodeRune(a),39,false,false);};$pkg.QuoteRune=BW;BX=function(a,b){var $ptr,a,b;return $appendSlice(a,BW(b));};$pkg.AppendQuoteRune=BX;BY=function(a){var $ptr,a;return BP($encodeRune(a),39,true,false);};$pkg.QuoteRuneToASCII=BY;BZ=function(a,b){var $ptr,a,b;return $appendSlice(a,BY(b));};$pkg.AppendQuoteRuneToASCII=BZ;CC=function(a){var $ptr,a,b,c,d;while(true){if(!(a.length>0)){break;}b=C.DecodeRuneInString(a);c=b[0];d=b[1];a=a.substring(d);if(d>1){if(c===65279){return false;}continue;}if(c===65533){return false;}if((c<32&&!((c===9)))||(c===96)||(c===127)){return false;}}return true;};$pkg.CanBackquote=CC;CD=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j;b=0;c=false;d=(a>>0);if(48<=d&&d<=57){e=d-48>>0;f=true;b=e;c=f;return[b,c];}else if(97<=d&&d<=102){g=(d-97>>0)+10>>0;h=true;b=g;c=h;return[b,c];}else if(65<=d&&d<=70){i=(d-65>>0)+10>>0;j=true;b=i;c=j;return[b,c];}return[b,c];};CE=function(a,b){var $ptr,a,aa,ab,ac,ad,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;c=0;d=false;e="";f=$ifaceNil;g=a.charCodeAt(0);if((g===b)&&((b===39)||(b===34))){f=$pkg.ErrSyntax;return[c,d,e,f];}else if(g>=128){h=C.DecodeRuneInString(a);i=h[0];j=h[1];k=i;l=true;m=a.substring(j);n=$ifaceNil;c=k;d=l;e=m;f=n;return[c,d,e,f];}else if(!((g===92))){o=(a.charCodeAt(0)>>0);p=false;q=a.substring(1);r=$ifaceNil;c=o;d=p;e=q;f=r;return[c,d,e,f];}if(a.length<=1){f=$pkg.ErrSyntax;return[c,d,e,f];}s=a.charCodeAt(1);a=a.substring(2);switch(0){default:t=s;if(t===(97)){c=7;}else if(t===(98)){c=8;}else if(t===(102)){c=12;}else if(t===(110)){c=10;}else if(t===(114)){c=13;}else if(t===(116)){c=9;}else if(t===(118)){c=11;}else if((t===(120))||(t===(117))||(t===(85))){u=0;v=s;if(v===(120)){u=2;}else if(v===(117)){u=4;}else if(v===(85)){u=8;}w=0;if(a.length>0)|z;x=x+(1)>>0;}a=a.substring(u);if(s===120){c=w;break;}if(w>1114111){f=$pkg.ErrSyntax;return[c,d,e,f];}c=w;d=true;}else if((t===(48))||(t===(49))||(t===(50))||(t===(51))||(t===(52))||(t===(53))||(t===(54))||(t===(55))){ab=(s>>0)-48>>0;if(a.length<2){f=$pkg.ErrSyntax;return[c,d,e,f];}ac=0;while(true){if(!(ac<2)){break;}ad=(a.charCodeAt(ac)>>0)-48>>0;if(ad<0||ad>7){f=$pkg.ErrSyntax;return[c,d,e,f];}ab=((ab<<3>>0))|ad;ac=ac+(1)>>0;}a=a.substring(2);if(ab>255){f=$pkg.ErrSyntax;return[c,d,e,f];}c=ab;}else if(t===(92)){c=92;}else if((t===(39))||(t===(34))){if(!((s===b))){f=$pkg.ErrSyntax;return[c,d,e,f];}c=(s>>0);}else{f=$pkg.ErrSyntax;return[c,d,e,f];}}e=a;return[c,d,e,f];};$pkg.UnquoteChar=CE;CF=function(a){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b="";c=$ifaceNil;d=a.length;if(d<2){e="";f=$pkg.ErrSyntax;b=e;c=f;return[b,c];}g=a.charCodeAt(0);if(!((g===a.charCodeAt((d-1>>0))))){h="";i=$pkg.ErrSyntax;b=h;c=i;return[b,c];}a=a.substring(1,(d-1>>0));if(g===96){if(CG(a,96)){j="";k=$pkg.ErrSyntax;b=j;c=k;return[b,c];}l=a;m=$ifaceNil;b=l;c=m;return[b,c];}if(!((g===34))&&!((g===39))){n="";o=$pkg.ErrSyntax;b=n;c=o;return[b,c];}if(CG(a,10)){p="";q=$pkg.ErrSyntax;b=p;c=q;return[b,c];}if(!CG(a,92)&&!CG(a,g)){r=g;if(r===(34)){s=a;t=$ifaceNil;b=s;c=t;return[b,c];}else if(r===(39)){u=C.DecodeRuneInString(a);v=u[0];w=u[1];if((w===a.length)&&(!((v===65533))||!((w===1)))){x=a;y=$ifaceNil;b=x;c=y;return[b,c];}}}z=DB.zero();ab=$makeSlice(CW,0,(aa=($imul(3,a.length))/2,(aa===aa&&aa!==1/0&&aa!==-1/0)?aa>>0:$throwRuntimeError("integer divide by zero")));while(true){if(!(a.length>0)){break;}ac=CE(a,g);ad=ac[0];ae=ac[1];af=ac[2];ag=ac[3];if(!($interfaceIsEqual(ag,$ifaceNil))){ah="";ai=ag;b=ah;c=ai;return[b,c];}a=af;if(ad<128||!ae){ab=$append(ab,(ad<<24>>>24));}else{aj=C.EncodeRune(new CW(z),ad);ab=$appendSlice(ab,$subslice(new CW(z),0,aj));}if((g===39)&&!((a.length===0))){ak="";al=$pkg.ErrSyntax;b=ak;c=al;return[b,c];}}am=$bytesToString(ab);an=$ifaceNil;b=am;c=an;return[b,c];};$pkg.Unquote=CF;CG=function(a,b){var $ptr,a,b,c;c=0;while(true){if(!(c>0;}return false;};CH=function(a,b){var $ptr,a,b,c,d,e,f,g,h;c=0;d=a.$length;e=c;f=d;while(true){if(!(e>0))/2,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero"))>>0;if(((h<0||h>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+h])>0;}else{f=h;}}return e;};CI=function(a,b){var $ptr,a,b,c,d,e,f,g,h;c=0;d=a.$length;e=c;f=d;while(true){if(!(e>0))/2,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero"))>>0;if(((h<0||h>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+h])>0;}else{f=h;}}return e;};CJ=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;if(a<=255){if(32<=a&&a<=126){return true;}if(161<=a&&a<=255){return!((a===173));}return false;}if(0<=a&&a<65536){b=(a<<16>>>16);c=BD;d=BE;e=b;f=c;g=d;h=CH(f,e);if(h>=f.$length||e<(i=(h&~1)>>0,((i<0||i>=f.$length)?$throwRuntimeError("index out of range"):f.$array[f.$offset+i]))||(j=h|1,((j<0||j>=f.$length)?$throwRuntimeError("index out of range"):f.$array[f.$offset+j]))=g.$length||!((((k<0||k>=g.$length)?$throwRuntimeError("index out of range"):g.$array[g.$offset+k])===e));}l=(a>>>0);m=BF;n=BG;o=l;p=m;q=n;r=CI(p,o);if(r>=p.$length||o<(s=(r&~1)>>0,((s<0||s>=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+s]))||(t=r|1,((t<0||t>=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+t]))=131072){return true;}a=a-(65536)>>0;u=CH(q,(a<<16>>>16));return u>=q.$length||!((((u<0||u>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+u])===(a<<16>>>16)));};$pkg.IsPrint=CJ;CL=function(a){var $ptr,a,b,c;if(a>65535){return false;}b=(a<<16>>>16);c=CH(BH,b);return c=BH.$length)?$throwRuntimeError("index out of range"):BH.$array[BH.$offset+c]));};CV.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];DC.methods=[{prop:"set",name:"set",pkg:"strconv",typ:$funcType([$String],[$Bool],false)},{prop:"floatBits",name:"floatBits",pkg:"strconv",typ:$funcType([CZ],[$Uint64,$Bool],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Assign",name:"Assign",pkg:"",typ:$funcType([$Uint64],[],false)},{prop:"Shift",name:"Shift",pkg:"",typ:$funcType([$Int],[],false)},{prop:"Round",name:"Round",pkg:"",typ:$funcType([$Int],[],false)},{prop:"RoundDown",name:"RoundDown",pkg:"",typ:$funcType([$Int],[],false)},{prop:"RoundUp",name:"RoundUp",pkg:"",typ:$funcType([$Int],[],false)},{prop:"RoundedInteger",name:"RoundedInteger",pkg:"",typ:$funcType([],[$Uint64],false)}];DE.methods=[{prop:"floatBits",name:"floatBits",pkg:"strconv",typ:$funcType([CZ],[$Uint64,$Bool],false)},{prop:"AssignComputeBounds",name:"AssignComputeBounds",pkg:"",typ:$funcType([$Uint64,$Int,$Bool,CZ],[AH,AH],false)},{prop:"Normalize",name:"Normalize",pkg:"",typ:$funcType([],[$Uint],false)},{prop:"Multiply",name:"Multiply",pkg:"",typ:$funcType([AH],[],false)},{prop:"AssignDecimal",name:"AssignDecimal",pkg:"",typ:$funcType([$Uint64,$Int,$Bool,$Bool,CZ],[$Bool],false)},{prop:"frexp10",name:"frexp10",pkg:"strconv",typ:$funcType([],[$Int,$Int],false)},{prop:"FixedDecimal",name:"FixedDecimal",pkg:"",typ:$funcType([DD,$Int],[$Bool],false)},{prop:"ShortestDecimal",name:"ShortestDecimal",pkg:"",typ:$funcType([DD,DE,DE],[$Bool],false)}];S.init([{prop:"Func",name:"Func",pkg:"",typ:$String,tag:""},{prop:"Num",name:"Num",pkg:"",typ:$String,tag:""},{prop:"Err",name:"Err",pkg:"",typ:$error,tag:""}]);Y.init([{prop:"d",name:"d",pkg:"strconv",typ:CU,tag:""},{prop:"nd",name:"nd",pkg:"strconv",typ:$Int,tag:""},{prop:"dp",name:"dp",pkg:"strconv",typ:$Int,tag:""},{prop:"neg",name:"neg",pkg:"strconv",typ:$Bool,tag:""},{prop:"trunc",name:"trunc",pkg:"strconv",typ:$Bool,tag:""}]);AC.init([{prop:"delta",name:"delta",pkg:"strconv",typ:$Int,tag:""},{prop:"cutoff",name:"cutoff",pkg:"strconv",typ:$String,tag:""}]);AH.init([{prop:"mant",name:"mant",pkg:"strconv",typ:$Uint64,tag:""},{prop:"exp",name:"exp",pkg:"strconv",typ:$Int,tag:""},{prop:"neg",name:"neg",pkg:"strconv",typ:$Bool,tag:""}]);AO.init([{prop:"mantbits",name:"mantbits",pkg:"strconv",typ:$Uint,tag:""},{prop:"expbits",name:"expbits",pkg:"strconv",typ:$Uint,tag:""},{prop:"bias",name:"bias",pkg:"strconv",typ:$Int,tag:""}]);AX.init([{prop:"d",name:"d",pkg:"strconv",typ:CW,tag:""},{prop:"nd",name:"nd",pkg:"strconv",typ:$Int,tag:""},{prop:"dp",name:"dp",pkg:"strconv",typ:$Int,tag:""},{prop:"neg",name:"neg",pkg:"strconv",typ:$Bool,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=B.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}G=true;K=new CO([1,3,6,9,13,16,19,23,26]);L=new CP([1,10,100,1000,10000,100000,1e+06,1e+07,1e+08,1e+09,1e+10,1e+11,1e+12,1e+13,1e+14,1e+15,1e+16,1e+17,1e+18,1e+19,1e+20,1e+21,1e+22]);M=new CQ([1,10,100,1000,10000,100000,1e+06,1e+07,1e+08,1e+09,1e+10]);$pkg.ErrRange=B.New("value out of range");$pkg.ErrSyntax=B.New("invalid syntax");AD=new CR([new AC.ptr(0,""),new AC.ptr(1,"5"),new AC.ptr(1,"25"),new AC.ptr(1,"125"),new AC.ptr(2,"625"),new AC.ptr(2,"3125"),new AC.ptr(2,"15625"),new AC.ptr(3,"78125"),new AC.ptr(3,"390625"),new AC.ptr(3,"1953125"),new AC.ptr(4,"9765625"),new AC.ptr(4,"48828125"),new AC.ptr(4,"244140625"),new AC.ptr(4,"1220703125"),new AC.ptr(5,"6103515625"),new AC.ptr(5,"30517578125"),new AC.ptr(5,"152587890625"),new AC.ptr(6,"762939453125"),new AC.ptr(6,"3814697265625"),new AC.ptr(6,"19073486328125"),new AC.ptr(7,"95367431640625"),new AC.ptr(7,"476837158203125"),new AC.ptr(7,"2384185791015625"),new AC.ptr(7,"11920928955078125"),new AC.ptr(8,"59604644775390625"),new AC.ptr(8,"298023223876953125"),new AC.ptr(8,"1490116119384765625"),new AC.ptr(9,"7450580596923828125"),new AC.ptr(9,"37252902984619140625"),new AC.ptr(9,"186264514923095703125"),new AC.ptr(10,"931322574615478515625"),new AC.ptr(10,"4656612873077392578125"),new AC.ptr(10,"23283064365386962890625"),new AC.ptr(10,"116415321826934814453125"),new AC.ptr(11,"582076609134674072265625"),new AC.ptr(11,"2910383045673370361328125"),new AC.ptr(11,"14551915228366851806640625"),new AC.ptr(12,"72759576141834259033203125"),new AC.ptr(12,"363797880709171295166015625"),new AC.ptr(12,"1818989403545856475830078125"),new AC.ptr(13,"9094947017729282379150390625"),new AC.ptr(13,"45474735088646411895751953125"),new AC.ptr(13,"227373675443232059478759765625"),new AC.ptr(13,"1136868377216160297393798828125"),new AC.ptr(14,"5684341886080801486968994140625"),new AC.ptr(14,"28421709430404007434844970703125"),new AC.ptr(14,"142108547152020037174224853515625"),new AC.ptr(15,"710542735760100185871124267578125"),new AC.ptr(15,"3552713678800500929355621337890625"),new AC.ptr(15,"17763568394002504646778106689453125"),new AC.ptr(16,"88817841970012523233890533447265625"),new AC.ptr(16,"444089209850062616169452667236328125"),new AC.ptr(16,"2220446049250313080847263336181640625"),new AC.ptr(16,"11102230246251565404236316680908203125"),new AC.ptr(17,"55511151231257827021181583404541015625"),new AC.ptr(17,"277555756156289135105907917022705078125"),new AC.ptr(17,"1387778780781445675529539585113525390625"),new AC.ptr(18,"6938893903907228377647697925567626953125"),new AC.ptr(18,"34694469519536141888238489627838134765625"),new AC.ptr(18,"173472347597680709441192448139190673828125"),new AC.ptr(19,"867361737988403547205962240695953369140625")]);AI=$toNativeArray($kindStruct,[new AH.ptr(new $Uint64(2147483648,0),-63,false),new AH.ptr(new $Uint64(2684354560,0),-60,false),new AH.ptr(new $Uint64(3355443200,0),-57,false),new AH.ptr(new $Uint64(4194304000,0),-54,false),new AH.ptr(new $Uint64(2621440000,0),-50,false),new AH.ptr(new $Uint64(3276800000,0),-47,false),new AH.ptr(new $Uint64(4096000000,0),-44,false),new AH.ptr(new $Uint64(2560000000,0),-40,false)]);AJ=$toNativeArray($kindStruct,[new AH.ptr(new $Uint64(4203730336,136053384),-1220,false),new AH.ptr(new $Uint64(3132023167,2722021238),-1193,false),new AH.ptr(new $Uint64(2333539104,810921078),-1166,false),new AH.ptr(new $Uint64(3477244234,1573795306),-1140,false),new AH.ptr(new $Uint64(2590748842,1432697645),-1113,false),new AH.ptr(new $Uint64(3860516611,1025131999),-1087,false),new AH.ptr(new $Uint64(2876309015,3348809418),-1060,false),new AH.ptr(new $Uint64(4286034428,3200048207),-1034,false),new AH.ptr(new $Uint64(3193344495,1097586188),-1007,false),new AH.ptr(new $Uint64(2379227053,2424306748),-980,false),new AH.ptr(new $Uint64(3545324584,827693699),-954,false),new AH.ptr(new $Uint64(2641472655,2913388981),-927,false),new AH.ptr(new $Uint64(3936100983,602835915),-901,false),new AH.ptr(new $Uint64(2932623761,1081627501),-874,false),new AH.ptr(new $Uint64(2184974969,1572261463),-847,false),new AH.ptr(new $Uint64(3255866422,1308317239),-821,false),new AH.ptr(new $Uint64(2425809519,944281679),-794,false),new AH.ptr(new $Uint64(3614737867,629291719),-768,false),new AH.ptr(new $Uint64(2693189581,2545915892),-741,false),new AH.ptr(new $Uint64(4013165208,388672741),-715,false),new AH.ptr(new $Uint64(2990041083,708162190),-688,false),new AH.ptr(new $Uint64(2227754207,3536207675),-661,false),new AH.ptr(new $Uint64(3319612455,450088378),-635,false),new AH.ptr(new $Uint64(2473304014,3139815830),-608,false),new AH.ptr(new $Uint64(3685510180,2103616900),-582,false),new AH.ptr(new $Uint64(2745919064,224385782),-555,false),new AH.ptr(new $Uint64(4091738259,3737383206),-529,false),new AH.ptr(new $Uint64(3048582568,2868871352),-502,false),new AH.ptr(new $Uint64(2271371013,1820084875),-475,false),new AH.ptr(new $Uint64(3384606560,885076051),-449,false),new AH.ptr(new $Uint64(2521728396,2444895829),-422,false),new AH.ptr(new $Uint64(3757668132,1881767613),-396,false),new AH.ptr(new $Uint64(2799680927,3102062735),-369,false),new AH.ptr(new $Uint64(4171849679,2289335700),-343,false),new AH.ptr(new $Uint64(3108270227,2410191823),-316,false),new AH.ptr(new $Uint64(2315841784,3205436779),-289,false),new AH.ptr(new $Uint64(3450873173,1697722806),-263,false),new AH.ptr(new $Uint64(2571100870,3497754540),-236,false),new AH.ptr(new $Uint64(3831238852,707476230),-210,false),new AH.ptr(new $Uint64(2854495385,1769181907),-183,false),new AH.ptr(new $Uint64(4253529586,2197867022),-157,false),new AH.ptr(new $Uint64(3169126500,2450594539),-130,false),new AH.ptr(new $Uint64(2361183241,1867548876),-103,false),new AH.ptr(new $Uint64(3518437208,3793315116),-77,false),new AH.ptr(new $Uint64(2621440000,0),-50,false),new AH.ptr(new $Uint64(3906250000,0),-24,false),new AH.ptr(new $Uint64(2910383045,2892103680),3,false),new AH.ptr(new $Uint64(2168404344,4170451332),30,false),new AH.ptr(new $Uint64(3231174267,3372684723),56,false),new AH.ptr(new $Uint64(2407412430,2078956656),83,false),new AH.ptr(new $Uint64(3587324068,2884206696),109,false),new AH.ptr(new $Uint64(2672764710,395977285),136,false),new AH.ptr(new $Uint64(3982729777,3569679143),162,false),new AH.ptr(new $Uint64(2967364920,2361961896),189,false),new AH.ptr(new $Uint64(2210859150,447440347),216,false),new AH.ptr(new $Uint64(3294436857,1114709402),242,false),new AH.ptr(new $Uint64(2454546732,2786846552),269,false),new AH.ptr(new $Uint64(3657559652,443583978),295,false),new AH.ptr(new $Uint64(2725094297,2599384906),322,false),new AH.ptr(new $Uint64(4060706939,3028118405),348,false),new AH.ptr(new $Uint64(3025462433,2044532855),375,false),new AH.ptr(new $Uint64(2254145170,1536935362),402,false),new AH.ptr(new $Uint64(3358938053,3365297469),428,false),new AH.ptr(new $Uint64(2502603868,4204241075),455,false),new AH.ptr(new $Uint64(3729170365,2577424355),481,false),new AH.ptr(new $Uint64(2778448436,3677981733),508,false),new AH.ptr(new $Uint64(4140210802,2744688476),534,false),new AH.ptr(new $Uint64(3084697427,1424604878),561,false),new AH.ptr(new $Uint64(2298278679,4062331362),588,false),new AH.ptr(new $Uint64(3424702107,3546052773),614,false),new AH.ptr(new $Uint64(2551601907,2065781727),641,false),new AH.ptr(new $Uint64(3802183132,2535403578),667,false),new AH.ptr(new $Uint64(2832847187,1558426518),694,false),new AH.ptr(new $Uint64(4221271257,2762425404),720,false),new AH.ptr(new $Uint64(3145092172,2812560400),747,false),new AH.ptr(new $Uint64(2343276271,3057687578),774,false),new AH.ptr(new $Uint64(3491753744,2790753324),800,false),new AH.ptr(new $Uint64(2601559269,3918606633),827,false),new AH.ptr(new $Uint64(3876625403,2711358621),853,false),new AH.ptr(new $Uint64(2888311001,1648096297),880,false),new AH.ptr(new $Uint64(2151959390,2057817989),907,false),new AH.ptr(new $Uint64(3206669376,61660461),933,false),new AH.ptr(new $Uint64(2389154863,1581580175),960,false),new AH.ptr(new $Uint64(3560118173,2626467905),986,false),new AH.ptr(new $Uint64(2652494738,3034782633),1013,false),new AH.ptr(new $Uint64(3952525166,3135207385),1039,false),new AH.ptr(new $Uint64(2944860731,2616258155),1066,false)]);AK=$toNativeArray($kindUint64,[new $Uint64(0,1),new $Uint64(0,10),new $Uint64(0,100),new $Uint64(0,1000),new $Uint64(0,10000),new $Uint64(0,100000),new $Uint64(0,1000000),new $Uint64(0,10000000),new $Uint64(0,100000000),new $Uint64(0,1000000000),new $Uint64(2,1410065408),new $Uint64(23,1215752192),new $Uint64(232,3567587328),new $Uint64(2328,1316134912),new $Uint64(23283,276447232),new $Uint64(232830,2764472320),new $Uint64(2328306,1874919424),new $Uint64(23283064,1569325056),new $Uint64(232830643,2808348672),new $Uint64(2328306436,2313682944)]);AP=new AO.ptr(23,8,-127);AQ=new AO.ptr(52,11,-1023);BD=new CS([32,126,161,887,890,895,900,1366,1369,1418,1421,1479,1488,1514,1520,1524,1542,1563,1566,1805,1808,1866,1869,1969,1984,2042,2048,2093,2096,2139,2142,2142,2208,2228,2275,2444,2447,2448,2451,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2531,2534,2555,2561,2570,2575,2576,2579,2617,2620,2626,2631,2632,2635,2637,2641,2641,2649,2654,2662,2677,2689,2745,2748,2765,2768,2768,2784,2787,2790,2801,2809,2809,2817,2828,2831,2832,2835,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2915,2918,2935,2946,2954,2958,2965,2969,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3021,3024,3024,3031,3031,3046,3066,3072,3129,3133,3149,3157,3162,3168,3171,3174,3183,3192,3257,3260,3277,3285,3286,3294,3299,3302,3314,3329,3386,3389,3406,3415,3415,3423,3427,3430,3445,3449,3455,3458,3478,3482,3517,3520,3526,3530,3530,3535,3551,3558,3567,3570,3572,3585,3642,3647,3675,3713,3716,3719,3722,3725,3725,3732,3751,3754,3773,3776,3789,3792,3801,3804,3807,3840,3948,3953,4058,4096,4295,4301,4301,4304,4685,4688,4701,4704,4749,4752,4789,4792,4805,4808,4885,4888,4954,4957,4988,4992,5017,5024,5109,5112,5117,5120,5788,5792,5880,5888,5908,5920,5942,5952,5971,5984,6003,6016,6109,6112,6121,6128,6137,6144,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6443,6448,6459,6464,6464,6468,6509,6512,6516,6528,6571,6576,6601,6608,6618,6622,6683,6686,6780,6783,6793,6800,6809,6816,6829,6832,6846,6912,6987,6992,7036,7040,7155,7164,7223,7227,7241,7245,7295,7360,7367,7376,7417,7424,7669,7676,7957,7960,7965,7968,8005,8008,8013,8016,8061,8064,8147,8150,8175,8178,8190,8208,8231,8240,8286,8304,8305,8308,8348,8352,8382,8400,8432,8448,8587,8592,9210,9216,9254,9280,9290,9312,11123,11126,11157,11160,11193,11197,11217,11244,11247,11264,11507,11513,11559,11565,11565,11568,11623,11631,11632,11647,11670,11680,11842,11904,12019,12032,12245,12272,12283,12289,12438,12441,12543,12549,12589,12593,12730,12736,12771,12784,19893,19904,40917,40960,42124,42128,42182,42192,42539,42560,42743,42752,42925,42928,42935,42999,43051,43056,43065,43072,43127,43136,43204,43214,43225,43232,43261,43264,43347,43359,43388,43392,43481,43486,43574,43584,43597,43600,43609,43612,43714,43739,43766,43777,43782,43785,43790,43793,43798,43808,43877,43888,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64449,64467,64831,64848,64911,64914,64967,65008,65021,65024,65049,65056,65131,65136,65276,65281,65470,65474,65479,65482,65487,65490,65495,65498,65500,65504,65518,65532,65533]);BE=new CS([173,907,909,930,1328,1376,1416,1424,1757,2111,2436,2473,2481,2526,2564,2601,2609,2612,2615,2621,2653,2692,2702,2706,2729,2737,2740,2758,2762,2820,2857,2865,2868,2910,2948,2961,2971,2973,3017,3076,3085,3089,3113,3141,3145,3159,3200,3204,3213,3217,3241,3252,3269,3273,3295,3312,3332,3341,3345,3397,3401,3460,3506,3516,3541,3543,3715,3721,3736,3744,3748,3750,3756,3770,3781,3783,3912,3992,4029,4045,4294,4681,4695,4697,4745,4785,4799,4801,4823,4881,5760,5901,5997,6001,6431,6751,7415,8024,8026,8028,8030,8117,8133,8156,8181,8335,11209,11311,11359,11558,11687,11695,11703,11711,11719,11727,11735,11743,11930,12352,12687,12831,13055,43470,43519,43815,43823,64311,64317,64319,64322,64325,65107,65127,65141,65511]);BF=new CT([65536,65613,65616,65629,65664,65786,65792,65794,65799,65843,65847,65932,65936,65947,65952,65952,66000,66045,66176,66204,66208,66256,66272,66299,66304,66339,66352,66378,66384,66426,66432,66499,66504,66517,66560,66717,66720,66729,66816,66855,66864,66915,66927,66927,67072,67382,67392,67413,67424,67431,67584,67589,67592,67640,67644,67644,67647,67742,67751,67759,67808,67829,67835,67867,67871,67897,67903,67903,67968,68023,68028,68047,68050,68102,68108,68147,68152,68154,68159,68167,68176,68184,68192,68255,68288,68326,68331,68342,68352,68405,68409,68437,68440,68466,68472,68497,68505,68508,68521,68527,68608,68680,68736,68786,68800,68850,68858,68863,69216,69246,69632,69709,69714,69743,69759,69825,69840,69864,69872,69881,69888,69955,69968,70006,70016,70093,70096,70132,70144,70205,70272,70313,70320,70378,70384,70393,70400,70412,70415,70416,70419,70457,70460,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70784,70855,70864,70873,71040,71093,71096,71133,71168,71236,71248,71257,71296,71351,71360,71369,71424,71449,71453,71467,71472,71487,71840,71922,71935,71935,72384,72440,73728,74649,74752,74868,74880,75075,77824,78894,82944,83526,92160,92728,92736,92777,92782,92783,92880,92909,92912,92917,92928,92997,93008,93047,93053,93071,93952,94020,94032,94078,94095,94111,110592,110593,113664,113770,113776,113788,113792,113800,113808,113817,113820,113823,118784,119029,119040,119078,119081,119154,119163,119272,119296,119365,119552,119638,119648,119665,119808,119967,119970,119970,119973,119974,119977,120074,120077,120134,120138,120485,120488,120779,120782,121483,121499,121519,124928,125124,125127,125142,126464,126500,126503,126523,126530,126530,126535,126548,126551,126564,126567,126619,126625,126651,126704,126705,126976,127019,127024,127123,127136,127150,127153,127221,127232,127244,127248,127339,127344,127386,127462,127490,127504,127546,127552,127560,127568,127569,127744,128720,128736,128748,128752,128755,128768,128883,128896,128980,129024,129035,129040,129095,129104,129113,129120,129159,129168,129197,129296,129304,129408,129412,129472,129472,131072,173782,173824,177972,177984,178205,178208,183969,194560,195101,917760,917999]);BG=new CS([12,39,59,62,926,2057,2102,2134,2291,2564,2580,2584,4285,4405,4576,4626,4743,4745,4750,4766,4868,4905,4913,4916,9327,27231,27482,27490,54357,54429,54445,54458,54460,54468,54534,54549,54557,54586,54591,54597,54609,55968,60932,60960,60963,60968,60979,60984,60986,61000,61002,61004,61008,61011,61016,61018,61020,61022,61024,61027,61035,61043,61048,61053,61055,61066,61092,61098,61632,61648,61743,62842,62884]);BH=new CS([160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288]);BN=$toNativeArray($kindUint,[0,0,1,0,2,0,0,0,3,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0]);}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["reflect"]=(function(){var $pkg={},$init,A,C,F,D,B,E,AK,BN,BO,BP,BQ,BR,BS,BT,BU,BV,BW,BX,BY,BZ,CA,CB,CC,CD,CE,CG,CH,CI,DK,DL,DO,DQ,FX,GD,GJ,GK,GL,GM,GN,GO,GP,GQ,GR,GS,GT,GU,GV,GW,GX,GY,GZ,HA,HB,HE,HF,HG,HH,HI,HJ,HK,HP,HR,HU,HV,HW,HX,HY,G,L,AW,AX,BB,CF,DX,H,I,J,K,M,N,O,P,Q,R,S,X,Y,Z,AA,AC,AG,AH,AI,AJ,AL,AM,AN,AO,AP,AR,AS,AT,AU,AV,AY,AZ,BA,BC,BD,CK,CM,CN,CO,DC,DH,DY,EQ,ES,ET,EU,EV,EW,EX,EY,EZ,FA,FB,FC,FD,FE,FF,FG,FH,FI,FJ,FK,FL,FM,FN;A=$packages["errors"];C=$packages["github.com/gopherjs/gopherjs/js"];F=$packages["math"];D=$packages["runtime"];B=$packages["strconv"];E=$packages["sync"];AK=$pkg.mapIter=$newType(0,$kindStruct,"reflect.mapIter","mapIter","reflect",function(t_,m_,keys_,i_){this.$val=this;if(arguments.length===0){this.t=$ifaceNil;this.m=null;this.keys=null;this.i=0;return;}this.t=t_;this.m=m_;this.keys=keys_;this.i=i_;});BN=$pkg.Type=$newType(8,$kindInterface,"reflect.Type","Type","reflect",null);BO=$pkg.Kind=$newType(4,$kindUint,"reflect.Kind","Kind","reflect",null);BP=$pkg.rtype=$newType(0,$kindStruct,"reflect.rtype","rtype","reflect",function(size_,ptrdata_,hash_,_$3_,align_,fieldAlign_,kind_,alg_,gcdata_,string_,uncommonType_,ptrToThis_){this.$val=this;if(arguments.length===0){this.size=0;this.ptrdata=0;this.hash=0;this._$3=0;this.align=0;this.fieldAlign=0;this.kind=0;this.alg=GN.nil;this.gcdata=GO.nil;this.string=GP.nil;this.uncommonType=GQ.nil;this.ptrToThis=FX.nil;return;}this.size=size_;this.ptrdata=ptrdata_;this.hash=hash_;this._$3=_$3_;this.align=align_;this.fieldAlign=fieldAlign_;this.kind=kind_;this.alg=alg_;this.gcdata=gcdata_;this.string=string_;this.uncommonType=uncommonType_;this.ptrToThis=ptrToThis_;});BQ=$pkg.typeAlg=$newType(0,$kindStruct,"reflect.typeAlg","typeAlg","reflect",function(hash_,equal_){this.$val=this;if(arguments.length===0){this.hash=$throwNilPointerError;this.equal=$throwNilPointerError;return;}this.hash=hash_;this.equal=equal_;});BR=$pkg.method=$newType(0,$kindStruct,"reflect.method","method","reflect",function(name_,pkgPath_,mtyp_,typ_,ifn_,tfn_){this.$val=this;if(arguments.length===0){this.name=GP.nil;this.pkgPath=GP.nil;this.mtyp=FX.nil;this.typ=FX.nil;this.ifn=0;this.tfn=0;return;}this.name=name_;this.pkgPath=pkgPath_;this.mtyp=mtyp_;this.typ=typ_;this.ifn=ifn_;this.tfn=tfn_;});BS=$pkg.uncommonType=$newType(0,$kindStruct,"reflect.uncommonType","uncommonType","reflect",function(name_,pkgPath_,methods_){this.$val=this;if(arguments.length===0){this.name=GP.nil;this.pkgPath=GP.nil;this.methods=GR.nil;return;}this.name=name_;this.pkgPath=pkgPath_;this.methods=methods_;});BT=$pkg.ChanDir=$newType(4,$kindInt,"reflect.ChanDir","ChanDir","reflect",null);BU=$pkg.arrayType=$newType(0,$kindStruct,"reflect.arrayType","arrayType","reflect",function(rtype_,elem_,slice_,len_){this.$val=this;if(arguments.length===0){this.rtype=new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil);this.elem=FX.nil;this.slice=FX.nil;this.len=0;return;}this.rtype=rtype_;this.elem=elem_;this.slice=slice_;this.len=len_;});BV=$pkg.chanType=$newType(0,$kindStruct,"reflect.chanType","chanType","reflect",function(rtype_,elem_,dir_){this.$val=this;if(arguments.length===0){this.rtype=new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil);this.elem=FX.nil;this.dir=0;return;}this.rtype=rtype_;this.elem=elem_;this.dir=dir_;});BW=$pkg.funcType=$newType(0,$kindStruct,"reflect.funcType","funcType","reflect",function(rtype_,dotdotdot_,in$2_,out_){this.$val=this;if(arguments.length===0){this.rtype=new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil);this.dotdotdot=false;this.in$2=GD.nil;this.out=GD.nil;return;}this.rtype=rtype_;this.dotdotdot=dotdotdot_;this.in$2=in$2_;this.out=out_;});BX=$pkg.imethod=$newType(0,$kindStruct,"reflect.imethod","imethod","reflect",function(name_,pkgPath_,typ_){this.$val=this;if(arguments.length===0){this.name=GP.nil;this.pkgPath=GP.nil;this.typ=FX.nil;return;}this.name=name_;this.pkgPath=pkgPath_;this.typ=typ_;});BY=$pkg.interfaceType=$newType(0,$kindStruct,"reflect.interfaceType","interfaceType","reflect",function(rtype_,methods_){this.$val=this;if(arguments.length===0){this.rtype=new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil);this.methods=GS.nil;return;}this.rtype=rtype_;this.methods=methods_;});BZ=$pkg.mapType=$newType(0,$kindStruct,"reflect.mapType","mapType","reflect",function(rtype_,key_,elem_,bucket_,hmap_,keysize_,indirectkey_,valuesize_,indirectvalue_,bucketsize_,reflexivekey_,needkeyupdate_){this.$val=this;if(arguments.length===0){this.rtype=new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil);this.key=FX.nil;this.elem=FX.nil;this.bucket=FX.nil;this.hmap=FX.nil;this.keysize=0;this.indirectkey=0;this.valuesize=0;this.indirectvalue=0;this.bucketsize=0;this.reflexivekey=false;this.needkeyupdate=false;return;}this.rtype=rtype_;this.key=key_;this.elem=elem_;this.bucket=bucket_;this.hmap=hmap_;this.keysize=keysize_;this.indirectkey=indirectkey_;this.valuesize=valuesize_;this.indirectvalue=indirectvalue_;this.bucketsize=bucketsize_;this.reflexivekey=reflexivekey_;this.needkeyupdate=needkeyupdate_;});CA=$pkg.ptrType=$newType(0,$kindStruct,"reflect.ptrType","ptrType","reflect",function(rtype_,elem_){this.$val=this;if(arguments.length===0){this.rtype=new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil);this.elem=FX.nil;return;}this.rtype=rtype_;this.elem=elem_;});CB=$pkg.sliceType=$newType(0,$kindStruct,"reflect.sliceType","sliceType","reflect",function(rtype_,elem_){this.$val=this;if(arguments.length===0){this.rtype=new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil);this.elem=FX.nil;return;}this.rtype=rtype_;this.elem=elem_;});CC=$pkg.structField=$newType(0,$kindStruct,"reflect.structField","structField","reflect",function(name_,pkgPath_,typ_,tag_,offset_){this.$val=this;if(arguments.length===0){this.name=GP.nil;this.pkgPath=GP.nil;this.typ=FX.nil;this.tag=GP.nil;this.offset=0;return;}this.name=name_;this.pkgPath=pkgPath_;this.typ=typ_;this.tag=tag_;this.offset=offset_;});CD=$pkg.structType=$newType(0,$kindStruct,"reflect.structType","structType","reflect",function(rtype_,fields_){this.$val=this;if(arguments.length===0){this.rtype=new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil);this.fields=GT.nil;return;}this.rtype=rtype_;this.fields=fields_;});CE=$pkg.Method=$newType(0,$kindStruct,"reflect.Method","Method","reflect",function(Name_,PkgPath_,Type_,Func_,Index_){this.$val=this;if(arguments.length===0){this.Name="";this.PkgPath="";this.Type=$ifaceNil;this.Func=new DK.ptr(FX.nil,0,0);this.Index=0;return;}this.Name=Name_;this.PkgPath=PkgPath_;this.Type=Type_;this.Func=Func_;this.Index=Index_;});CG=$pkg.StructField=$newType(0,$kindStruct,"reflect.StructField","StructField","reflect",function(Name_,PkgPath_,Type_,Tag_,Offset_,Index_,Anonymous_){this.$val=this;if(arguments.length===0){this.Name="";this.PkgPath="";this.Type=$ifaceNil;this.Tag="";this.Offset=0;this.Index=HH.nil;this.Anonymous=false;return;}this.Name=Name_;this.PkgPath=PkgPath_;this.Type=Type_;this.Tag=Tag_;this.Offset=Offset_;this.Index=Index_;this.Anonymous=Anonymous_;});CH=$pkg.StructTag=$newType(8,$kindString,"reflect.StructTag","StructTag","reflect",null);CI=$pkg.fieldScan=$newType(0,$kindStruct,"reflect.fieldScan","fieldScan","reflect",function(typ_,index_){this.$val=this;if(arguments.length===0){this.typ=HJ.nil;this.index=HH.nil;return;}this.typ=typ_;this.index=index_;});DK=$pkg.Value=$newType(0,$kindStruct,"reflect.Value","Value","reflect",function(typ_,ptr_,flag_){this.$val=this;if(arguments.length===0){this.typ=FX.nil;this.ptr=0;this.flag=0;return;}this.typ=typ_;this.ptr=ptr_;this.flag=flag_;});DL=$pkg.flag=$newType(4,$kindUintptr,"reflect.flag","flag","reflect",null);DO=$pkg.ValueError=$newType(0,$kindStruct,"reflect.ValueError","ValueError","reflect",function(Method_,Kind_){this.$val=this;if(arguments.length===0){this.Method="";this.Kind=0;return;}this.Method=Method_;this.Kind=Kind_;});DQ=$pkg.nonEmptyInterface=$newType(0,$kindStruct,"reflect.nonEmptyInterface","nonEmptyInterface","reflect",function(itab_,word_){this.$val=this;if(arguments.length===0){this.itab=HA.nil;this.word=0;return;}this.itab=itab_;this.word=word_;});FX=$ptrType(BP);GD=$sliceType(FX);GJ=$sliceType($emptyInterface);GK=$ptrType(C.Object);GL=$funcType([GJ],[GK],true);GM=$sliceType($String);GN=$ptrType(BQ);GO=$ptrType($Uint8);GP=$ptrType($String);GQ=$ptrType(BS);GR=$sliceType(BR);GS=$sliceType(BX);GT=$sliceType(CC);GU=$structType([{prop:"str",name:"str",pkg:"reflect",typ:$String,tag:""}]);GV=$sliceType(GK);GW=$sliceType(DK);GX=$ptrType(DQ);GY=$arrayType($UnsafePointer,100000);GZ=$structType([{prop:"ityp",name:"ityp",pkg:"reflect",typ:FX,tag:""},{prop:"typ",name:"typ",pkg:"reflect",typ:FX,tag:""},{prop:"link",name:"link",pkg:"reflect",typ:$UnsafePointer,tag:""},{prop:"bad",name:"bad",pkg:"reflect",typ:$Int32,tag:""},{prop:"unused",name:"unused",pkg:"reflect",typ:$Int32,tag:""},{prop:"fun",name:"fun",pkg:"reflect",typ:GY,tag:""}]);HA=$ptrType(GZ);HB=$sliceType(GV);HE=$ptrType(BR);HF=$ptrType(BY);HG=$ptrType(BX);HH=$sliceType($Int);HI=$sliceType(CI);HJ=$ptrType(CD);HK=$sliceType($Uint8);HP=$ptrType($UnsafePointer);HR=$sliceType($Int32);HU=$funcType([$String],[$Bool],false);HV=$funcType([$UnsafePointer,$Uintptr],[$Uintptr],false);HW=$funcType([$UnsafePointer,$UnsafePointer],[$Bool],false);HX=$arrayType($Uintptr,2);HY=$ptrType(DO);H=function(){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=(function(ah){var $ptr,ah;});$r=ah((ai=new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),new ai.constructor.elem(ai)));$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((aj=new BS.ptr(GP.nil,GP.nil,GR.nil),new aj.constructor.elem(aj)));$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((ak=new BR.ptr(GP.nil,GP.nil,FX.nil,FX.nil,0,0),new ak.constructor.elem(ak)));$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((al=new BU.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),FX.nil,FX.nil,0),new al.constructor.elem(al)));$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((am=new BV.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),FX.nil,0),new am.constructor.elem(am)));$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((an=new BW.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),false,GD.nil,GD.nil),new an.constructor.elem(an)));$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((ao=new BY.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),GS.nil),new ao.constructor.elem(ao)));$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((ap=new BZ.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),FX.nil,FX.nil,FX.nil,FX.nil,0,0,0,0,0,false,false),new ap.constructor.elem(ap)));$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((aq=new CA.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),FX.nil),new aq.constructor.elem(aq)));$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((ar=new CB.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),FX.nil),new ar.constructor.elem(ar)));$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((as=new CD.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),GT.nil),new as.constructor.elem(as)));$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((at=new BX.ptr(GP.nil,GP.nil,FX.nil),new at.constructor.elem(at)));$s=12;case 12:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=ah((au=new CC.ptr(GP.nil,GP.nil,FX.nil,GP.nil,0),new au.constructor.elem(au)));$s=13;case 13:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}G=true;DX=$assertType(R(new $Uint8(0)),FX);$s=-1;case-1:}return;}if($f===undefined){$f={$blk:H};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.$s=$s;$f.$r=$r;return $f;};I=function(ah){var $ptr,ah;return ah.jsType;};J=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn;if(ah.reflectType===undefined){ai=new BP.ptr((($parseInt(ah.size)>>0)>>>0),0,0,0,0,0,(($parseInt(ah.kind)>>0)<<24>>>24),GN.nil,GO.nil,M(ah.string),GQ.nil,FX.nil);ai.jsType=ah;ah.reflectType=ai;aj=$methodSet(ah);if(!($internalize(ah.typeName,$String)==="")||!(($parseInt(aj.length)===0))){ak=$makeSlice(GR,$parseInt(aj.length));al=ak;am=0;while(true){if(!(am=ak.$length)?$throwRuntimeError("index out of range"):ak.$array[ak.$offset+an]),new BR.ptr(M(ao.name),M(ao.pkg),J(ap),J($funcType(new($global.Array)(ah).concat(ap.params),ap.results,ap.variadic)),0,0));am++;}ai.uncommonType=new BS.ptr(M(ah.typeName),M(ah.pkg),ak);ai.uncommonType.jsType=ah;}aq=ai.Kind();if(aq===(17)){K(ai,new BU.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),J(ah.elem),FX.nil,(($parseInt(ah.len)>>0)>>>0)));}else if(aq===(18)){ar=3;if(!!(ah.sendOnly)){ar=2;}if(!!(ah.recvOnly)){ar=1;}K(ai,new BV.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),J(ah.elem),(ar>>>0)));}else if(aq===(19)){as=ah.params;at=$makeSlice(GD,$parseInt(as.length));au=at;av=0;while(true){if(!(av=at.$length)?$throwRuntimeError("index out of range"):at.$array[at.$offset+aw]=J(as[aw]));av++;}ax=ah.results;ay=$makeSlice(GD,$parseInt(ax.length));az=ay;ba=0;while(true){if(!(ba=ay.$length)?$throwRuntimeError("index out of range"):ay.$array[ay.$offset+bb]=J(ax[bb]));ba++;}K(ai,new BW.ptr($clone(ai,BP),!!(ah.variadic),at,ay));}else if(aq===(20)){bc=ah.methods;bd=$makeSlice(GS,$parseInt(bc.length));be=bd;bf=0;while(true){if(!(bf=bd.$length)?$throwRuntimeError("index out of range"):bd.$array[bd.$offset+bg]),new BX.ptr(M(bh.name),M(bh.pkg),J(bh.typ)));bf++;}K(ai,new BY.ptr($clone(ai,BP),bd));}else if(aq===(21)){K(ai,new BZ.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),J(ah.key),J(ah.elem),FX.nil,FX.nil,0,0,0,0,0,false,false));}else if(aq===(22)){K(ai,new CA.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),J(ah.elem)));}else if(aq===(23)){K(ai,new CB.ptr(new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil),J(ah.elem)));}else if(aq===(25)){bi=ah.fields;bj=$makeSlice(GT,$parseInt(bi.length));bk=bj;bl=0;while(true){if(!(bl=bj.$length)?$throwRuntimeError("index out of range"):bj.$array[bj.$offset+bm]),new CC.ptr(M(bn.name),M(bn.pkg),J(bn.typ),M(bn.tag),(bm>>>0)));bl++;}K(ai,new CD.ptr($clone(ai,BP),bj));}}return ah.reflectType;};K=function(ah,ai){var $ptr,ah,ai;ah.kindType=ai;ai.rtype=ah;};M=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap;ai=new GU.ptr("");ai.str=ah;aj=ai.str;if(aj===""){return GP.nil;}ak=(al=L[$String.keyFor(aj)],al!==undefined?[al.v,true]:[GP.nil,false]);am=ak[0];an=ak[1];if(!an){am=(ao||(ao=new GP(function(){return aj;},function($v){aj=$v;})));ap=aj;(L||$throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(ap)]={k:ap,v:am};}return am;};N=function(ah){var $ptr,ah;return!!(I(ah).wrapped);};O=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am;ak=I(aj).fields;al=0;while(true){if(!(al<$parseInt(ak.length))){break;}am=$internalize(ak[al].prop,$String);ah[$externalize(am,$String)]=ai[$externalize(am,$String)];al=al+(1)>>0;}};P=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ak=ah.common();$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=ak;ao=ah.Kind();$s=6;case 6:if($c){$c=false;ao=ao.$blk();}if(ao&&ao.$blk!==undefined){break s;}if(ao===17){an=true;$s=5;continue s;}ap=ah.Kind();$s=7;case 7:if($c){$c=false;ap=ap.$blk();}if(ap&&ap.$blk!==undefined){break s;}an=ap===25;case 5:if(an){am=true;$s=4;continue s;}aq=ah.Kind();$s=8;case 8:if($c){$c=false;aq=aq.$blk();}if(aq&&aq.$blk!==undefined){break s;}am=aq===22;case 4:if(am){$s=2;continue;}$s=3;continue;case 2:ar=ah.Kind();$s=9;case 9:if($c){$c=false;ar=ar.$blk();}if(ar&&ar.$blk!==undefined){break s;}$s=10;case 10:return new DK.ptr(al,ai,(aj|(ar>>>0))>>>0);case 3:as=ah.Kind();$s=11;case 11:if($c){$c=false;as=as.$blk();}if(as&&as.$blk!==undefined){break s;}$s=12;case 12:return new DK.ptr(al,$newDataPointer(ai,I(al.ptrTo())),(((aj|(as>>>0))>>>0)|128)>>>0);}return;}if($f===undefined){$f={$blk:P};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.$s=$s;$f.$r=$r;return $f;};Q=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=[ah];ak=ah[0].Kind();$s=3;case 3:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}if(!((ak===23))){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect.MakeSlice of non-slice type"));case 2:if(ai<0){$panic(new $String("reflect.MakeSlice: negative len"));}if(aj<0){$panic(new $String("reflect.MakeSlice: negative cap"));}if(ai>aj){$panic(new $String("reflect.MakeSlice: len > cap"));}al=P(ah[0],$makeSlice(I(ah[0]),ai,aj,(function(ah){return function $b(){var $ptr,al,am,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;al=$f.al;am=$f.am;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:al=ah[0].Elem();$s=1;case 1:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}am=I(al);$s=2;case 2:if($c){$c=false;am=am.$blk();}if(am&&am.$blk!==undefined){break s;}$s=3;case 3:return am.zero();}return;}if($f===undefined){$f={$blk:$b};}$f.$ptr=$ptr;$f.al=al;$f.am=am;$f.$s=$s;$f.$r=$r;return $f;};})(ah)),0);$s=4;case 4:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}$s=5;case 5:return al;}return;}if($f===undefined){$f={$blk:Q};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.$s=$s;$f.$r=$r;return $f;};$pkg.MakeSlice=Q;R=function(ah){var $ptr,ah;if(!G){return new BP.ptr(0,0,0,0,0,0,0,GN.nil,GO.nil,GP.nil,GQ.nil,FX.nil);}if($interfaceIsEqual(ah,$ifaceNil)){return $ifaceNil;}return J(ah.constructor);};$pkg.TypeOf=R;S=function(ah){var $ptr,ah,ai,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:if($interfaceIsEqual(ah,$ifaceNil)){return new DK.ptr(FX.nil,0,0);}ai=P(J(ah.constructor),ah.$val,0);$s=1;case 1:if($c){$c=false;ai=ai.$blk();}if(ai&&ai.$blk!==undefined){break s;}$s=2;case 2:return ai;}return;}if($f===undefined){$f={$blk:S};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.$s=$s;$f.$r=$r;return $f;};$pkg.ValueOf=S;BP.ptr.prototype.ptrTo=function(){var $ptr,ah;ah=this;return J($ptrType(I(ah)));};BP.prototype.ptrTo=function(){return this.$val.ptrTo();};X=function(ah){var $ptr,ah;return J($sliceType(I(ah)));};$pkg.SliceOf=X;Y=function(ah){var $ptr,ah,ai,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=P(ah,I(ah).zero(),0);$s=1;case 1:if($c){$c=false;ai=ai.$blk();}if(ai&&ai.$blk!==undefined){break s;}$s=2;case 2:return ai;}return;}if($f===undefined){$f={$blk:Y};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Zero=Y;Z=function(ah){var $ptr,ah,ai;ai=ah.Kind();if(ai===(25)){return new(I(ah).ptr)();}else if(ai===(17)){return I(ah).zero();}else{return $newDataPointer(I(ah).zero(),I(ah.ptrTo()));}};AA=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ak=aj.common();$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=ak;am=Z(al);an=al.Kind();if(an===(3)){am.$set((ai.$low<<24>>24));}else if(an===(4)){am.$set((ai.$low<<16>>16));}else if((an===(2))||(an===(5))){am.$set((ai.$low>>0));}else if(an===(6)){am.$set(new $Int64(ai.$high,ai.$low));}else if(an===(8)){am.$set((ai.$low<<24>>>24));}else if(an===(9)){am.$set((ai.$low<<16>>>16));}else if((an===(7))||(an===(10))||(an===(12))){am.$set((ai.$low>>>0));}else if(an===(11)){am.$set(ai);}return new DK.ptr(al,am,(((ah|128)>>>0)|(al.Kind()>>>0))>>>0);}return;}if($f===undefined){$f={$blk:AA};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};AC=function(ah,ai,aj){var $ptr,ah,ai,aj;ai.$set(aj.$get());};AG=function(ah,ai){var $ptr,ah,ai,aj,ak;aj=ai;if(!(aj.$get===undefined)){aj=aj.$get();}ak=$internalize(I(ah.Key()).keyFor(aj),$String);return[aj,ak];};AH=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am;ak=AG(ah,aj);al=ak[1];am=ai[$externalize(al,$String)];if(am===undefined){return 0;}return $newDataPointer(am.v,I(CK(ah.Elem())));};AI=function(ah,ai,aj,ak){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:al=AG(ah,aj);am=al[0];an=al[1];ao=ak.$get();ap=ah.Elem();aq=ap.Kind();$s=3;case 3:if($c){$c=false;aq=aq.$blk();}if(aq&&aq.$blk!==undefined){break s;}if(aq===25){$s=1;continue;}$s=2;continue;case 1:ar=I(ap).zero();O(ar,ao,ap);ao=ar;case 2:as=new($global.Object)();as.k=am;as.v=ao;ai[$externalize(an,$String)]=as;$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AI};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.$s=$s;$f.$r=$r;return $f;};AJ=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al;ak=AG(ah,aj);al=ak[1];delete ai[$externalize(al,$String)];};AL=function(ah,ai){var $ptr,ah,ai;return new AK.ptr(ah,ai,$keys(ai),0);};AM=function(ah){var $ptr,ah,ai,aj,ak,al,am,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=ah;aj=ai.keys[ai.i];ak=ai.t.Key();$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=CK(ak);$s=2;case 2:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}am=I(al);$s=3;case 3:if($c){$c=false;am=am.$blk();}if(am&&am.$blk!==undefined){break s;}$s=4;case 4:return $newDataPointer(ai.m[$externalize($internalize(aj,$String),$String)].k,am);}return;}if($f===undefined){$f={$blk:AM};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.$s=$s;$f.$r=$r;return $f;};AN=function(ah){var $ptr,ah,ai;ai=ah;ai.i=ai.i+(1)>>0;};AO=function(ah){var $ptr,ah;return $parseInt($keys(ah).length);};AP=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;ax=$f.ax;ay=$f.ay;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=ah.object();if(aj===I(ah.typ).nil){$s=1;continue;}$s=2;continue;case 1:ak=P(ai,I(ai).nil,ah.flag);$s=3;case 3:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}$s=4;case 4:return ak;case 2:al=null;am=ai.Kind();$s=6;case 6:if($c){$c=false;am=am.$blk();}if(am&&am.$blk!==undefined){break s;}an=am;ao=an;if(ao===(23)){$s=7;continue;}if(ao===(22)){$s=8;continue;}if(ao===(25)){$s=9;continue;}if((ao===(17))||(ao===(1))||(ao===(18))||(ao===(19))||(ao===(20))||(ao===(21))||(ao===(24))){$s=10;continue;}$s=11;continue;case 7:ap=new(I(ai))(aj.$array);ap.$offset=aj.$offset;ap.$length=aj.$length;ap.$capacity=aj.$capacity;al=$newDataPointer(ap,I(CK(ai)));$s=12;continue;case 8:aq=ai.Elem();$s=15;case 15:if($c){$c=false;aq=aq.$blk();}if(aq&&aq.$blk!==undefined){break s;}ar=aq.Kind();$s=16;case 16:if($c){$c=false;ar=ar.$blk();}if(ar&&ar.$blk!==undefined){break s;}if(ar===25){$s=13;continue;}$s=14;continue;case 13:as=ai.Elem();$s=19;case 19:if($c){$c=false;as=as.$blk();}if(as&&as.$blk!==undefined){break s;}if($interfaceIsEqual(as,ah.typ.Elem())){$s=17;continue;}$s=18;continue;case 17:al=aj;$s=5;continue;case 18:al=new(I(ai))();at=al;au=aj;av=ai.Elem();$s=20;case 20:if($c){$c=false;av=av.$blk();}if(av&&av.$blk!==undefined){break s;}aw=av;$r=O(at,au,aw);$s=21;case 21:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=5;continue;case 14:al=new(I(ai))(aj.$get,aj.$set);$s=12;continue;case 9:al=new(I(ai).ptr)();O(al,aj,ai);$s=12;continue;case 10:al=ah.ptr;$s=12;continue;case 11:$panic(new DO.ptr("reflect.Convert",an));case 12:case 5:ax=ai.common();$s=22;case 22:if($c){$c=false;ax=ax.$blk();}if(ax&&ax.$blk!==undefined){break s;}ay=ai.Kind();$s=23;case 23:if($c){$c=false;ay=ay.$blk();}if(ay&&ay.$blk!==undefined){break s;}$s=24;case 24:return new DK.ptr(ax,al,(((ah.flag&224)>>>0)|(ay>>>0))>>>0);}return;}if($f===undefined){$f={$blk:AP};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.ax=ax;$f.ay=ay;$f.$s=$s;$f.$r=$r;return $f;};AR=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av;ak=FX.nil;al=FX.nil;am=0;ai=ai;an="";if(ai.typ.Kind()===20){ao=ai.typ.kindType;if(aj<0||aj>=ao.methods.$length){$panic(new $String("reflect: internal error: invalid method index"));}aq=(ap=ao.methods,((aj<0||aj>=ap.$length)?$throwRuntimeError("index out of range"):ap.$array[ap.$offset+aj]));if(!(aq.pkgPath===GP.nil)){$panic(new $String("reflect: "+ah+" of unexported method"));}ar=$pointerOfStructConversion(ai.ptr,GX);if(ar.itab===HA.nil){$panic(new $String("reflect: "+ah+" of method on nil interface value"));}al=aq.typ;an=aq.name.$get();}else{as=ai.typ.uncommonType.uncommon();if(as===GQ.nil||aj<0||aj>=as.methods.$length){$panic(new $String("reflect: internal error: invalid method index"));}au=(at=as.methods,((aj<0||aj>=at.$length)?$throwRuntimeError("index out of range"):at.$array[at.$offset+aj]));if(!(au.pkgPath===GP.nil)){$panic(new $String("reflect: "+ah+" of unexported method"));}al=au.mtyp;an=$internalize($methodSet(I(ai.typ))[aj].prop,$String);}av=ai.object();if(N(ai.typ)){av=new(I(ai.typ))(av);}am=av[$externalize(an,$String)];return[ak,al,am];};AS=function(ah,ai){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;if(ah.flag===0){$panic(new DO.ptr("reflect.Value.Interface",0));}if(ai&&!((((ah.flag&96)>>>0)===0))){$panic(new $String("reflect.Value.Interface: cannot return value obtained from unexported field or method"));}if(!((((ah.flag&512)>>>0)===0))){$s=1;continue;}$s=2;continue;case 1:aj=AV("Interface",ah);$s=3;case 3:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}ah=aj;case 2:if(N(ah.typ)){return new(I(ah.typ))(ah.object());}return ah.object();}return;}if($f===undefined){$f={$blk:AS};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};AT=function(ah,ai,aj){var $ptr,ah,ai,aj;aj.$set(ai);};AU=function(){var $ptr;return"?FIXME?";};AV=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:aj=[aj];ak=[ak];ai=ai;if(((ai.flag&512)>>>0)===0){$panic(new $String("reflect: internal error: invalid use of makePartialFunc"));}al=AR(ah,ai,(ai.flag>>0)>>10>>0);aj[0]=al[2];ak[0]=ai.object();if(N(ai.typ)){ak[0]=new(I(ai.typ))(ak[0]);}am=$makeFunc((function(aj,ak){return function(am){var $ptr,am;return aj[0].apply(ak[0],$externalize(am,GV));};})(aj,ak));an=ai.Type().common();$s=1;case 1:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}$s=2;case 2:return new DK.ptr(an,am,(((ai.flag&96)>>>0)|19)>>>0);}return;}if($f===undefined){$f={$blk:AV};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};BP.ptr.prototype.pointers=function(){var $ptr,ah,ai;ah=this;ai=ah.Kind();if((ai===(22))||(ai===(21))||(ai===(18))||(ai===(19))||(ai===(25))||(ai===(17))){return true;}else{return false;}};BP.prototype.pointers=function(){return this.$val.pointers();};BP.ptr.prototype.Comparable=function(){var $ptr,ah,ai,aj,ak,al,am,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=this;ai=ah.Kind();if((ai===(19))||(ai===(23))||(ai===(21))){$s=2;continue;}if(ai===(17)){$s=3;continue;}if(ai===(25)){$s=4;continue;}$s=5;continue;case 2:return false;case 3:aj=ah.Elem().Comparable();$s=6;case 6:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=7;case 7:return aj;case 4:ak=0;case 8:if(!(ak>0;$s=8;continue;case 9:case 5:case 1:return true;}return;}if($f===undefined){$f={$blk:BP.ptr.prototype.Comparable};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.$s=$s;$f.$r=$r;return $f;};BP.prototype.Comparable=function(){return this.$val.Comparable();};BS.ptr.prototype.Method=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap;ai=new CE.ptr("","",$ifaceNil,new DK.ptr(FX.nil,0,0),0);aj=this;if(aj===GQ.nil||ah<0||ah>=aj.methods.$length){$panic(new $String("reflect: Method index out of range"));}al=(ak=aj.methods,((ah<0||ah>=ak.$length)?$throwRuntimeError("index out of range"):ak.$array[ak.$offset+ah]));if(!(al.name===GP.nil)){ai.Name=al.name.$get();}am=19;if(!(al.pkgPath===GP.nil)){ai.PkgPath=al.pkgPath.$get();am=(am|(32))>>>0;}an=al.typ;ai.Type=an;ao=$internalize($methodSet(aj.jsType)[ah].prop,$String);ap=$makeFunc((function(ap){var $ptr,ap,aq;aq=(0>=ap.$length?$throwRuntimeError("index out of range"):ap.$array[ap.$offset+0]);return aq[$externalize(ao,$String)].apply(aq,$externalize($subslice(ap,1),GV));}));ai.Func=new DK.ptr(an,ap,am);ai.Index=ah;return ai;};BS.prototype.Method=function(ah){return this.$val.Method(ah);};DK.ptr.prototype.object=function(){var $ptr,ah,ai,aj,ak;ah=this;if((ah.typ.Kind()===17)||(ah.typ.Kind()===25)){return ah.ptr;}if(!((((ah.flag&128)>>>0)===0))){ai=ah.ptr.$get();if(!(ai===$ifaceNil)&&!(ai.constructor===I(ah.typ))){switch(0){default:aj=ah.typ.Kind();if((aj===(11))||(aj===(6))){ai=new(I(ah.typ))(ai.$high,ai.$low);}else if((aj===(15))||(aj===(16))){ai=new(I(ah.typ))(ai.$real,ai.$imag);}else if(aj===(23)){if(ai===ai.constructor.nil){ai=I(ah.typ).nil;break;}ak=new(I(ah.typ))(ai.$array);ak.$offset=ai.$offset;ak.$length=ai.$length;ak.$capacity=ai.$capacity;ai=ak;}}}return ai;}return ah.ptr;};DK.prototype.object=function(){return this.$val.object();};DK.ptr.prototype.call=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;ax=$f.ax;ay=$f.ay;az=$f.az;ba=$f.ba;bb=$f.bb;bc=$f.bc;bd=$f.bd;be=$f.be;bf=$f.bf;bg=$f.bg;bh=$f.bh;bi=$f.bi;bj=$f.bj;bk=$f.bk;bl=$f.bl;bm=$f.bm;bn=$f.bn;bo=$f.bo;bp=$f.bp;bq=$f.bq;br=$f.br;bs=$f.bs;bt=$f.bt;bu=$f.bu;bv=$f.bv;bw=$f.bw;bx=$f.bx;by=$f.by;bz=$f.bz;ca=$f.ca;cb=$f.cb;cc=$f.cc;cd=$f.cd;ce=$f.ce;cf=$f.cf;cg=$f.cg;ch=$f.ch;ci=$f.ci;cj=$f.cj;ck=$f.ck;cl=$f.cl;cm=$f.cm;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:aj=this;ak=aj.typ;al=0;am=null;if(!((((aj.flag&512)>>>0)===0))){an=AR(ah,aj,(aj.flag>>0)>>10>>0);ak=an[1];al=an[2];am=aj.object();if(N(aj.typ)){am=new(I(aj.typ))(am);}}else{al=aj.object();am=undefined;}if(al===0){$panic(new $String("reflect.Value.Call: call of nil function"));}ao=ah==="CallSlice";ap=ak.NumIn();if(ao){if(!ak.IsVariadic()){$panic(new $String("reflect: CallSlice of non-variadic function"));}if(ai.$lengthap){$panic(new $String("reflect: CallSlice with too many input arguments"));}}else{if(ak.IsVariadic()){ap=ap-(1)>>0;}if(ai.$lengthap){$panic(new $String("reflect: Call with too many input arguments"));}}aq=ai;ar=0;while(true){if(!(ar=aq.$length)?$throwRuntimeError("index out of range"):aq.$array[aq.$offset+ar]);if(as.Kind()===0){$panic(new $String("reflect: "+ah+" using zero Value argument"));}ar++;}at=0;case 1:if(!(at=ai.$length)?$throwRuntimeError("index out of range"):ai.$array[ai.$offset+at]).Type();av=ak.In(at);aw=au;ax=av;ay=aw.AssignableTo(ax);$s=5;case 5:if($c){$c=false;ay=ay.$blk();}if(ay&&ay.$blk!==undefined){break s;}if(!ay){$s=3;continue;}$s=4;continue;case 3:az=aw.String();$s=6;case 6:if($c){$c=false;az=az.$blk();}if(az&&az.$blk!==undefined){break s;}ba=ax.String();$s=7;case 7:if($c){$c=false;ba=ba.$blk();}if(ba&&ba.$blk!==undefined){break s;}$panic(new $String("reflect: "+ah+" using "+az+" as type "+ba));case 4:at=at+(1)>>0;$s=1;continue;case 2:if(!ao&&ak.IsVariadic()){$s=8;continue;}$s=9;continue;case 8:bb=ai.$length-ap>>0;bc=Q(ak.In(ap),bb,bb);$s=10;case 10:if($c){$c=false;bc=bc.$blk();}if(bc&&bc.$blk!==undefined){break s;}bd=bc;be=ak.In(ap).Elem();$s=11;case 11:if($c){$c=false;be=be.$blk();}if(be&&be.$blk!==undefined){break s;}bf=be;bg=0;case 12:if(!(bg>0,((bh<0||bh>=ai.$length)?$throwRuntimeError("index out of range"):ai.$array[ai.$offset+bh]));bj=bi.Type();bk=bj.AssignableTo(bf);$s=16;case 16:if($c){$c=false;bk=bk.$blk();}if(bk&&bk.$blk!==undefined){break s;}if(!bk){$s=14;continue;}$s=15;continue;case 14:bl=bj.String();$s=17;case 17:if($c){$c=false;bl=bl.$blk();}if(bl&&bl.$blk!==undefined){break s;}bm=bf.String();$s=18;case 18:if($c){$c=false;bm=bm.$blk();}if(bm&&bm.$blk!==undefined){break s;}$panic(new $String("reflect: cannot use "+bl+" as type "+bm+" in "+ah));case 15:bn=bd.Index(bg);$s=19;case 19:if($c){$c=false;bn=bn.$blk();}if(bn&&bn.$blk!==undefined){break s;}$r=bn.Set(bi);$s=20;case 20:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}bg=bg+(1)>>0;$s=12;continue;case 13:bo=ai;ai=$makeSlice(GW,(ap+1>>0));$copySlice($subslice(ai,0,ap),bo);((ap<0||ap>=ai.$length)?$throwRuntimeError("index out of range"):ai.$array[ai.$offset+ap]=bd);case 9:bp=ai.$length;if(!((bp===ak.NumIn()))){$panic(new $String("reflect.Value.Call: wrong argument count"));}bq=ak.NumOut();br=new($global.Array)(ak.NumIn());bs=ai;bt=0;case 21:if(!(bt=bs.$length)?$throwRuntimeError("index out of range"):bs.$array[bs.$offset+bt]);bw=ak.In(bu);bx=ak.In(bu).common();$s=23;case 23:if($c){$c=false;bx=bx.$blk();}if(bx&&bx.$blk!==undefined){break s;}by=bx;bz=0;ca=bv.assignTo("reflect.Value.Call",by,bz);$s=24;case 24:if($c){$c=false;ca=ca.$blk();}if(ca&&ca.$blk!==undefined){break s;}cb=ca.object();$s=25;case 25:if($c){$c=false;cb=cb.$blk();}if(cb&&cb.$blk!==undefined){break s;}cc=cb;cd=AZ(bw,cc);$s=26;case 26:if($c){$c=false;cd=cd.$blk();}if(cd&&cd.$blk!==undefined){break s;}br[bu]=cd;bt++;$s=21;continue;case 22:ce=AW(new GJ([new $jsObjectPtr(al),new $jsObjectPtr(am),new $jsObjectPtr(br)]));$s=27;case 27:if($c){$c=false;ce=ce.$blk();}if(ce&&ce.$blk!==undefined){break s;}cf=ce;cg=bq;if(cg===(0)){$s=29;continue;}if(cg===(1)){$s=30;continue;}$s=31;continue;case 29:return GW.nil;case 30:ch=P(ak.Out(0),AY(ak.Out(0),cf),0);$s=33;case 33:if($c){$c=false;ch=ch.$blk();}if(ch&&ch.$blk!==undefined){break s;}$s=34;case 34:return new GW([$clone(ch,DK)]);case 31:ci=$makeSlice(GW,bq);cj=ci;ck=0;case 35:if(!(ck=ci.$length)?$throwRuntimeError("index out of range"):ci.$array[ci.$offset+cl]=cm);ck++;$s=35;continue;case 36:return ci;case 32:case 28:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.call};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.ax=ax;$f.ay=ay;$f.az=az;$f.ba=ba;$f.bb=bb;$f.bc=bc;$f.bd=bd;$f.be=be;$f.bf=bf;$f.bg=bg;$f.bh=bh;$f.bi=bi;$f.bj=bj;$f.bk=bk;$f.bl=bl;$f.bm=bm;$f.bn=bn;$f.bo=bo;$f.bp=bp;$f.bq=bq;$f.br=br;$f.bs=bs;$f.bt=bt;$f.bu=bu;$f.bv=bv;$f.bw=bw;$f.bx=bx;$f.by=by;$f.bz=bz;$f.ca=ca;$f.cb=cb;$f.cc=cc;$f.cd=cd;$f.ce=ce;$f.cf=cf;$f.cg=cg;$f.ch=ch;$f.ci=ci;$f.cj=cj;$f.ck=ck;$f.cl=cl;$f.cm=cm;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.call=function(ah,ai){return this.$val.call(ah,ai);};DK.ptr.prototype.Cap=function(){var $ptr,ah,ai,aj;ah=this;ai=new DL(ah.flag).kind();aj=ai;if(aj===(17)){return ah.typ.Len();}else if((aj===(18))||(aj===(23))){return $parseInt(ah.object().$capacity)>>0;}$panic(new DO.ptr("reflect.Value.Cap",ai));};DK.prototype.Cap=function(){return this.$val.Cap();};AY=function(ah,ai){var $ptr,ah,ai;if($interfaceIsEqual(ah,AX)){return new(I(AX))(ai);}return ai;};AZ=function(ah,ai){var $ptr,ah,ai;if($interfaceIsEqual(ah,AX)){return ai.object;}return ai;};DK.ptr.prototype.Elem=function(){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=this;ai=new DL(ah.flag).kind();aj=ai;if(aj===(20)){$s=2;continue;}if(aj===(22)){$s=3;continue;}$s=4;continue;case 2:ak=ah.object();if(ak===$ifaceNil){return new DK.ptr(FX.nil,0,0);}al=J(ak.constructor);am=P(al,ak.$val,(ah.flag&96)>>>0);$s=6;case 6:if($c){$c=false;am=am.$blk();}if(am&&am.$blk!==undefined){break s;}$s=7;case 7:return am;case 3:if(ah.IsNil()){return new DK.ptr(FX.nil,0,0);}an=ah.object();ao=ah.typ.kindType;ap=(((((ah.flag&96)>>>0)|128)>>>0)|256)>>>0;ap=(ap|((ao.elem.Kind()>>>0)))>>>0;return new DK.ptr(ao.elem,AY(ao.elem,an),ap);case 4:$panic(new DO.ptr("reflect.Value.Elem",ai));case 5:case 1:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Elem};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Elem=function(){return this.$val.Elem();};DK.ptr.prototype.Field=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=[ai];aj=[aj];ak=[ak];al=[al];am=this;new DL(am.flag).mustBe(25);an=am.typ.kindType;if(ah<0||ah>=an.fields.$length){$panic(new $String("reflect: Field index out of range"));}ak[0]=$internalize(I(am.typ).fields[ah].prop,$String);ap=(ao=an.fields,((ah<0||ah>=ao.$length)?$throwRuntimeError("index out of range"):ao.$array[ao.$offset+ah]));ai[0]=ap.typ;aq=(((am.flag&416)>>>0)|(ai[0].Kind()>>>0))>>>0;if(!(ap.pkgPath===GP.nil)){if(ap.name===GP.nil){aq=(aq|(64))>>>0;}else{aq=(aq|(32))>>>0;}}as=(ar=an.fields,((ah<0||ah>=ar.$length)?$throwRuntimeError("index out of range"):ar.$array[ar.$offset+ah])).tag;if(!(as===GP.nil)&&!((ah===0))){$s=1;continue;}$s=2;continue;case 1:al[0]=BA(as.$get());if(!(al[0]==="")){$s=3;continue;}$s=4;continue;case 3:case 5:at=[at];au=am.Field(0);$s=7;case 7:if($c){$c=false;au=au.$blk();}if(au&&au.$blk!==undefined){break s;}am=au;if(am.typ===AX){$s=8;continue;}$s=9;continue;case 8:at[0]=am.object().object;return new DK.ptr(ai[0],new(I(CK(ai[0])))((function(ai,aj,ak,al,at){return function(){var $ptr;return $internalize(at[0][$externalize(al[0],$String)],I(ai[0]));};})(ai,aj,ak,al,at),(function(ai,aj,ak,al,at){return function(av){var $ptr,av;at[0][$externalize(al[0],$String)]=$externalize(av,I(ai[0]));};})(ai,aj,ak,al,at)),aq);case 9:if(am.typ.Kind()===22){$s=10;continue;}$s=11;continue;case 10:av=am.Elem();$s=12;case 12:if($c){$c=false;av=av.$blk();}if(av&&av.$blk!==undefined){break s;}am=av;case 11:$s=5;continue;case 6:case 4:case 2:aj[0]=am.ptr;if(!((((aq&128)>>>0)===0))&&!((ai[0].Kind()===17))&&!((ai[0].Kind()===25))){$s=13;continue;}$s=14;continue;case 13:return new DK.ptr(ai[0],new(I(CK(ai[0])))((function(ai,aj,ak,al){return function(){var $ptr;return AY(ai[0],aj[0][$externalize(ak[0],$String)]);};})(ai,aj,ak,al),(function(ai,aj,ak,al){return function(aw){var $ptr,aw;aj[0][$externalize(ak[0],$String)]=AZ(ai[0],aw);};})(ai,aj,ak,al)),aq);case 14:aw=P(ai[0],AY(ai[0],aj[0][$externalize(ak[0],$String)]),aq);$s=15;case 15:if($c){$c=false;aw=aw.$blk();}if(aw&&aw.$blk!==undefined){break s;}$s=16;case 16:return aw;}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Field};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Field=function(ah){return this.$val.Field(ah);};BA=function(ah){var $ptr,ah,ai,aj,ak,al,am;while(true){if(!(!(ah===""))){break;}ai=0;while(true){if(!(ai>0;}ah=ah.substring(ai);if(ah===""){break;}ai=0;while(true){if(!(ai>0;}if((ai+1>>0)>=ah.length||!((ah.charCodeAt(ai)===58))||!((ah.charCodeAt((ai+1>>0))===34))){break;}aj=ah.substring(0,ai);ah=ah.substring((ai+1>>0));ai=1;while(true){if(!(ai>0;}ai=ai+(1)>>0;}if(ai>=ah.length){break;}ak=ah.substring(0,(ai+1>>0));ah=ah.substring((ai+1>>0));if(aj==="js"){al=B.Unquote(ak);am=al[0];return am;}}return"";};DK.ptr.prototype.Index=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;ax=$f.ax;ay=$f.ay;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=[ah];ai=[ai];aj=[aj];ak=[ak];al=[al];am=[am];an=this;ao=new DL(an.flag).kind();ap=ao;if(ap===(17)){$s=2;continue;}if(ap===(23)){$s=3;continue;}if(ap===(24)){$s=4;continue;}$s=5;continue;case 2:aq=an.typ.kindType;if(ah[0]<0||ah[0]>(aq.len>>0)){$panic(new $String("reflect: array index out of range"));}am[0]=aq.elem;ar=(an.flag&480)>>>0;ar=(ar|((am[0].Kind()>>>0)))>>>0;ai[0]=an.ptr;if(!((((ar&128)>>>0)===0))&&!((am[0].Kind()===17))&&!((am[0].Kind()===25))){$s=7;continue;}$s=8;continue;case 7:return new DK.ptr(am[0],new(I(CK(am[0])))((function(ah,ai,aj,ak,al,am){return function(){var $ptr;return AY(am[0],ai[0][ah[0]]);};})(ah,ai,aj,ak,al,am),(function(ah,ai,aj,ak,al,am){return function(as){var $ptr,as;ai[0][ah[0]]=AZ(am[0],as);};})(ah,ai,aj,ak,al,am)),ar);case 8:as=P(am[0],AY(am[0],ai[0][ah[0]]),ar);$s=9;case 9:if($c){$c=false;as=as.$blk();}if(as&&as.$blk!==undefined){break s;}$s=10;case 10:return as;case 3:at=an.object();if(ah[0]<0||ah[0]>=($parseInt(at.$length)>>0)){$panic(new $String("reflect: slice index out of range"));}au=an.typ.kindType;aj[0]=au.elem;av=(384|((an.flag&96)>>>0))>>>0;av=(av|((aj[0].Kind()>>>0)))>>>0;ah[0]=ah[0]+(($parseInt(at.$offset)>>0))>>0;ak[0]=at.$array;if(!((((av&128)>>>0)===0))&&!((aj[0].Kind()===17))&&!((aj[0].Kind()===25))){$s=11;continue;}$s=12;continue;case 11:return new DK.ptr(aj[0],new(I(CK(aj[0])))((function(ah,ai,aj,ak,al,am){return function(){var $ptr;return AY(aj[0],ak[0][ah[0]]);};})(ah,ai,aj,ak,al,am),(function(ah,ai,aj,ak,al,am){return function(aw){var $ptr,aw;ak[0][ah[0]]=AZ(aj[0],aw);};})(ah,ai,aj,ak,al,am)),av);case 12:aw=P(aj[0],AY(aj[0],ak[0][ah[0]]),av);$s=13;case 13:if($c){$c=false;aw=aw.$blk();}if(aw&&aw.$blk!==undefined){break s;}$s=14;case 14:return aw;case 4:ax=an.ptr.$get();if(ah[0]<0||ah[0]>=ax.length){$panic(new $String("reflect: string index out of range"));}ay=(((an.flag&96)>>>0)|8)>>>0;al[0]=ax.charCodeAt(ah[0]);return new DK.ptr(DX,(al.$ptr||(al.$ptr=new GO(function(){return this.$target[0];},function($v){this.$target[0]=$v;},al))),(ay|128)>>>0);case 5:$panic(new DO.ptr("reflect.Value.Index",ao));case 6:case 1:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Index};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.ax=ax;$f.ay=ay;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Index=function(ah){return this.$val.Index(ah);};DK.ptr.prototype.InterfaceData=function(){var $ptr,ah;ah=this;$panic(A.New("InterfaceData is not supported by GopherJS"));};DK.prototype.InterfaceData=function(){return this.$val.InterfaceData();};DK.ptr.prototype.IsNil=function(){var $ptr,ah,ai,aj;ah=this;ai=new DL(ah.flag).kind();aj=ai;if((aj===(22))||(aj===(23))){return ah.object()===I(ah.typ).nil;}else if(aj===(18)){return ah.object()===$chanNil;}else if(aj===(19)){return ah.object()===$throwNilPointerError;}else if(aj===(21)){return ah.object()===false;}else if(aj===(20)){return ah.object()===$ifaceNil;}else{$panic(new DO.ptr("reflect.Value.IsNil",ai));}};DK.prototype.IsNil=function(){return this.$val.IsNil();};DK.ptr.prototype.Len=function(){var $ptr,ah,ai,aj;ah=this;ai=new DL(ah.flag).kind();aj=ai;if((aj===(17))||(aj===(24))){return $parseInt(ah.object().length);}else if(aj===(23)){return $parseInt(ah.object().$length)>>0;}else if(aj===(18)){return $parseInt(ah.object().$buffer.length)>>0;}else if(aj===(21)){return $parseInt($keys(ah.object()).length);}else{$panic(new DO.ptr("reflect.Value.Len",ai));}};DK.prototype.Len=function(){return this.$val.Len();};DK.ptr.prototype.Pointer=function(){var $ptr,ah,ai,aj;ah=this;ai=new DL(ah.flag).kind();aj=ai;if((aj===(18))||(aj===(21))||(aj===(22))||(aj===(26))){if(ah.IsNil()){return 0;}return ah.object();}else if(aj===(19)){if(ah.IsNil()){return 0;}return 1;}else if(aj===(23)){if(ah.IsNil()){return 0;}return ah.object().$array;}else{$panic(new DO.ptr("reflect.Value.Pointer",ai));}};DK.prototype.Pointer=function(){return this.$val.Pointer();};DK.ptr.prototype.Set=function(ah){var $ptr,ah,ai,aj,ak,al,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;ai=this;new DL(ai.flag).mustBeAssignable();new DL(ah.flag).mustBeExported();aj=ah.assignTo("reflect.Set",ai.typ,0);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}ah=aj;if(!((((ai.flag&128)>>>0)===0))){$s=2;continue;}$s=3;continue;case 2:ak=ai.typ.Kind();if(ak===(17)){$s=5;continue;}if(ak===(20)){$s=6;continue;}if(ak===(25)){$s=7;continue;}$s=8;continue;case 5:I(ai.typ).copy(ai.ptr,ah.ptr);$s=9;continue;case 6:al=AS(ah,false);$s=10;case 10:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}ai.ptr.$set(al);$s=9;continue;case 7:O(ai.ptr,ah.ptr,ai.typ);$s=9;continue;case 8:ai.ptr.$set(ah.object());case 9:case 4:return;case 3:ai.ptr=ah.ptr;$s=-1;case-1:}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Set};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Set=function(ah){return this.$val.Set(ah);};DK.ptr.prototype.SetBytes=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;new DL(ai.flag).mustBeAssignable();new DL(ai.flag).mustBe(23);aj=ai.typ.Elem().Kind();$s=3;case 3:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}if(!((aj===8))){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect.Value.SetBytes of non-byte slice"));case 2:ak=ah;if(!(ai.typ.Name()==="")){al=true;$s=6;continue s;}am=ai.typ.Elem().Name();$s=7;case 7:if($c){$c=false;am=am.$blk();}if(am&&am.$blk!==undefined){break s;}al=!(am==="");case 6:if(al){$s=4;continue;}$s=5;continue;case 4:an=new(I(ai.typ))(ak.$array);an.$offset=ak.$offset;an.$length=ak.$length;an.$capacity=ak.$capacity;ak=an;case 5:ai.ptr.$set(ak);$s=-1;case-1:}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.SetBytes};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.SetBytes=function(ah){return this.$val.SetBytes(ah);};DK.ptr.prototype.SetCap=function(ah){var $ptr,ah,ai,aj,ak;ai=this;new DL(ai.flag).mustBeAssignable();new DL(ai.flag).mustBe(23);aj=ai.ptr.$get();if(ah<($parseInt(aj.$length)>>0)||ah>($parseInt(aj.$capacity)>>0)){$panic(new $String("reflect: slice capacity out of range in SetCap"));}ak=new(I(ai.typ))(aj.$array);ak.$offset=aj.$offset;ak.$length=aj.$length;ak.$capacity=ah;ai.ptr.$set(ak);};DK.prototype.SetCap=function(ah){return this.$val.SetCap(ah);};DK.ptr.prototype.SetLen=function(ah){var $ptr,ah,ai,aj,ak;ai=this;new DL(ai.flag).mustBeAssignable();new DL(ai.flag).mustBe(23);aj=ai.ptr.$get();if(ah<0||ah>($parseInt(aj.$capacity)>>0)){$panic(new $String("reflect: slice length out of range in SetLen"));}ak=new(I(ai.typ))(aj.$array);ak.$offset=aj.$offset;ak.$length=ah;ak.$capacity=aj.$capacity;ai.ptr.$set(ak);};DK.prototype.SetLen=function(ah){return this.$val.SetLen(ah);};DK.ptr.prototype.Slice=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:aj=this;ak=0;al=$ifaceNil;am=null;an=new DL(aj.flag).kind();ao=an;if(ao===(17)){$s=2;continue;}if(ao===(23)){$s=3;continue;}if(ao===(24)){$s=4;continue;}$s=5;continue;case 2:if(((aj.flag&256)>>>0)===0){$panic(new $String("reflect.Value.Slice: slice of unaddressable array"));}ap=aj.typ.kindType;ak=(ap.len>>0);al=X(ap.elem);am=new(I(al))(aj.object());$s=6;continue;case 3:al=aj.typ;am=aj.object();ak=$parseInt(am.$capacity)>>0;$s=6;continue;case 4:aq=aj.ptr.$get();if(ah<0||aiaq.length){$panic(new $String("reflect.Value.Slice: string slice index out of bounds"));}ar=S(new $String(aq.substring(ah,ai)));$s=7;case 7:if($c){$c=false;ar=ar.$blk();}if(ar&&ar.$blk!==undefined){break s;}$s=8;case 8:return ar;case 5:$panic(new DO.ptr("reflect.Value.Slice",an));case 6:case 1:if(ah<0||aiak){$panic(new $String("reflect.Value.Slice: slice index out of bounds"));}as=P(al,$subslice(am,ah,ai),(aj.flag&96)>>>0);$s=9;case 9:if($c){$c=false;as=as.$blk();}if(as&&as.$blk!==undefined){break s;}$s=10;case 10:return as;}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Slice};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Slice=function(ah,ai){return this.$val.Slice(ah,ai);};DK.ptr.prototype.Slice3=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ak=this;al=0;am=$ifaceNil;an=null;ao=new DL(ak.flag).kind();ap=ao;if(ap===(17)){if(((ak.flag&256)>>>0)===0){$panic(new $String("reflect.Value.Slice: slice of unaddressable array"));}aq=ak.typ.kindType;al=(aq.len>>0);am=X(aq.elem);an=new(I(am))(ak.object());}else if(ap===(23)){am=ak.typ;an=ak.object();al=$parseInt(an.$capacity)>>0;}else{$panic(new DO.ptr("reflect.Value.Slice3",ao));}if(ah<0||aial){$panic(new $String("reflect.Value.Slice3: slice index out of bounds"));}ar=P(am,$subslice(an,ah,ai,aj),(ak.flag&96)>>>0);$s=1;case 1:if($c){$c=false;ar=ar.$blk();}if(ar&&ar.$blk!==undefined){break s;}$s=2;case 2:return ar;}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Slice3};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Slice3=function(ah,ai,aj){return this.$val.Slice3(ah,ai,aj);};DK.ptr.prototype.Close=function(){var $ptr,ah;ah=this;new DL(ah.flag).mustBe(18);new DL(ah.flag).mustBeExported();$close(ah.object());};DK.prototype.Close=function(){return this.$val.Close();};BC=function(ah,ai,aj,ak){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:al=false;am=false;an=new HB([new GV([ai])]);if(aj){an=$append(an,new GV([]));}ao=BB(new GJ([an]));$s=1;case 1:if($c){$c=false;ao=ao.$blk();}if(ao&&ao.$blk!==undefined){break s;}ap=ao;if(aj&&(($parseInt(ap[0])>>0)===1)){aq=false;ar=false;al=aq;am=ar;return[al,am];}as=ap[1];ak.$set(as[0]);at=true;au=!!(as[1]);al=at;am=au;return[al,am];}return;}if($f===undefined){$f={$blk:BC};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.$s=$s;$f.$r=$r;return $f;};BD=function(ah,ai,aj,ak){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:al=new HB([new GV([ai,aj.$get()])]);if(ak){al=$append(al,new GV([]));}am=BB(new GJ([al]));$s=1;case 1:if($c){$c=false;am=am.$blk();}if(am&&am.$blk!==undefined){break s;}an=am;if(ak&&(($parseInt(an[0])>>0)===1)){return false;}return true;}return;}if($f===undefined){$f={$blk:BD};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};BO.prototype.String=function(){var $ptr,ah;ah=this.$val;if((ah>>0)=CF.$length)?$throwRuntimeError("index out of range"):CF.$array[CF.$offset+ah]);}return"kind"+B.Itoa((ah>>0));};$ptrType(BO).prototype.String=function(){return new BO(this.$get()).String();};BS.ptr.prototype.uncommon=function(){var $ptr,ah;ah=this;return ah;};BS.prototype.uncommon=function(){return this.$val.uncommon();};BS.ptr.prototype.PkgPath=function(){var $ptr,ah;ah=this;if(ah===GQ.nil||ah.pkgPath===GP.nil){return"";}return ah.pkgPath.$get();};BS.prototype.PkgPath=function(){return this.$val.PkgPath();};BS.ptr.prototype.Name=function(){var $ptr,ah;ah=this;if(ah===GQ.nil||ah.name===GP.nil){return"";}return ah.name.$get();};BS.prototype.Name=function(){return this.$val.Name();};BP.ptr.prototype.String=function(){var $ptr,ah;ah=this;return ah.string.$get();};BP.prototype.String=function(){return this.$val.String();};BP.ptr.prototype.Size=function(){var $ptr,ah;ah=this;return ah.size;};BP.prototype.Size=function(){return this.$val.Size();};BP.ptr.prototype.Bits=function(){var $ptr,ah,ai;ah=this;if(ah===FX.nil){$panic(new $String("reflect: Bits of nil Type"));}ai=ah.Kind();if(ai<2||ai>16){$panic(new $String("reflect: Bits of non-arithmetic Type "+ah.String()));}return $imul((ah.size>>0),8);};BP.prototype.Bits=function(){return this.$val.Bits();};BP.ptr.prototype.Align=function(){var $ptr,ah;ah=this;return(ah.align>>0);};BP.prototype.Align=function(){return this.$val.Align();};BP.ptr.prototype.FieldAlign=function(){var $ptr,ah;ah=this;return(ah.fieldAlign>>0);};BP.prototype.FieldAlign=function(){return this.$val.FieldAlign();};BP.ptr.prototype.Kind=function(){var $ptr,ah;ah=this;return(((ah.kind&31)>>>0)>>>0);};BP.prototype.Kind=function(){return this.$val.Kind();};BP.ptr.prototype.common=function(){var $ptr,ah;ah=this;return ah;};BP.prototype.common=function(){return this.$val.common();};BS.ptr.prototype.NumMethod=function(){var $ptr,ah;ah=this;if(ah===GQ.nil){return 0;}return ah.methods.$length;};BS.prototype.NumMethod=function(){return this.$val.NumMethod();};BS.ptr.prototype.MethodByName=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar;ai=new CE.ptr("","",$ifaceNil,new DK.ptr(FX.nil,0,0),0);aj=false;ak=this;if(ak===GQ.nil){return[ai,aj];}al=HE.nil;am=ak.methods;an=0;while(true){if(!(an=ap.$length)?$throwRuntimeError("index out of range"):ap.$array[ap.$offset+ao]));if(!(al.name===GP.nil)&&al.name.$get()===ah){aq=$clone(ak.Method(ao),CE);ar=true;CE.copy(ai,aq);aj=ar;return[ai,aj];}an++;}return[ai,aj];};BS.prototype.MethodByName=function(ah){return this.$val.MethodByName(ah);};BP.ptr.prototype.NumMethod=function(){var $ptr,ah,ai;ah=this;if(ah.Kind()===20){ai=ah.kindType;return ai.NumMethod();}return ah.uncommonType.NumMethod();};BP.prototype.NumMethod=function(){return this.$val.NumMethod();};BP.ptr.prototype.Method=function(ah){var $ptr,ah,ai,aj,ak;ai=new CE.ptr("","",$ifaceNil,new DK.ptr(FX.nil,0,0),0);aj=this;if(aj.Kind()===20){ak=aj.kindType;CE.copy(ai,ak.Method(ah));return ai;}CE.copy(ai,aj.uncommonType.Method(ah));return ai;};BP.prototype.Method=function(ah){return this.$val.Method(ah);};BP.ptr.prototype.MethodByName=function(ah){var $ptr,ah,ai,aj,ak,al,am,an;ai=new CE.ptr("","",$ifaceNil,new DK.ptr(FX.nil,0,0),0);aj=false;ak=this;if(ak.Kind()===20){al=ak.kindType;am=al.MethodByName(ah);CE.copy(ai,am[0]);aj=am[1];return[ai,aj];}an=ak.uncommonType.MethodByName(ah);CE.copy(ai,an[0]);aj=an[1];return[ai,aj];};BP.prototype.MethodByName=function(ah){return this.$val.MethodByName(ah);};BP.ptr.prototype.PkgPath=function(){var $ptr,ah;ah=this;return ah.uncommonType.PkgPath();};BP.prototype.PkgPath=function(){return this.$val.PkgPath();};BP.ptr.prototype.Name=function(){var $ptr,ah;ah=this;return ah.uncommonType.Name();};BP.prototype.Name=function(){return this.$val.Name();};BP.ptr.prototype.ChanDir=function(){var $ptr,ah,ai;ah=this;if(!((ah.Kind()===18))){$panic(new $String("reflect: ChanDir of non-chan type"));}ai=ah.kindType;return(ai.dir>>0);};BP.prototype.ChanDir=function(){return this.$val.ChanDir();};BP.ptr.prototype.IsVariadic=function(){var $ptr,ah,ai;ah=this;if(!((ah.Kind()===19))){$panic(new $String("reflect: IsVariadic of non-func type"));}ai=ah.kindType;return ai.dotdotdot;};BP.prototype.IsVariadic=function(){return this.$val.IsVariadic();};BP.ptr.prototype.Elem=function(){var $ptr,ah,ai,aj,ak,al,am,an;ah=this;ai=ah.Kind();if(ai===(17)){aj=ah.kindType;return DC(aj.elem);}else if(ai===(18)){ak=ah.kindType;return DC(ak.elem);}else if(ai===(21)){al=ah.kindType;return DC(al.elem);}else if(ai===(22)){am=ah.kindType;return DC(am.elem);}else if(ai===(23)){an=ah.kindType;return DC(an.elem);}$panic(new $String("reflect: Elem of invalid type"));};BP.prototype.Elem=function(){return this.$val.Elem();};BP.ptr.prototype.Field=function(ah){var $ptr,ah,ai,aj,ak,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;if(!((ai.Kind()===25))){$panic(new $String("reflect: Field of non-struct type"));}aj=ai.kindType;ak=aj.Field(ah);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}$s=2;case 2:return ak;}return;}if($f===undefined){$f={$blk:BP.ptr.prototype.Field};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.$s=$s;$f.$r=$r;return $f;};BP.prototype.Field=function(ah){return this.$val.Field(ah);};BP.ptr.prototype.FieldByIndex=function(ah){var $ptr,ah,ai,aj,ak,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;if(!((ai.Kind()===25))){$panic(new $String("reflect: FieldByIndex of non-struct type"));}aj=ai.kindType;ak=aj.FieldByIndex(ah);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}$s=2;case 2:return ak;}return;}if($f===undefined){$f={$blk:BP.ptr.prototype.FieldByIndex};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.$s=$s;$f.$r=$r;return $f;};BP.prototype.FieldByIndex=function(ah){return this.$val.FieldByIndex(ah);};BP.ptr.prototype.FieldByName=function(ah){var $ptr,ah,ai,aj,ak,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;if(!((ai.Kind()===25))){$panic(new $String("reflect: FieldByName of non-struct type"));}aj=ai.kindType;ak=aj.FieldByName(ah);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}$s=2;case 2:return ak;}return;}if($f===undefined){$f={$blk:BP.ptr.prototype.FieldByName};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.$s=$s;$f.$r=$r;return $f;};BP.prototype.FieldByName=function(ah){return this.$val.FieldByName(ah);};BP.ptr.prototype.FieldByNameFunc=function(ah){var $ptr,ah,ai,aj,ak,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;if(!((ai.Kind()===25))){$panic(new $String("reflect: FieldByNameFunc of non-struct type"));}aj=ai.kindType;ak=aj.FieldByNameFunc(ah);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}$s=2;case 2:return ak;}return;}if($f===undefined){$f={$blk:BP.ptr.prototype.FieldByNameFunc};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.$s=$s;$f.$r=$r;return $f;};BP.prototype.FieldByNameFunc=function(ah){return this.$val.FieldByNameFunc(ah);};BP.ptr.prototype.In=function(ah){var $ptr,ah,ai,aj,ak;ai=this;if(!((ai.Kind()===19))){$panic(new $String("reflect: In of non-func type"));}aj=ai.kindType;return DC((ak=aj.in$2,((ah<0||ah>=ak.$length)?$throwRuntimeError("index out of range"):ak.$array[ak.$offset+ah])));};BP.prototype.In=function(ah){return this.$val.In(ah);};BP.ptr.prototype.Key=function(){var $ptr,ah,ai;ah=this;if(!((ah.Kind()===21))){$panic(new $String("reflect: Key of non-map type"));}ai=ah.kindType;return DC(ai.key);};BP.prototype.Key=function(){return this.$val.Key();};BP.ptr.prototype.Len=function(){var $ptr,ah,ai;ah=this;if(!((ah.Kind()===17))){$panic(new $String("reflect: Len of non-array type"));}ai=ah.kindType;return(ai.len>>0);};BP.prototype.Len=function(){return this.$val.Len();};BP.ptr.prototype.NumField=function(){var $ptr,ah,ai;ah=this;if(!((ah.Kind()===25))){$panic(new $String("reflect: NumField of non-struct type"));}ai=ah.kindType;return ai.fields.$length;};BP.prototype.NumField=function(){return this.$val.NumField();};BP.ptr.prototype.NumIn=function(){var $ptr,ah,ai;ah=this;if(!((ah.Kind()===19))){$panic(new $String("reflect: NumIn of non-func type"));}ai=ah.kindType;return ai.in$2.$length;};BP.prototype.NumIn=function(){return this.$val.NumIn();};BP.ptr.prototype.NumOut=function(){var $ptr,ah,ai;ah=this;if(!((ah.Kind()===19))){$panic(new $String("reflect: NumOut of non-func type"));}ai=ah.kindType;return ai.out.$length;};BP.prototype.NumOut=function(){return this.$val.NumOut();};BP.ptr.prototype.Out=function(ah){var $ptr,ah,ai,aj,ak;ai=this;if(!((ai.Kind()===19))){$panic(new $String("reflect: Out of non-func type"));}aj=ai.kindType;return DC((ak=aj.out,((ah<0||ah>=ak.$length)?$throwRuntimeError("index out of range"):ak.$array[ak.$offset+ah])));};BP.prototype.Out=function(ah){return this.$val.Out(ah);};BT.prototype.String=function(){var $ptr,ah,ai;ah=this.$val;ai=ah;if(ai===(2)){return"chan<-";}else if(ai===(1)){return"<-chan";}else if(ai===(3)){return"chan";}return"ChanDir"+B.Itoa((ah>>0));};$ptrType(BT).prototype.String=function(){return new BT(this.$get()).String();};BY.ptr.prototype.Method=function(ah){var $ptr,ah,ai,aj,ak,al;ai=new CE.ptr("","",$ifaceNil,new DK.ptr(FX.nil,0,0),0);aj=this;if(ah<0||ah>=aj.methods.$length){return ai;}al=(ak=aj.methods,((ah<0||ah>=ak.$length)?$throwRuntimeError("index out of range"):ak.$array[ak.$offset+ah]));ai.Name=al.name.$get();if(!(al.pkgPath===GP.nil)){ai.PkgPath=al.pkgPath.$get();}ai.Type=DC(al.typ);ai.Index=ah;return ai;};BY.prototype.Method=function(ah){return this.$val.Method(ah);};BY.ptr.prototype.NumMethod=function(){var $ptr,ah;ah=this;return ah.methods.$length;};BY.prototype.NumMethod=function(){return this.$val.NumMethod();};BY.ptr.prototype.MethodByName=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar;ai=new CE.ptr("","",$ifaceNil,new DK.ptr(FX.nil,0,0),0);aj=false;ak=this;if(ak===HF.nil){return[ai,aj];}al=HG.nil;am=ak.methods;an=0;while(true){if(!(an=ap.$length)?$throwRuntimeError("index out of range"):ap.$array[ap.$offset+ao]));if(al.name.$get()===ah){aq=$clone(ak.Method(ao),CE);ar=true;CE.copy(ai,aq);aj=ar;return[ai,aj];}an++;}return[ai,aj];};BY.prototype.MethodByName=function(ah){return this.$val.MethodByName(ah);};CH.prototype.Get=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao;ai=this.$val;while(true){if(!(!(ai===""))){break;}aj=0;while(true){if(!(aj>0;}ai=ai.substring(aj);if(ai===""){break;}aj=0;while(true){if(!(aj32&&!((ai.charCodeAt(aj)===58))&&!((ai.charCodeAt(aj)===34))&&!((ai.charCodeAt(aj)===127)))){break;}aj=aj+(1)>>0;}if((aj===0)||(aj+1>>0)>=ai.length||!((ai.charCodeAt(aj)===58))||!((ai.charCodeAt((aj+1>>0))===34))){break;}ak=ai.substring(0,aj);ai=ai.substring((aj+1>>0));aj=1;while(true){if(!(aj>0;}aj=aj+(1)>>0;}if(aj>=ai.length){break;}al=ai.substring(0,(aj+1>>0));ai=ai.substring((aj+1>>0));if(ah===ak){am=B.Unquote(al);an=am[0];ao=am[1];if(!($interfaceIsEqual(ao,$ifaceNil))){break;}return an;}}return"";};$ptrType(CH).prototype.Get=function(ah){return new CH(this.$get()).Get(ah);};CD.ptr.prototype.Field=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=new CG.ptr("","",$ifaceNil,"",0,HH.nil,false);aj=this;if(ah<0||ah>=aj.fields.$length){return ai;}al=(ak=aj.fields,((ah<0||ah>=ak.$length)?$throwRuntimeError("index out of range"):ak.$array[ak.$offset+ah]));ai.Type=DC(al.typ);if(!(al.name===GP.nil)){$s=1;continue;}$s=2;continue;case 1:ai.Name=al.name.$get();$s=3;continue;case 2:am=ai.Type;an=am.Kind();$s=6;case 6:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}if(an===22){$s=4;continue;}$s=5;continue;case 4:ao=am.Elem();$s=7;case 7:if($c){$c=false;ao=ao.$blk();}if(ao&&ao.$blk!==undefined){break s;}am=ao;case 5:ap=am.Name();$s=8;case 8:if($c){$c=false;ap=ap.$blk();}if(ap&&ap.$blk!==undefined){break s;}ai.Name=ap;ai.Anonymous=true;case 3:if(!(al.pkgPath===GP.nil)){ai.PkgPath=al.pkgPath.$get();}if(!(al.tag===GP.nil)){ai.Tag=al.tag.$get();}ai.Offset=al.offset;ai.Index=new HH([ah]);return ai;}return;}if($f===undefined){$f={$blk:CD.ptr.prototype.Field};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.$s=$s;$f.$r=$r;return $f;};CD.prototype.Field=function(ah){return this.$val.Field(ah);};CD.ptr.prototype.FieldByIndex=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=new CG.ptr("","",$ifaceNil,"",0,HH.nil,false);aj=this;ai.Type=DC(aj.rtype);ak=ah;al=0;case 1:if(!(al=ak.$length)?$throwRuntimeError("index out of range"):ak.$array[ak.$offset+al]);if(am>0){$s=3;continue;}$s=4;continue;case 3:ao=ai.Type;aq=ao.Kind();$s=8;case 8:if($c){$c=false;aq=aq.$blk();}if(aq&&aq.$blk!==undefined){break s;}if(!(aq===22)){ap=false;$s=7;continue s;}ar=ao.Elem();$s=9;case 9:if($c){$c=false;ar=ar.$blk();}if(ar&&ar.$blk!==undefined){break s;}as=ar.Kind();$s=10;case 10:if($c){$c=false;as=as.$blk();}if(as&&as.$blk!==undefined){break s;}ap=as===25;case 7:if(ap){$s=5;continue;}$s=6;continue;case 5:at=ao.Elem();$s=11;case 11:if($c){$c=false;at=at.$blk();}if(at&&at.$blk!==undefined){break s;}ao=at;case 6:ai.Type=ao;case 4:au=ai.Type.Field(an);$s=12;case 12:if($c){$c=false;au=au.$blk();}if(au&&au.$blk!==undefined){break s;}CG.copy(ai,au);al++;$s=1;continue;case 2:return ai;}return;}if($f===undefined){$f={$blk:CD.ptr.prototype.FieldByIndex};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.$s=$s;$f.$r=$r;return $f;};CD.prototype.FieldByIndex=function(ah){return this.$val.FieldByIndex(ah);};CD.ptr.prototype.FieldByNameFunc=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;ax=$f.ax;ay=$f.ay;az=$f.az;ba=$f.ba;bb=$f.bb;bc=$f.bc;bd=$f.bd;be=$f.be;bf=$f.bf;bg=$f.bg;bh=$f.bh;bi=$f.bi;bj=$f.bj;bk=$f.bk;bl=$f.bl;bm=$f.bm;bn=$f.bn;bo=$f.bo;bp=$f.bp;bq=$f.bq;br=$f.br;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=new CG.ptr("","",$ifaceNil,"",0,HH.nil,false);aj=false;ak=this;al=new HI([]);am=new HI([new CI.ptr(ak,HH.nil)]);an=false;ao=$makeMap(HJ.keyFor,[]);case 1:if(!(am.$length>0)){$s=2;continue;}ap=am;aq=$subslice(al,0,0);al=ap;am=aq;ar=an;an=false;as=al;at=0;case 3:if(!(at=as.$length)?$throwRuntimeError("index out of range"):as.$array[as.$offset+at]),CI);av=au.typ;if((aw=ao[HJ.keyFor(av)],aw!==undefined?aw.v:false)){$s=5;continue;}$s=6;continue;case 5:at++;$s=3;continue;case 6:ax=av;(ao||$throwRuntimeError("assignment to entry in nil map"))[HJ.keyFor(ax)]={k:ax,v:true};ay=av.fields;az=0;case 7:if(!(az=bb.$length)?$throwRuntimeError("index out of range"):bb.$array[bb.$offset+ba]));bd="";be=FX.nil;if(!(bc.name===GP.nil)){$s=9;continue;}$s=10;continue;case 9:bd=bc.name.$get();$s=11;continue;case 10:be=bc.typ;if(be.Kind()===22){$s=12;continue;}$s=13;continue;case 12:bf=be.Elem().common();$s=14;case 14:if($c){$c=false;bf=bf.$blk();}if(bf&&bf.$blk!==undefined){break s;}be=bf;case 13:bd=be.Name();case 11:bg=ah(bd);$s=17;case 17:if($c){$c=false;bg=bg.$blk();}if(bg&&bg.$blk!==undefined){break s;}if(bg){$s=15;continue;}$s=16;continue;case 15:if((bh=ar[HJ.keyFor(av)],bh!==undefined?bh.v:0)>1||aj){bi=new CG.ptr("","",$ifaceNil,"",0,HH.nil,false);bj=false;CG.copy(ai,bi);aj=bj;return[ai,aj];}bk=av.Field(ba);$s=18;case 18:if($c){$c=false;bk=bk.$blk();}if(bk&&bk.$blk!==undefined){break s;}CG.copy(ai,bk);ai.Index=HH.nil;ai.Index=$appendSlice(ai.Index,au.index);ai.Index=$append(ai.Index,ba);aj=true;az++;$s=7;continue;case 16:if(aj||be===FX.nil||!((be.Kind()===25))){az++;$s=7;continue;}bl=be.kindType;if((bm=an[HJ.keyFor(bl)],bm!==undefined?bm.v:0)>0){bn=bl;(an||$throwRuntimeError("assignment to entry in nil map"))[HJ.keyFor(bn)]={k:bn,v:2};az++;$s=7;continue;}if(an===false){an=$makeMap(HJ.keyFor,[]);}bo=bl;(an||$throwRuntimeError("assignment to entry in nil map"))[HJ.keyFor(bo)]={k:bo,v:1};if((bp=ar[HJ.keyFor(av)],bp!==undefined?bp.v:0)>1){bq=bl;(an||$throwRuntimeError("assignment to entry in nil map"))[HJ.keyFor(bq)]={k:bq,v:2};}br=HH.nil;br=$appendSlice(br,au.index);br=$append(br,ba);am=$append(am,new CI.ptr(bl,br));az++;$s=7;continue;case 8:at++;$s=3;continue;case 4:if(aj){$s=2;continue;}$s=1;continue;case 2:return[ai,aj];}return;}if($f===undefined){$f={$blk:CD.ptr.prototype.FieldByNameFunc};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.ax=ax;$f.ay=ay;$f.az=az;$f.ba=ba;$f.bb=bb;$f.bc=bc;$f.bd=bd;$f.be=be;$f.bf=bf;$f.bg=bg;$f.bh=bh;$f.bi=bi;$f.bj=bj;$f.bk=bk;$f.bl=bl;$f.bm=bm;$f.bn=bn;$f.bo=bo;$f.bp=bp;$f.bq=bq;$f.br=br;$f.$s=$s;$f.$r=$r;return $f;};CD.prototype.FieldByNameFunc=function(ah){return this.$val.FieldByNameFunc(ah);};CD.ptr.prototype.FieldByName=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=[ah];ai=new CG.ptr("","",$ifaceNil,"",0,HH.nil,false);aj=false;ak=this;al=false;if(!(ah[0]==="")){$s=1;continue;}$s=2;continue;case 1:am=ak.fields;an=0;case 3:if(!(an=ap.$length)?$throwRuntimeError("index out of range"):ap.$array[ap.$offset+ao]));if(aq.name===GP.nil){$s=5;continue;}$s=6;continue;case 5:al=true;an++;$s=3;continue;case 6:if(aq.name.$get()===ah[0]){$s=7;continue;}$s=8;continue;case 7:as=ak.Field(ao);$s=9;case 9:if($c){$c=false;as=as.$blk();}if(as&&as.$blk!==undefined){break s;}ar=$clone(as,CG);at=true;CG.copy(ai,ar);aj=at;$s=10;case 10:return[ai,aj];case 8:an++;$s=3;continue;case 4:case 2:if(!al){return[ai,aj];}av=ak.FieldByNameFunc((function(ah){return function(av){var $ptr,av;return av===ah[0];};})(ah));$s=11;case 11:if($c){$c=false;av=av.$blk();}if(av&&av.$blk!==undefined){break s;}au=av;CG.copy(ai,au[0]);aj=au[1];$s=12;case 12:return[ai,aj];}return;}if($f===undefined){$f={$blk:CD.ptr.prototype.FieldByName};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.$s=$s;$f.$r=$r;return $f;};CD.prototype.FieldByName=function(ah){return this.$val.FieldByName(ah);};CK=function(ah){var $ptr,ah;return $assertType(ah,FX).ptrTo();};$pkg.PtrTo=CK;BP.ptr.prototype.Implements=function(ah){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;if($interfaceIsEqual(ah,$ifaceNil)){$panic(new $String("reflect: nil type passed to Type.Implements"));}aj=ah.Kind();$s=3;case 3:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}if(!((aj===20))){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect: non-interface type passed to Type.Implements"));case 2:return CM($assertType(ah,FX),ai);}return;}if($f===undefined){$f={$blk:BP.ptr.prototype.Implements};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};BP.prototype.Implements=function(ah){return this.$val.Implements(ah);};BP.ptr.prototype.AssignableTo=function(ah){var $ptr,ah,ai,aj;ai=this;if($interfaceIsEqual(ah,$ifaceNil)){$panic(new $String("reflect: nil type passed to Type.AssignableTo"));}aj=$assertType(ah,FX);return CN(aj,ai)||CM(aj,ai);};BP.prototype.AssignableTo=function(ah){return this.$val.AssignableTo(ah);};BP.ptr.prototype.ConvertibleTo=function(ah){var $ptr,ah,ai,aj,ak,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;if($interfaceIsEqual(ah,$ifaceNil)){$panic(new $String("reflect: nil type passed to Type.ConvertibleTo"));}aj=$assertType(ah,FX);ak=ES(aj,ai);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}$s=2;case 2:return!(ak===$throwNilPointerError);}return;}if($f===undefined){$f={$blk:BP.ptr.prototype.ConvertibleTo};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.$s=$s;$f.$r=$r;return $f;};BP.prototype.ConvertibleTo=function(ah){return this.$val.ConvertibleTo(ah);};CM=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax;if(!((ah.Kind()===20))){return false;}aj=ah.kindType;if(aj.methods.$length===0){return true;}if(ai.Kind()===20){ak=ai.kindType;al=0;am=0;while(true){if(!(am=an.$length)?$throwRuntimeError("index out of range"):an.$array[an.$offset+al]));aq=(ap=ak.methods,((am<0||am>=ap.$length)?$throwRuntimeError("index out of range"):ap.$array[ap.$offset+am]));if(aq.name.$get()===ao.name.$get()&&aq.pkgPath===ao.pkgPath&&aq.typ===ao.typ){al=al+(1)>>0;if(al>=aj.methods.$length){return true;}}am=am+(1)>>0;}return false;}ar=ai.uncommonType.uncommon();if(ar===GQ.nil){return false;}as=0;at=0;while(true){if(!(at=au.$length)?$throwRuntimeError("index out of range"):au.$array[au.$offset+as]));ax=(aw=ar.methods,((at<0||at>=aw.$length)?$throwRuntimeError("index out of range"):aw.$array[aw.$offset+at]));if(ax.name.$get()===av.name.$get()&&ax.pkgPath===av.pkgPath&&ax.mtyp===av.typ){as=as+(1)>>0;if(as>=aj.methods.$length){return true;}}at=at+(1)>>0;}return false;};CN=function(ah,ai){var $ptr,ah,ai;if(ah===ai){return true;}if(!(ah.Name()==="")&&!(ai.Name()==="")||!((ah.Kind()===ai.Kind()))){return false;}return CO(ah,ai);};CO=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,bc,bd,be,bf,bg,bh;if(ah===ai){return true;}aj=ah.Kind();if(!((aj===ai.Kind()))){return false;}if(1<=aj&&aj<=16||(aj===24)||(aj===26)){return true;}ak=aj;if(ak===(17)){return $interfaceIsEqual(ah.Elem(),ai.Elem())&&(ah.Len()===ai.Len());}else if(ak===(18)){if((ai.ChanDir()===3)&&$interfaceIsEqual(ah.Elem(),ai.Elem())){return true;}return(ai.ChanDir()===ah.ChanDir())&&$interfaceIsEqual(ah.Elem(),ai.Elem());}else if(ak===(19)){al=ah.kindType;am=ai.kindType;if(!(al.dotdotdot===am.dotdotdot)||!((al.in$2.$length===am.in$2.$length))||!((al.out.$length===am.out.$length))){return false;}an=al.in$2;ao=0;while(true){if(!(ao=an.$length)?$throwRuntimeError("index out of range"):an.$array[an.$offset+ao]);if(!(aq===(ar=am.in$2,((ap<0||ap>=ar.$length)?$throwRuntimeError("index out of range"):ar.$array[ar.$offset+ap])))){return false;}ao++;}as=al.out;at=0;while(true){if(!(at=as.$length)?$throwRuntimeError("index out of range"):as.$array[as.$offset+at]);if(!(av===(aw=am.out,((au<0||au>=aw.$length)?$throwRuntimeError("index out of range"):aw.$array[aw.$offset+au])))){return false;}at++;}return true;}else if(ak===(20)){ax=ah.kindType;ay=ai.kindType;if((ax.methods.$length===0)&&(ay.methods.$length===0)){return true;}return false;}else if(ak===(21)){return $interfaceIsEqual(ah.Key(),ai.Key())&&$interfaceIsEqual(ah.Elem(),ai.Elem());}else if((ak===(22))||(ak===(23))){return $interfaceIsEqual(ah.Elem(),ai.Elem());}else if(ak===(25)){az=ah.kindType;ba=ai.kindType;if(!((az.fields.$length===ba.fields.$length))){return false;}bb=az.fields;bc=0;while(true){if(!(bc=be.$length)?$throwRuntimeError("index out of range"):be.$array[be.$offset+bd]));bh=(bg=ba.fields,((bd<0||bd>=bg.$length)?$throwRuntimeError("index out of range"):bg.$array[bg.$offset+bd]));if(!(bf.name===bh.name)&&(bf.name===GP.nil||bh.name===GP.nil||!(bf.name.$get()===bh.name.$get()))){return false;}if(!(bf.pkgPath===bh.pkgPath)&&(bf.pkgPath===GP.nil||bh.pkgPath===GP.nil||!(bf.pkgPath.$get()===bh.pkgPath.$get()))){return false;}if(!(bf.typ===bh.typ)){return false;}if(!(bf.tag===bh.tag)&&(bf.tag===GP.nil||bh.tag===GP.nil||!(bf.tag.$get()===bh.tag.$get()))){return false;}if(!((bf.offset===bh.offset))){return false;}bc++;}return true;}return false;};DC=function(ah){var $ptr,ah;if(ah===FX.nil){return $ifaceNil;}return ah;};DH=function(ah){var $ptr,ah;return((ah.kind&32)>>>0)===0;};DL.prototype.kind=function(){var $ptr,ah;ah=this.$val;return(((ah&31)>>>0)>>>0);};$ptrType(DL).prototype.kind=function(){return new DL(this.$get()).kind();};DK.ptr.prototype.pointer=function(){var $ptr,ah;ah=this;if(!((ah.typ.size===4))||!ah.typ.pointers()){$panic(new $String("can't call pointer on a non-pointer Value"));}if(!((((ah.flag&128)>>>0)===0))){return ah.ptr.$get();}return ah.ptr;};DK.prototype.pointer=function(){return this.$val.pointer();};DO.ptr.prototype.Error=function(){var $ptr,ah;ah=this;if(ah.Kind===0){return"reflect: call of "+ah.Method+" on zero Value";}return"reflect: call of "+ah.Method+" on "+new BO(ah.Kind).String()+" Value";};DO.prototype.Error=function(){return this.$val.Error();};DL.prototype.mustBe=function(ah){var $ptr,ah,ai;ai=this.$val;if(!((new DL(ai).kind()===ah))){$panic(new DO.ptr(AU(),new DL(ai).kind()));}};$ptrType(DL).prototype.mustBe=function(ah){return new DL(this.$get()).mustBe(ah);};DL.prototype.mustBeExported=function(){var $ptr,ah;ah=this.$val;if(ah===0){$panic(new DO.ptr(AU(),0));}if(!((((ah&96)>>>0)===0))){$panic(new $String("reflect: "+AU()+" using value obtained using unexported field"));}};$ptrType(DL).prototype.mustBeExported=function(){return new DL(this.$get()).mustBeExported();};DL.prototype.mustBeAssignable=function(){var $ptr,ah;ah=this.$val;if(ah===0){$panic(new DO.ptr(AU(),0));}if(!((((ah&96)>>>0)===0))){$panic(new $String("reflect: "+AU()+" using value obtained using unexported field"));}if(((ah&256)>>>0)===0){$panic(new $String("reflect: "+AU()+" using unaddressable value"));}};$ptrType(DL).prototype.mustBeAssignable=function(){return new DL(this.$get()).mustBeAssignable();};DK.ptr.prototype.Addr=function(){var $ptr,ah;ah=this;if(((ah.flag&256)>>>0)===0){$panic(new $String("reflect.Value.Addr of unaddressable value"));}return new DK.ptr(ah.typ.ptrTo(),ah.ptr,((((ah.flag&96)>>>0))|22)>>>0);};DK.prototype.Addr=function(){return this.$val.Addr();};DK.ptr.prototype.Bool=function(){var $ptr,ah;ah=this;new DL(ah.flag).mustBe(1);return ah.ptr.$get();};DK.prototype.Bool=function(){return this.$val.Bool();};DK.ptr.prototype.Bytes=function(){var $ptr,ah,ai,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=this;new DL(ah.flag).mustBe(23);ai=ah.typ.Elem().Kind();$s=3;case 3:if($c){$c=false;ai=ai.$blk();}if(ai&&ai.$blk!==undefined){break s;}if(!((ai===8))){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect.Value.Bytes of non-byte slice"));case 2:return ah.ptr.$get();}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Bytes};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Bytes=function(){return this.$val.Bytes();};DK.ptr.prototype.runes=function(){var $ptr,ah,ai,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=this;new DL(ah.flag).mustBe(23);ai=ah.typ.Elem().Kind();$s=3;case 3:if($c){$c=false;ai=ai.$blk();}if(ai&&ai.$blk!==undefined){break s;}if(!((ai===5))){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect.Value.Bytes of non-rune slice"));case 2:return ah.ptr.$get();}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.runes};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.runes=function(){return this.$val.runes();};DK.ptr.prototype.CanAddr=function(){var $ptr,ah;ah=this;return!((((ah.flag&256)>>>0)===0));};DK.prototype.CanAddr=function(){return this.$val.CanAddr();};DK.ptr.prototype.CanSet=function(){var $ptr,ah;ah=this;return((ah.flag&352)>>>0)===256;};DK.prototype.CanSet=function(){return this.$val.CanSet();};DK.ptr.prototype.Call=function(ah){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;new DL(ai.flag).mustBe(19);new DL(ai.flag).mustBeExported();aj=ai.call("Call",ah);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=2;case 2:return aj;}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Call};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Call=function(ah){return this.$val.Call(ah);};DK.ptr.prototype.CallSlice=function(ah){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;new DL(ai.flag).mustBe(19);new DL(ai.flag).mustBeExported();aj=ai.call("CallSlice",ah);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=2;case 2:return aj;}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.CallSlice};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.CallSlice=function(ah){return this.$val.CallSlice(ah);};DK.ptr.prototype.Complex=function(){var $ptr,ah,ai,aj,ak;ah=this;ai=new DL(ah.flag).kind();aj=ai;if(aj===(15)){return(ak=ah.ptr.$get(),new $Complex128(ak.$real,ak.$imag));}else if(aj===(16)){return ah.ptr.$get();}$panic(new DO.ptr("reflect.Value.Complex",new DL(ah.flag).kind()));};DK.prototype.Complex=function(){return this.$val.Complex();};DK.ptr.prototype.FieldByIndex=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;if(ah.$length===1){$s=1;continue;}$s=2;continue;case 1:aj=ai.Field((0>=ah.$length?$throwRuntimeError("index out of range"):ah.$array[ah.$offset+0]));$s=3;case 3:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=4;case 4:return aj;case 2:new DL(ai.flag).mustBe(25);ak=ah;al=0;case 5:if(!(al=ak.$length)?$throwRuntimeError("index out of range"):ak.$array[ak.$offset+al]);if(am>0){$s=7;continue;}$s=8;continue;case 7:if(!(ai.Kind()===22)){ao=false;$s=11;continue s;}ap=ai.typ.Elem().Kind();$s=12;case 12:if($c){$c=false;ap=ap.$blk();}if(ap&&ap.$blk!==undefined){break s;}ao=ap===25;case 11:if(ao){$s=9;continue;}$s=10;continue;case 9:if(ai.IsNil()){$panic(new $String("reflect: indirection through nil pointer to embedded struct"));}aq=ai.Elem();$s=13;case 13:if($c){$c=false;aq=aq.$blk();}if(aq&&aq.$blk!==undefined){break s;}ai=aq;case 10:case 8:ar=ai.Field(an);$s=14;case 14:if($c){$c=false;ar=ar.$blk();}if(ar&&ar.$blk!==undefined){break s;}ai=ar;al++;$s=5;continue;case 6:return ai;}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.FieldByIndex};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.FieldByIndex=function(ah){return this.$val.FieldByIndex(ah);};DK.ptr.prototype.FieldByName=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;new DL(ai.flag).mustBe(25);ak=ai.typ.FieldByName(ah);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}aj=ak;al=$clone(aj[0],CG);am=aj[1];if(am){$s=2;continue;}$s=3;continue;case 2:an=ai.FieldByIndex(al.Index);$s=4;case 4:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}$s=5;case 5:return an;case 3:return new DK.ptr(FX.nil,0,0);}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.FieldByName};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.FieldByName=function(ah){return this.$val.FieldByName(ah);};DK.ptr.prototype.FieldByNameFunc=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;ak=ai.typ.FieldByNameFunc(ah);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}aj=ak;al=$clone(aj[0],CG);am=aj[1];if(am){$s=2;continue;}$s=3;continue;case 2:an=ai.FieldByIndex(al.Index);$s=4;case 4:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}$s=5;case 5:return an;case 3:return new DK.ptr(FX.nil,0,0);}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.FieldByNameFunc};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.FieldByNameFunc=function(ah){return this.$val.FieldByNameFunc(ah);};DK.ptr.prototype.Float=function(){var $ptr,ah,ai,aj;ah=this;ai=new DL(ah.flag).kind();aj=ai;if(aj===(13)){return ah.ptr.$get();}else if(aj===(14)){return ah.ptr.$get();}$panic(new DO.ptr("reflect.Value.Float",new DL(ah.flag).kind()));};DK.prototype.Float=function(){return this.$val.Float();};DK.ptr.prototype.Int=function(){var $ptr,ah,ai,aj,ak;ah=this;ai=new DL(ah.flag).kind();aj=ah.ptr;ak=ai;if(ak===(2)){return new $Int64(0,aj.$get());}else if(ak===(3)){return new $Int64(0,aj.$get());}else if(ak===(4)){return new $Int64(0,aj.$get());}else if(ak===(5)){return new $Int64(0,aj.$get());}else if(ak===(6)){return aj.$get();}$panic(new DO.ptr("reflect.Value.Int",new DL(ah.flag).kind()));};DK.prototype.Int=function(){return this.$val.Int();};DK.ptr.prototype.CanInterface=function(){var $ptr,ah;ah=this;if(ah.flag===0){$panic(new DO.ptr("reflect.Value.CanInterface",0));}return((ah.flag&96)>>>0)===0;};DK.prototype.CanInterface=function(){return this.$val.CanInterface();};DK.ptr.prototype.Interface=function(){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=$ifaceNil;ai=this;aj=AS(ai,true);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}ah=aj;$s=2;case 2:return ah;}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Interface};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Interface=function(){return this.$val.Interface();};DK.ptr.prototype.IsValid=function(){var $ptr,ah;ah=this;return!((ah.flag===0));};DK.prototype.IsValid=function(){return this.$val.IsValid();};DK.ptr.prototype.Kind=function(){var $ptr,ah;ah=this;return new DL(ah.flag).kind();};DK.prototype.Kind=function(){return this.$val.Kind();};DK.ptr.prototype.MapIndex=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;ai=this;new DL(ai.flag).mustBe(21);aj=ai.typ.kindType;ak=ah.assignTo("reflect.Value.MapIndex",aj.key,0);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}ah=ak;al=0;if(!((((ah.flag&128)>>>0)===0))){al=ah.ptr;}else{al=(ah.$ptr_ptr||(ah.$ptr_ptr=new HP(function(){return this.$target.ptr;},function($v){this.$target.ptr=$v;},ah)));}am=AH(ai.typ,ai.pointer(),al);if(am===0){return new DK.ptr(FX.nil,0,0);}an=aj.elem;ao=((((ai.flag|ah.flag)>>>0))&96)>>>0;ao=(ao|((an.Kind()>>>0)))>>>0;if(DH(an)){ap=Z(an);AC(an,ap,am);return new DK.ptr(an,ap,(ao|128)>>>0);}else{return new DK.ptr(an,am.$get(),ao);}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.MapIndex};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.MapIndex=function(ah){return this.$val.MapIndex(ah);};DK.ptr.prototype.MapKeys=function(){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=this;new DL(ah.flag).mustBe(21);ai=ah.typ.kindType;aj=ai.key;ak=(((ah.flag&96)>>>0)|(aj.Kind()>>>0))>>>0;al=ah.pointer();am=0;if(!(al===0)){am=AO(al);}an=AL(ah.typ,al);ao=$makeSlice(GW,am);ap=0;ap=0;case 1:if(!(ap=ao.$length)?$throwRuntimeError("index out of range"):ao.$array[ao.$offset+ap]=new DK.ptr(aj,as,(ak|128)>>>0));}else{((ap<0||ap>=ao.$length)?$throwRuntimeError("index out of range"):ao.$array[ao.$offset+ap]=new DK.ptr(aj,ar.$get(),ak));}AN(an);ap=ap+(1)>>0;$s=1;continue;case 2:return $subslice(ao,0,ap);}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.MapKeys};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.MapKeys=function(){return this.$val.MapKeys();};DK.ptr.prototype.Method=function(ah){var $ptr,ah,ai,aj;ai=this;if(ai.typ===FX.nil){$panic(new DO.ptr("reflect.Value.Method",0));}if(!((((ai.flag&512)>>>0)===0))||(ah>>>0)>=(ai.typ.NumMethod()>>>0)){$panic(new $String("reflect: Method index out of range"));}if((ai.typ.Kind()===20)&&ai.IsNil()){$panic(new $String("reflect: Method on nil interface value"));}aj=(ai.flag&160)>>>0;aj=(aj|(19))>>>0;aj=(aj|(((((ah>>>0)<<10>>>0)|512)>>>0)))>>>0;return new DK.ptr(ai.typ,ai.ptr,aj);};DK.prototype.Method=function(ah){return this.$val.Method(ah);};DK.ptr.prototype.NumMethod=function(){var $ptr,ah;ah=this;if(ah.typ===FX.nil){$panic(new DO.ptr("reflect.Value.NumMethod",0));}if(!((((ah.flag&512)>>>0)===0))){return 0;}return ah.typ.NumMethod();};DK.prototype.NumMethod=function(){return this.$val.NumMethod();};DK.ptr.prototype.MethodByName=function(ah){var $ptr,ah,ai,aj,ak,al;ai=this;if(ai.typ===FX.nil){$panic(new DO.ptr("reflect.Value.MethodByName",0));}if(!((((ai.flag&512)>>>0)===0))){return new DK.ptr(FX.nil,0,0);}aj=ai.typ.MethodByName(ah);ak=$clone(aj[0],CE);al=aj[1];if(!al){return new DK.ptr(FX.nil,0,0);}return ai.Method(ak.Index);};DK.prototype.MethodByName=function(ah){return this.$val.MethodByName(ah);};DK.ptr.prototype.NumField=function(){var $ptr,ah,ai;ah=this;new DL(ah.flag).mustBe(25);ai=ah.typ.kindType;return ai.fields.$length;};DK.prototype.NumField=function(){return this.$val.NumField();};DK.ptr.prototype.OverflowComplex=function(ah){var $ptr,ah,ai,aj,ak;ai=this;aj=new DL(ai.flag).kind();ak=aj;if(ak===(15)){return DY(ah.$real)||DY(ah.$imag);}else if(ak===(16)){return false;}$panic(new DO.ptr("reflect.Value.OverflowComplex",new DL(ai.flag).kind()));};DK.prototype.OverflowComplex=function(ah){return this.$val.OverflowComplex(ah);};DK.ptr.prototype.OverflowFloat=function(ah){var $ptr,ah,ai,aj,ak;ai=this;aj=new DL(ai.flag).kind();ak=aj;if(ak===(13)){return DY(ah);}else if(ak===(14)){return false;}$panic(new DO.ptr("reflect.Value.OverflowFloat",new DL(ai.flag).kind()));};DK.prototype.OverflowFloat=function(ah){return this.$val.OverflowFloat(ah);};DY=function(ah){var $ptr,ah;if(ah<0){ah=-ah;}return 3.4028234663852886e+38>>0;am=$shiftRightInt64(($shiftLeft64(ah,((64-al>>>0)))),((64-al>>>0)));return!((ah.$high===am.$high&&ah.$low===am.$low));}$panic(new DO.ptr("reflect.Value.OverflowInt",new DL(ai.flag).kind()));};DK.prototype.OverflowInt=function(ah){return this.$val.OverflowInt(ah);};DK.ptr.prototype.OverflowUint=function(ah){var $ptr,ah,ai,aj,ak,al,am;ai=this;aj=new DL(ai.flag).kind();ak=aj;if((ak===(7))||(ak===(12))||(ak===(8))||(ak===(9))||(ak===(10))||(ak===(11))){al=$imul(ai.typ.size,8)>>>0;am=$shiftRightUint64(($shiftLeft64(ah,((64-al>>>0)))),((64-al>>>0)));return!((ah.$high===am.$high&&ah.$low===am.$low));}$panic(new DO.ptr("reflect.Value.OverflowUint",new DL(ai.flag).kind()));};DK.prototype.OverflowUint=function(ah){return this.$val.OverflowUint(ah);};DK.ptr.prototype.Recv=function(){var $ptr,ah,ai,aj,ak,al,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=new DK.ptr(FX.nil,0,0);ai=false;aj=this;new DL(aj.flag).mustBe(18);new DL(aj.flag).mustBeExported();al=aj.recv(false);$s=1;case 1:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}ak=al;ah=ak[0];ai=ak[1];$s=2;case 2:return[ah,ai];}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Recv};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Recv=function(){return this.$val.Recv();};DK.ptr.prototype.recv=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=new DK.ptr(FX.nil,0,0);aj=false;ak=this;al=ak.typ.kindType;if(((al.dir>>0)&1)===0){$panic(new $String("reflect: recv on send-only channel"));}am=al.elem;ai=new DK.ptr(am,0,(am.Kind()>>>0));an=0;if(DH(am)){an=Z(am);ai.ptr=an;ai.flag=(ai.flag|(128))>>>0;}else{an=(ai.$ptr_ptr||(ai.$ptr_ptr=new HP(function(){return this.$target.ptr;},function($v){this.$target.ptr=$v;},ai)));}ap=BC(ak.typ,ak.pointer(),ah,an);$s=1;case 1:if($c){$c=false;ap=ap.$blk();}if(ap&&ap.$blk!==undefined){break s;}ao=ap;aq=ao[0];aj=ao[1];if(!aq){ai=new DK.ptr(FX.nil,0,0);}return[ai,aj];}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.recv};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.recv=function(ah){return this.$val.recv(ah);};DK.ptr.prototype.Send=function(ah){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;ai=this;new DL(ai.flag).mustBe(18);new DL(ai.flag).mustBeExported();aj=ai.send(ah,false);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}aj;$s=-1;case-1:}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Send};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Send=function(ah){return this.$val.Send(ah);};DK.ptr.prototype.send=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,ao,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:aj=false;ah=ah;ak=this;al=ak.typ.kindType;if(((al.dir>>0)&2)===0){$panic(new $String("reflect: send on recv-only channel"));}new DL(ah.flag).mustBeExported();am=ah.assignTo("reflect.Value.Send",al.elem,0);$s=1;case 1:if($c){$c=false;am=am.$blk();}if(am&&am.$blk!==undefined){break s;}ah=am;an=0;if(!((((ah.flag&128)>>>0)===0))){an=ah.ptr;}else{an=(ah.$ptr_ptr||(ah.$ptr_ptr=new HP(function(){return this.$target.ptr;},function($v){this.$target.ptr=$v;},ah)));}ao=BD(ak.typ,ak.pointer(),an,ai);$s=2;case 2:if($c){$c=false;ao=ao.$blk();}if(ao&&ao.$blk!==undefined){break s;}aj=ao;$s=3;case 3:return aj;}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.send};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.send=function(ah,ai){return this.$val.send(ah,ai);};DK.ptr.prototype.SetBool=function(ah){var $ptr,ah,ai;ai=this;new DL(ai.flag).mustBeAssignable();new DL(ai.flag).mustBe(1);ai.ptr.$set(ah);};DK.prototype.SetBool=function(ah){return this.$val.SetBool(ah);};DK.ptr.prototype.setRunes=function(ah){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;new DL(ai.flag).mustBeAssignable();new DL(ai.flag).mustBe(23);aj=ai.typ.Elem().Kind();$s=3;case 3:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}if(!((aj===5))){$s=1;continue;}$s=2;continue;case 1:$panic(new $String("reflect.Value.setRunes of non-rune slice"));case 2:ai.ptr.$set(ah);$s=-1;case-1:}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.setRunes};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.setRunes=function(ah){return this.$val.setRunes(ah);};DK.ptr.prototype.SetComplex=function(ah){var $ptr,ah,ai,aj,ak;ai=this;new DL(ai.flag).mustBeAssignable();aj=new DL(ai.flag).kind();ak=aj;if(ak===(15)){ai.ptr.$set(new $Complex64(ah.$real,ah.$imag));}else if(ak===(16)){ai.ptr.$set(ah);}else{$panic(new DO.ptr("reflect.Value.SetComplex",new DL(ai.flag).kind()));}};DK.prototype.SetComplex=function(ah){return this.$val.SetComplex(ah);};DK.ptr.prototype.SetFloat=function(ah){var $ptr,ah,ai,aj,ak;ai=this;new DL(ai.flag).mustBeAssignable();aj=new DL(ai.flag).kind();ak=aj;if(ak===(13)){ai.ptr.$set($fround(ah));}else if(ak===(14)){ai.ptr.$set(ah);}else{$panic(new DO.ptr("reflect.Value.SetFloat",new DL(ai.flag).kind()));}};DK.prototype.SetFloat=function(ah){return this.$val.SetFloat(ah);};DK.ptr.prototype.SetInt=function(ah){var $ptr,ah,ai,aj,ak;ai=this;new DL(ai.flag).mustBeAssignable();aj=new DL(ai.flag).kind();ak=aj;if(ak===(2)){ai.ptr.$set(((ah.$low+((ah.$high>>31)*4294967296))>>0));}else if(ak===(3)){ai.ptr.$set(((ah.$low+((ah.$high>>31)*4294967296))<<24>>24));}else if(ak===(4)){ai.ptr.$set(((ah.$low+((ah.$high>>31)*4294967296))<<16>>16));}else if(ak===(5)){ai.ptr.$set(((ah.$low+((ah.$high>>31)*4294967296))>>0));}else if(ak===(6)){ai.ptr.$set(ah);}else{$panic(new DO.ptr("reflect.Value.SetInt",new DL(ai.flag).kind()));}};DK.prototype.SetInt=function(ah){return this.$val.SetInt(ah);};DK.ptr.prototype.SetMapIndex=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,ao,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=ai;ah=ah;aj=this;new DL(aj.flag).mustBe(21);new DL(aj.flag).mustBeExported();new DL(ah.flag).mustBeExported();ak=aj.typ.kindType;al=ah.assignTo("reflect.Value.SetMapIndex",ak.key,0);$s=1;case 1:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}ah=al;am=0;if(!((((ah.flag&128)>>>0)===0))){am=ah.ptr;}else{am=(ah.$ptr_ptr||(ah.$ptr_ptr=new HP(function(){return this.$target.ptr;},function($v){this.$target.ptr=$v;},ah)));}if(ai.typ===FX.nil){AJ(aj.typ,aj.pointer(),am);return;}new DL(ai.flag).mustBeExported();an=ai.assignTo("reflect.Value.SetMapIndex",ak.elem,0);$s=2;case 2:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}ai=an;ao=0;if(!((((ai.flag&128)>>>0)===0))){ao=ai.ptr;}else{ao=(ai.$ptr_ptr||(ai.$ptr_ptr=new HP(function(){return this.$target.ptr;},function($v){this.$target.ptr=$v;},ai)));}$r=AI(aj.typ,aj.pointer(),am,ao);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.SetMapIndex};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.SetMapIndex=function(ah,ai){return this.$val.SetMapIndex(ah,ai);};DK.ptr.prototype.SetUint=function(ah){var $ptr,ah,ai,aj,ak;ai=this;new DL(ai.flag).mustBeAssignable();aj=new DL(ai.flag).kind();ak=aj;if(ak===(7)){ai.ptr.$set((ah.$low>>>0));}else if(ak===(8)){ai.ptr.$set((ah.$low<<24>>>24));}else if(ak===(9)){ai.ptr.$set((ah.$low<<16>>>16));}else if(ak===(10)){ai.ptr.$set((ah.$low>>>0));}else if(ak===(11)){ai.ptr.$set(ah);}else if(ak===(12)){ai.ptr.$set((ah.$low>>>0));}else{$panic(new DO.ptr("reflect.Value.SetUint",new DL(ai.flag).kind()));}};DK.prototype.SetUint=function(ah){return this.$val.SetUint(ah);};DK.ptr.prototype.SetPointer=function(ah){var $ptr,ah,ai;ai=this;new DL(ai.flag).mustBeAssignable();new DL(ai.flag).mustBe(26);ai.ptr.$set(ah);};DK.prototype.SetPointer=function(ah){return this.$val.SetPointer(ah);};DK.ptr.prototype.SetString=function(ah){var $ptr,ah,ai;ai=this;new DL(ai.flag).mustBeAssignable();new DL(ai.flag).mustBe(24);ai.ptr.$set(ah);};DK.prototype.SetString=function(ah){return this.$val.SetString(ah);};DK.ptr.prototype.String=function(){var $ptr,ah,ai,aj,ak,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=this;ai=new DL(ah.flag).kind();aj=ai;if(aj===(0)){return"";}else if(aj===(24)){return ah.ptr.$get();}ak=ah.Type().String();$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}$s=2;case 2:return"<"+ak+" Value>";}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.String};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.String=function(){return this.$val.String();};DK.ptr.prototype.TryRecv=function(){var $ptr,ah,ai,aj,ak,al,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=new DK.ptr(FX.nil,0,0);ai=false;aj=this;new DL(aj.flag).mustBe(18);new DL(aj.flag).mustBeExported();al=aj.recv(true);$s=1;case 1:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}ak=al;ah=ak[0];ai=ak[1];$s=2;case 2:return[ah,ai];}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.TryRecv};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.TryRecv=function(){return this.$val.TryRecv();};DK.ptr.prototype.TrySend=function(ah){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;ai=this;new DL(ai.flag).mustBe(18);new DL(ai.flag).mustBeExported();aj=ai.send(ah,true);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=2;case 2:return aj;}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.TrySend};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.TrySend=function(ah){return this.$val.TrySend(ah);};DK.ptr.prototype.Type=function(){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap;ah=this;ai=ah.flag;if(ai===0){$panic(new DO.ptr("reflect.Value.Type",0));}if(((ai&512)>>>0)===0){return ah.typ;}aj=(ah.flag>>0)>>10>>0;if(ah.typ.Kind()===20){ak=ah.typ.kindType;if((aj>>>0)>=(ak.methods.$length>>>0)){$panic(new $String("reflect: internal error: invalid method index"));}am=(al=ak.methods,((aj<0||aj>=al.$length)?$throwRuntimeError("index out of range"):al.$array[al.$offset+aj]));return am.typ;}an=ah.typ.uncommonType.uncommon();if(an===GQ.nil||(aj>>>0)>=(an.methods.$length>>>0)){$panic(new $String("reflect: internal error: invalid method index"));}ap=(ao=an.methods,((aj<0||aj>=ao.$length)?$throwRuntimeError("index out of range"):ao.$array[ao.$offset+aj]));return ap.mtyp;};DK.prototype.Type=function(){return this.$val.Type();};DK.ptr.prototype.Uint=function(){var $ptr,ah,ai,aj,ak,al;ah=this;ai=new DL(ah.flag).kind();aj=ah.ptr;ak=ai;if(ak===(7)){return new $Uint64(0,aj.$get());}else if(ak===(8)){return new $Uint64(0,aj.$get());}else if(ak===(9)){return new $Uint64(0,aj.$get());}else if(ak===(10)){return new $Uint64(0,aj.$get());}else if(ak===(11)){return aj.$get();}else if(ak===(12)){return(al=aj.$get(),new $Uint64(0,al.constructor===Number?al:1));}$panic(new DO.ptr("reflect.Value.Uint",new DL(ah.flag).kind()));};DK.prototype.Uint=function(){return this.$val.Uint();};DK.ptr.prototype.UnsafeAddr=function(){var $ptr,ah;ah=this;if(ah.typ===FX.nil){$panic(new DO.ptr("reflect.Value.UnsafeAddr",0));}if(((ah.flag&256)>>>0)===0){$panic(new $String("reflect.Value.UnsafeAddr of unaddressable value"));}return ah.ptr;};DK.prototype.UnsafeAddr=function(){return this.$val.UnsafeAddr();};EQ=function(ah){var $ptr,ah,ai,aj,ak,al,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:if($interfaceIsEqual(ah,$ifaceNil)){$panic(new $String("reflect: New(nil)"));}ai=Z($assertType(ah,FX));aj=22;ak=ah.common();$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=ak.ptrTo();$s=2;case 2:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}$s=3;case 3:return new DK.ptr(al,ai,aj);}return;}if($f===undefined){$f={$blk:EQ};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.$s=$s;$f.$r=$r;return $f;};$pkg.New=EQ;DK.ptr.prototype.assignTo=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am,an,ao,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ak=this;if(!((((ak.flag&512)>>>0)===0))){$s=1;continue;}$s=2;continue;case 1:al=AV(ah,ak);$s=3;case 3:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}ak=al;case 2:if(CN(ai,ak.typ)){$s=5;continue;}if(CM(ai,ak.typ)){$s=6;continue;}$s=7;continue;case 5:ak.typ=ai;am=(ak.flag&480)>>>0;am=(am|((ai.Kind()>>>0)))>>>0;return new DK.ptr(ai,ak.ptr,am);case 6:if(aj===0){aj=Z(ai);}an=AS(ak,false);$s=8;case 8:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}ao=an;if(ai.NumMethod()===0){aj.$set(ao);}else{AT(ai,ao,aj);}return new DK.ptr(ai,aj,148);case 7:case 4:$panic(new $String(ah+": value of type "+ak.typ.String()+" is not assignable to type "+ai.String()));$s=-1;case-1:}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.assignTo};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.assignTo=function(ah,ai,aj){return this.$val.assignTo(ah,ai,aj);};DK.ptr.prototype.Convert=function(ah){var $ptr,ah,ai,aj,ak,al,am,an,ao,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ai=this;if(!((((ai.flag&512)>>>0)===0))){$s=1;continue;}$s=2;continue;case 1:aj=AV("Convert",ai);$s=3;case 3:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}ai=aj;case 2:ak=ah.common();$s=4;case 4:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=ES(ak,ai.typ);$s=5;case 5:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}am=al;if(am===$throwNilPointerError){$s=6;continue;}$s=7;continue;case 6:an=ah.String();$s=8;case 8:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}$panic(new $String("reflect.Value.Convert: value of type "+ai.typ.String()+" cannot be converted to type "+an));case 7:ao=am(ai,ah);$s=9;case 9:if($c){$c=false;ao=ao.$blk();}if(ao&&ao.$blk!==undefined){break s;}$s=10;case 10:return ao;}return;}if($f===undefined){$f={$blk:DK.ptr.prototype.Convert};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.$s=$s;$f.$r=$r;return $f;};DK.prototype.Convert=function(ah){return this.$val.Convert(ah);};ES=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;ax=$f.ax;ay=$f.ay;az=$f.az;ba=$f.ba;bb=$f.bb;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:aj=ai.Kind();if((aj===(2))||(aj===(3))||(aj===(4))||(aj===(5))||(aj===(6))){$s=2;continue;}if((aj===(7))||(aj===(8))||(aj===(9))||(aj===(10))||(aj===(11))||(aj===(12))){$s=3;continue;}if((aj===(13))||(aj===(14))){$s=4;continue;}if((aj===(15))||(aj===(16))){$s=5;continue;}if(aj===(24)){$s=6;continue;}if(aj===(23)){$s=7;continue;}$s=8;continue;case 2:ak=ah.Kind();if((ak===(2))||(ak===(3))||(ak===(4))||(ak===(5))||(ak===(6))||(ak===(7))||(ak===(8))||(ak===(9))||(ak===(10))||(ak===(11))||(ak===(12))){return EY;}else if((ak===(13))||(ak===(14))){return FC;}else if(ak===(24)){return FG;}$s=8;continue;case 3:al=ah.Kind();if((al===(2))||(al===(3))||(al===(4))||(al===(5))||(al===(6))||(al===(7))||(al===(8))||(al===(9))||(al===(10))||(al===(11))||(al===(12))){return EZ;}else if((al===(13))||(al===(14))){return FD;}else if(al===(24)){return FH;}$s=8;continue;case 4:am=ah.Kind();if((am===(2))||(am===(3))||(am===(4))||(am===(5))||(am===(6))){return FA;}else if((am===(7))||(am===(8))||(am===(9))||(am===(10))||(am===(11))||(am===(12))){return FB;}else if((am===(13))||(am===(14))){return FE;}$s=8;continue;case 5:an=ah.Kind();if((an===(15))||(an===(16))){return FF;}$s=8;continue;case 6:if(!(ah.Kind()===23)){ao=false;$s=11;continue s;}ap=ah.Elem().PkgPath();$s=12;case 12:if($c){$c=false;ap=ap.$blk();}if(ap&&ap.$blk!==undefined){break s;}ao=ap==="";case 11:if(ao){$s=9;continue;}$s=10;continue;case 9:aq=ah.Elem().Kind();$s=14;case 14:if($c){$c=false;aq=aq.$blk();}if(aq&&aq.$blk!==undefined){break s;}ar=aq;if(ar===(8)){return FJ;}else if(ar===(5)){return FL;}case 13:case 10:$s=8;continue;case 7:if(!(ah.Kind()===24)){as=false;$s=17;continue s;}at=ai.Elem().PkgPath();$s=18;case 18:if($c){$c=false;at=at.$blk();}if(at&&at.$blk!==undefined){break s;}as=at==="";case 17:if(as){$s=15;continue;}$s=16;continue;case 15:au=ai.Elem().Kind();$s=20;case 20:if($c){$c=false;au=au.$blk();}if(au&&au.$blk!==undefined){break s;}av=au;if(av===(8)){return FI;}else if(av===(5)){return FK;}case 19:case 16:case 8:case 1:if(CO(ah,ai)){return AP;}if(!((ah.Kind()===22)&&ah.Name()===""&&(ai.Kind()===22)&&ai.Name()==="")){aw=false;$s=23;continue s;}ax=ah.Elem().common();$s=24;case 24:if($c){$c=false;ax=ax.$blk();}if(ax&&ax.$blk!==undefined){break s;}ay=ax;az=ai.Elem().common();$s=25;case 25:if($c){$c=false;az=az.$blk();}if(az&&az.$blk!==undefined){break s;}ba=az;bb=CO(ay,ba);$s=26;case 26:if($c){$c=false;bb=bb.$blk();}if(bb&&bb.$blk!==undefined){break s;}aw=bb;case 23:if(aw){$s=21;continue;}$s=22;continue;case 21:return AP;case 22:if(CM(ah,ai)){if(ai.Kind()===20){return FN;}return FM;}return $throwNilPointerError;}return;}if($f===undefined){$f={$blk:ES};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.ax=ax;$f.ay=ay;$f.az=az;$f.ba=ba;$f.bb=bb;$f.$s=$s;$f.$r=$r;return $f;};ET=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ak=aj.common();$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=ak;am=Z(al);an=al.size;if(an===(4)){am.$set($fround(ai));}else if(an===(8)){am.$set(ai);}return new DK.ptr(al,am,(((ah|128)>>>0)|(al.Kind()>>>0))>>>0);}return;}if($f===undefined){$f={$blk:ET};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};EU=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ak=aj.common();$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=ak;am=Z(al);an=al.size;if(an===(8)){am.$set(new $Complex64(ai.$real,ai.$imag));}else if(an===(16)){am.$set(ai);}return new DK.ptr(al,am,(((ah|128)>>>0)|(al.Kind()>>>0))>>>0);}return;}if($f===undefined){$f={$blk:EU};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};EV=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ak=EQ(aj);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=ak.Elem();$s=2;case 2:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}am=al;am.SetString(ai);am.flag=(((am.flag&~256)>>>0)|ah)>>>0;return am;}return;}if($f===undefined){$f={$blk:EV};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.$s=$s;$f.$r=$r;return $f;};EW=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ak=EQ(aj);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=ak.Elem();$s=2;case 2:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}am=al;$r=am.SetBytes(ai);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}am.flag=(((am.flag&~256)>>>0)|ah)>>>0;return am;}return;}if($f===undefined){$f={$blk:EW};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.$s=$s;$f.$r=$r;return $f;};EX=function(ah,ai,aj){var $ptr,ah,ai,aj,ak,al,am,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ak=EQ(aj);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=ak.Elem();$s=2;case 2:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}am=al;$r=am.setRunes(ai);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}am.flag=(((am.flag&~256)>>>0)|ah)>>>0;return am;}return;}if($f===undefined){$f={$blk:EX};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.$s=$s;$f.$r=$r;return $f;};EY=function(ah,ai){var $ptr,ah,ai,aj,ak,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;ak=AA((ah.flag&96)>>>0,(aj=ah.Int(),new $Uint64(aj.$high,aj.$low)),ai);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}$s=2;case 2:return ak;}return;}if($f===undefined){$f={$blk:EY};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.$s=$s;$f.$r=$r;return $f;};EZ=function(ah,ai){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=AA((ah.flag&96)>>>0,ah.Uint(),ai);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=2;case 2:return aj;}return;}if($f===undefined){$f={$blk:EZ};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};FA=function(ah,ai){var $ptr,ah,ai,aj,ak,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;ak=AA((ah.flag&96)>>>0,(aj=new $Int64(0,ah.Float()),new $Uint64(aj.$high,aj.$low)),ai);$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}$s=2;case 2:return ak;}return;}if($f===undefined){$f={$blk:FA};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.$s=$s;$f.$r=$r;return $f;};FB=function(ah,ai){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=AA((ah.flag&96)>>>0,new $Uint64(0,ah.Float()),ai);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=2;case 2:return aj;}return;}if($f===undefined){$f={$blk:FB};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};FC=function(ah,ai){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=ET((ah.flag&96)>>>0,$flatten64(ah.Int()),ai);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=2;case 2:return aj;}return;}if($f===undefined){$f={$blk:FC};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};FD=function(ah,ai){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=ET((ah.flag&96)>>>0,$flatten64(ah.Uint()),ai);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=2;case 2:return aj;}return;}if($f===undefined){$f={$blk:FD};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};FE=function(ah,ai){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=ET((ah.flag&96)>>>0,ah.Float(),ai);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=2;case 2:return aj;}return;}if($f===undefined){$f={$blk:FE};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};FF=function(ah,ai){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=EU((ah.flag&96)>>>0,ah.Complex(),ai);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=2;case 2:return aj;}return;}if($f===undefined){$f={$blk:FF};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};FG=function(ah,ai){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=EV((ah.flag&96)>>>0,$encodeRune(ah.Int().$low),ai);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=2;case 2:return aj;}return;}if($f===undefined){$f={$blk:FG};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};FH=function(ah,ai){var $ptr,ah,ai,aj,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=EV((ah.flag&96)>>>0,$encodeRune(ah.Uint().$low),ai);$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}$s=2;case 2:return aj;}return;}if($f===undefined){$f={$blk:FH};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.$s=$s;$f.$r=$r;return $f;};FI=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=(ah.flag&96)>>>0;ak=ah.Bytes();$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=$bytesToString(ak);am=ai;an=EV(aj,al,am);$s=2;case 2:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}$s=3;case 3:return an;}return;}if($f===undefined){$f={$blk:FI};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};FJ=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=(ah.flag&96)>>>0;ak=ah.String();$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=new HK($stringToBytes(ak));am=ai;an=EW(aj,al,am);$s=2;case 2:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}$s=3;case 3:return an;}return;}if($f===undefined){$f={$blk:FJ};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};FK=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=(ah.flag&96)>>>0;ak=ah.runes();$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=$runesToString(ak);am=ai;an=EV(aj,al,am);$s=2;case 2:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}$s=3;case 3:return an;}return;}if($f===undefined){$f={$blk:FK};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};FL=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=(ah.flag&96)>>>0;ak=ah.String();$s=1;case 1:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=new HR($stringToRunes(ak));am=ai;an=EX(aj,al,am);$s=2;case 2:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}$s=3;case 3:return an;}return;}if($f===undefined){$f={$blk:FL};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.$s=$s;$f.$r=$r;return $f;};FM=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,an,ao,ap,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;aj=ai.common();$s=1;case 1:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}ak=Z(aj);$s=2;case 2:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=ak;am=AS(ah,false);$s=3;case 3:if($c){$c=false;am=am.$blk();}if(am&&am.$blk!==undefined){break s;}an=am;ao=ai.NumMethod();$s=7;case 7:if($c){$c=false;ao=ao.$blk();}if(ao&&ao.$blk!==undefined){break s;}if(ao===0){$s=4;continue;}$s=5;continue;case 4:al.$set(an);$s=6;continue;case 5:AT($assertType(ai,FX),an,al);case 6:ap=ai.common();$s=8;case 8:if($c){$c=false;ap=ap.$blk();}if(ap&&ap.$blk!==undefined){break s;}$s=9;case 9:return new DK.ptr(ap,al,(((((ah.flag&96)>>>0)|128)>>>0)|20)>>>0);}return;}if($f===undefined){$f={$blk:FM};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.$s=$s;$f.$r=$r;return $f;};FN=function(ah,ai){var $ptr,ah,ai,aj,ak,al,am,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:ah=ah;if(ah.IsNil()){$s=1;continue;}$s=2;continue;case 1:aj=Y(ai);$s=3;case 3:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}ak=aj;ak.flag=(ak.flag|(((ah.flag&96)>>>0)))>>>0;return ak;case 2:al=ah.Elem();$s=4;case 4:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}am=FM(al,ai);$s=5;case 5:if($c){$c=false;am=am.$blk();}if(am&&am.$blk!==undefined){break s;}$s=6;case 6:return am;}return;}if($f===undefined){$f={$blk:FN};}$f.$ptr=$ptr;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.$s=$s;$f.$r=$r;return $f;};BO.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];FX.methods=[{prop:"ptrTo",name:"ptrTo",pkg:"reflect",typ:$funcType([],[FX],false)},{prop:"pointers",name:"pointers",pkg:"reflect",typ:$funcType([],[$Bool],false)},{prop:"Comparable",name:"Comparable",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"Bits",name:"Bits",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Align",name:"Align",pkg:"",typ:$funcType([],[$Int],false)},{prop:"FieldAlign",name:"FieldAlign",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Kind",name:"Kind",pkg:"",typ:$funcType([],[BO],false)},{prop:"common",name:"common",pkg:"reflect",typ:$funcType([],[FX],false)},{prop:"NumMethod",name:"NumMethod",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Method",name:"Method",pkg:"",typ:$funcType([$Int],[CE],false)},{prop:"MethodByName",name:"MethodByName",pkg:"",typ:$funcType([$String],[CE,$Bool],false)},{prop:"PkgPath",name:"PkgPath",pkg:"",typ:$funcType([],[$String],false)},{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"ChanDir",name:"ChanDir",pkg:"",typ:$funcType([],[BT],false)},{prop:"IsVariadic",name:"IsVariadic",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Elem",name:"Elem",pkg:"",typ:$funcType([],[BN],false)},{prop:"Field",name:"Field",pkg:"",typ:$funcType([$Int],[CG],false)},{prop:"FieldByIndex",name:"FieldByIndex",pkg:"",typ:$funcType([HH],[CG],false)},{prop:"FieldByName",name:"FieldByName",pkg:"",typ:$funcType([$String],[CG,$Bool],false)},{prop:"FieldByNameFunc",name:"FieldByNameFunc",pkg:"",typ:$funcType([HU],[CG,$Bool],false)},{prop:"In",name:"In",pkg:"",typ:$funcType([$Int],[BN],false)},{prop:"Key",name:"Key",pkg:"",typ:$funcType([],[BN],false)},{prop:"Len",name:"Len",pkg:"",typ:$funcType([],[$Int],false)},{prop:"NumField",name:"NumField",pkg:"",typ:$funcType([],[$Int],false)},{prop:"NumIn",name:"NumIn",pkg:"",typ:$funcType([],[$Int],false)},{prop:"NumOut",name:"NumOut",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Out",name:"Out",pkg:"",typ:$funcType([$Int],[BN],false)},{prop:"Implements",name:"Implements",pkg:"",typ:$funcType([BN],[$Bool],false)},{prop:"AssignableTo",name:"AssignableTo",pkg:"",typ:$funcType([BN],[$Bool],false)},{prop:"ConvertibleTo",name:"ConvertibleTo",pkg:"",typ:$funcType([BN],[$Bool],false)}];GQ.methods=[{prop:"Method",name:"Method",pkg:"",typ:$funcType([$Int],[CE],false)},{prop:"uncommon",name:"uncommon",pkg:"reflect",typ:$funcType([],[GQ],false)},{prop:"PkgPath",name:"PkgPath",pkg:"",typ:$funcType([],[$String],false)},{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"NumMethod",name:"NumMethod",pkg:"",typ:$funcType([],[$Int],false)},{prop:"MethodByName",name:"MethodByName",pkg:"",typ:$funcType([$String],[CE,$Bool],false)}];BT.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];HF.methods=[{prop:"Method",name:"Method",pkg:"",typ:$funcType([$Int],[CE],false)},{prop:"NumMethod",name:"NumMethod",pkg:"",typ:$funcType([],[$Int],false)},{prop:"MethodByName",name:"MethodByName",pkg:"",typ:$funcType([$String],[CE,$Bool],false)}];HJ.methods=[{prop:"Field",name:"Field",pkg:"",typ:$funcType([$Int],[CG],false)},{prop:"FieldByIndex",name:"FieldByIndex",pkg:"",typ:$funcType([HH],[CG],false)},{prop:"FieldByNameFunc",name:"FieldByNameFunc",pkg:"",typ:$funcType([HU],[CG,$Bool],false)},{prop:"FieldByName",name:"FieldByName",pkg:"",typ:$funcType([$String],[CG,$Bool],false)}];CH.methods=[{prop:"Get",name:"Get",pkg:"",typ:$funcType([$String],[$String],false)}];DK.methods=[{prop:"object",name:"object",pkg:"reflect",typ:$funcType([],[GK],false)},{prop:"call",name:"call",pkg:"reflect",typ:$funcType([$String,GW],[GW],false)},{prop:"Cap",name:"Cap",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Elem",name:"Elem",pkg:"",typ:$funcType([],[DK],false)},{prop:"Field",name:"Field",pkg:"",typ:$funcType([$Int],[DK],false)},{prop:"Index",name:"Index",pkg:"",typ:$funcType([$Int],[DK],false)},{prop:"InterfaceData",name:"InterfaceData",pkg:"",typ:$funcType([],[HX],false)},{prop:"IsNil",name:"IsNil",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Len",name:"Len",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Pointer",name:"Pointer",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"Set",name:"Set",pkg:"",typ:$funcType([DK],[],false)},{prop:"SetBytes",name:"SetBytes",pkg:"",typ:$funcType([HK],[],false)},{prop:"SetCap",name:"SetCap",pkg:"",typ:$funcType([$Int],[],false)},{prop:"SetLen",name:"SetLen",pkg:"",typ:$funcType([$Int],[],false)},{prop:"Slice",name:"Slice",pkg:"",typ:$funcType([$Int,$Int],[DK],false)},{prop:"Slice3",name:"Slice3",pkg:"",typ:$funcType([$Int,$Int,$Int],[DK],false)},{prop:"Close",name:"Close",pkg:"",typ:$funcType([],[],false)},{prop:"pointer",name:"pointer",pkg:"reflect",typ:$funcType([],[$UnsafePointer],false)},{prop:"Addr",name:"Addr",pkg:"",typ:$funcType([],[DK],false)},{prop:"Bool",name:"Bool",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Bytes",name:"Bytes",pkg:"",typ:$funcType([],[HK],false)},{prop:"runes",name:"runes",pkg:"reflect",typ:$funcType([],[HR],false)},{prop:"CanAddr",name:"CanAddr",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"CanSet",name:"CanSet",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Call",name:"Call",pkg:"",typ:$funcType([GW],[GW],false)},{prop:"CallSlice",name:"CallSlice",pkg:"",typ:$funcType([GW],[GW],false)},{prop:"Complex",name:"Complex",pkg:"",typ:$funcType([],[$Complex128],false)},{prop:"FieldByIndex",name:"FieldByIndex",pkg:"",typ:$funcType([HH],[DK],false)},{prop:"FieldByName",name:"FieldByName",pkg:"",typ:$funcType([$String],[DK],false)},{prop:"FieldByNameFunc",name:"FieldByNameFunc",pkg:"",typ:$funcType([HU],[DK],false)},{prop:"Float",name:"Float",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Int",name:"Int",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"CanInterface",name:"CanInterface",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Interface",name:"Interface",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"IsValid",name:"IsValid",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Kind",name:"Kind",pkg:"",typ:$funcType([],[BO],false)},{prop:"MapIndex",name:"MapIndex",pkg:"",typ:$funcType([DK],[DK],false)},{prop:"MapKeys",name:"MapKeys",pkg:"",typ:$funcType([],[GW],false)},{prop:"Method",name:"Method",pkg:"",typ:$funcType([$Int],[DK],false)},{prop:"NumMethod",name:"NumMethod",pkg:"",typ:$funcType([],[$Int],false)},{prop:"MethodByName",name:"MethodByName",pkg:"",typ:$funcType([$String],[DK],false)},{prop:"NumField",name:"NumField",pkg:"",typ:$funcType([],[$Int],false)},{prop:"OverflowComplex",name:"OverflowComplex",pkg:"",typ:$funcType([$Complex128],[$Bool],false)},{prop:"OverflowFloat",name:"OverflowFloat",pkg:"",typ:$funcType([$Float64],[$Bool],false)},{prop:"OverflowInt",name:"OverflowInt",pkg:"",typ:$funcType([$Int64],[$Bool],false)},{prop:"OverflowUint",name:"OverflowUint",pkg:"",typ:$funcType([$Uint64],[$Bool],false)},{prop:"Recv",name:"Recv",pkg:"",typ:$funcType([],[DK,$Bool],false)},{prop:"recv",name:"recv",pkg:"reflect",typ:$funcType([$Bool],[DK,$Bool],false)},{prop:"Send",name:"Send",pkg:"",typ:$funcType([DK],[],false)},{prop:"send",name:"send",pkg:"reflect",typ:$funcType([DK,$Bool],[$Bool],false)},{prop:"SetBool",name:"SetBool",pkg:"",typ:$funcType([$Bool],[],false)},{prop:"setRunes",name:"setRunes",pkg:"reflect",typ:$funcType([HR],[],false)},{prop:"SetComplex",name:"SetComplex",pkg:"",typ:$funcType([$Complex128],[],false)},{prop:"SetFloat",name:"SetFloat",pkg:"",typ:$funcType([$Float64],[],false)},{prop:"SetInt",name:"SetInt",pkg:"",typ:$funcType([$Int64],[],false)},{prop:"SetMapIndex",name:"SetMapIndex",pkg:"",typ:$funcType([DK,DK],[],false)},{prop:"SetUint",name:"SetUint",pkg:"",typ:$funcType([$Uint64],[],false)},{prop:"SetPointer",name:"SetPointer",pkg:"",typ:$funcType([$UnsafePointer],[],false)},{prop:"SetString",name:"SetString",pkg:"",typ:$funcType([$String],[],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"TryRecv",name:"TryRecv",pkg:"",typ:$funcType([],[DK,$Bool],false)},{prop:"TrySend",name:"TrySend",pkg:"",typ:$funcType([DK],[$Bool],false)},{prop:"Type",name:"Type",pkg:"",typ:$funcType([],[BN],false)},{prop:"Uint",name:"Uint",pkg:"",typ:$funcType([],[$Uint64],false)},{prop:"UnsafeAddr",name:"UnsafeAddr",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"assignTo",name:"assignTo",pkg:"reflect",typ:$funcType([$String,FX,$UnsafePointer],[DK],false)},{prop:"Convert",name:"Convert",pkg:"",typ:$funcType([BN],[DK],false)}];DL.methods=[{prop:"kind",name:"kind",pkg:"reflect",typ:$funcType([],[BO],false)},{prop:"mustBe",name:"mustBe",pkg:"reflect",typ:$funcType([BO],[],false)},{prop:"mustBeExported",name:"mustBeExported",pkg:"reflect",typ:$funcType([],[],false)},{prop:"mustBeAssignable",name:"mustBeAssignable",pkg:"reflect",typ:$funcType([],[],false)}];HY.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];AK.init([{prop:"t",name:"t",pkg:"reflect",typ:BN,tag:""},{prop:"m",name:"m",pkg:"reflect",typ:GK,tag:""},{prop:"keys",name:"keys",pkg:"reflect",typ:GK,tag:""},{prop:"i",name:"i",pkg:"reflect",typ:$Int,tag:""}]);BN.init([{prop:"Align",name:"Align",pkg:"",typ:$funcType([],[$Int],false)},{prop:"AssignableTo",name:"AssignableTo",pkg:"",typ:$funcType([BN],[$Bool],false)},{prop:"Bits",name:"Bits",pkg:"",typ:$funcType([],[$Int],false)},{prop:"ChanDir",name:"ChanDir",pkg:"",typ:$funcType([],[BT],false)},{prop:"Comparable",name:"Comparable",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"ConvertibleTo",name:"ConvertibleTo",pkg:"",typ:$funcType([BN],[$Bool],false)},{prop:"Elem",name:"Elem",pkg:"",typ:$funcType([],[BN],false)},{prop:"Field",name:"Field",pkg:"",typ:$funcType([$Int],[CG],false)},{prop:"FieldAlign",name:"FieldAlign",pkg:"",typ:$funcType([],[$Int],false)},{prop:"FieldByIndex",name:"FieldByIndex",pkg:"",typ:$funcType([HH],[CG],false)},{prop:"FieldByName",name:"FieldByName",pkg:"",typ:$funcType([$String],[CG,$Bool],false)},{prop:"FieldByNameFunc",name:"FieldByNameFunc",pkg:"",typ:$funcType([HU],[CG,$Bool],false)},{prop:"Implements",name:"Implements",pkg:"",typ:$funcType([BN],[$Bool],false)},{prop:"In",name:"In",pkg:"",typ:$funcType([$Int],[BN],false)},{prop:"IsVariadic",name:"IsVariadic",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Key",name:"Key",pkg:"",typ:$funcType([],[BN],false)},{prop:"Kind",name:"Kind",pkg:"",typ:$funcType([],[BO],false)},{prop:"Len",name:"Len",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Method",name:"Method",pkg:"",typ:$funcType([$Int],[CE],false)},{prop:"MethodByName",name:"MethodByName",pkg:"",typ:$funcType([$String],[CE,$Bool],false)},{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"NumField",name:"NumField",pkg:"",typ:$funcType([],[$Int],false)},{prop:"NumIn",name:"NumIn",pkg:"",typ:$funcType([],[$Int],false)},{prop:"NumMethod",name:"NumMethod",pkg:"",typ:$funcType([],[$Int],false)},{prop:"NumOut",name:"NumOut",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Out",name:"Out",pkg:"",typ:$funcType([$Int],[BN],false)},{prop:"PkgPath",name:"PkgPath",pkg:"",typ:$funcType([],[$String],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"common",name:"common",pkg:"reflect",typ:$funcType([],[FX],false)},{prop:"uncommon",name:"uncommon",pkg:"reflect",typ:$funcType([],[GQ],false)}]);BP.init([{prop:"size",name:"size",pkg:"reflect",typ:$Uintptr,tag:""},{prop:"ptrdata",name:"ptrdata",pkg:"reflect",typ:$Uintptr,tag:""},{prop:"hash",name:"hash",pkg:"reflect",typ:$Uint32,tag:""},{prop:"_$3",name:"_",pkg:"reflect",typ:$Uint8,tag:""},{prop:"align",name:"align",pkg:"reflect",typ:$Uint8,tag:""},{prop:"fieldAlign",name:"fieldAlign",pkg:"reflect",typ:$Uint8,tag:""},{prop:"kind",name:"kind",pkg:"reflect",typ:$Uint8,tag:""},{prop:"alg",name:"alg",pkg:"reflect",typ:GN,tag:""},{prop:"gcdata",name:"gcdata",pkg:"reflect",typ:GO,tag:""},{prop:"string",name:"string",pkg:"reflect",typ:GP,tag:""},{prop:"uncommonType",name:"",pkg:"reflect",typ:GQ,tag:""},{prop:"ptrToThis",name:"ptrToThis",pkg:"reflect",typ:FX,tag:""}]);BQ.init([{prop:"hash",name:"hash",pkg:"reflect",typ:HV,tag:""},{prop:"equal",name:"equal",pkg:"reflect",typ:HW,tag:""}]);BR.init([{prop:"name",name:"name",pkg:"reflect",typ:GP,tag:""},{prop:"pkgPath",name:"pkgPath",pkg:"reflect",typ:GP,tag:""},{prop:"mtyp",name:"mtyp",pkg:"reflect",typ:FX,tag:""},{prop:"typ",name:"typ",pkg:"reflect",typ:FX,tag:""},{prop:"ifn",name:"ifn",pkg:"reflect",typ:$UnsafePointer,tag:""},{prop:"tfn",name:"tfn",pkg:"reflect",typ:$UnsafePointer,tag:""}]);BS.init([{prop:"name",name:"name",pkg:"reflect",typ:GP,tag:""},{prop:"pkgPath",name:"pkgPath",pkg:"reflect",typ:GP,tag:""},{prop:"methods",name:"methods",pkg:"reflect",typ:GR,tag:""}]);BU.init([{prop:"rtype",name:"",pkg:"reflect",typ:BP,tag:"reflect:\"array\""},{prop:"elem",name:"elem",pkg:"reflect",typ:FX,tag:""},{prop:"slice",name:"slice",pkg:"reflect",typ:FX,tag:""},{prop:"len",name:"len",pkg:"reflect",typ:$Uintptr,tag:""}]);BV.init([{prop:"rtype",name:"",pkg:"reflect",typ:BP,tag:"reflect:\"chan\""},{prop:"elem",name:"elem",pkg:"reflect",typ:FX,tag:""},{prop:"dir",name:"dir",pkg:"reflect",typ:$Uintptr,tag:""}]);BW.init([{prop:"rtype",name:"",pkg:"reflect",typ:BP,tag:"reflect:\"func\""},{prop:"dotdotdot",name:"dotdotdot",pkg:"reflect",typ:$Bool,tag:""},{prop:"in$2",name:"in",pkg:"reflect",typ:GD,tag:""},{prop:"out",name:"out",pkg:"reflect",typ:GD,tag:""}]);BX.init([{prop:"name",name:"name",pkg:"reflect",typ:GP,tag:""},{prop:"pkgPath",name:"pkgPath",pkg:"reflect",typ:GP,tag:""},{prop:"typ",name:"typ",pkg:"reflect",typ:FX,tag:""}]);BY.init([{prop:"rtype",name:"",pkg:"reflect",typ:BP,tag:"reflect:\"interface\""},{prop:"methods",name:"methods",pkg:"reflect",typ:GS,tag:""}]);BZ.init([{prop:"rtype",name:"",pkg:"reflect",typ:BP,tag:"reflect:\"map\""},{prop:"key",name:"key",pkg:"reflect",typ:FX,tag:""},{prop:"elem",name:"elem",pkg:"reflect",typ:FX,tag:""},{prop:"bucket",name:"bucket",pkg:"reflect",typ:FX,tag:""},{prop:"hmap",name:"hmap",pkg:"reflect",typ:FX,tag:""},{prop:"keysize",name:"keysize",pkg:"reflect",typ:$Uint8,tag:""},{prop:"indirectkey",name:"indirectkey",pkg:"reflect",typ:$Uint8,tag:""},{prop:"valuesize",name:"valuesize",pkg:"reflect",typ:$Uint8,tag:""},{prop:"indirectvalue",name:"indirectvalue",pkg:"reflect",typ:$Uint8,tag:""},{prop:"bucketsize",name:"bucketsize",pkg:"reflect",typ:$Uint16,tag:""},{prop:"reflexivekey",name:"reflexivekey",pkg:"reflect",typ:$Bool,tag:""},{prop:"needkeyupdate",name:"needkeyupdate",pkg:"reflect",typ:$Bool,tag:""}]);CA.init([{prop:"rtype",name:"",pkg:"reflect",typ:BP,tag:"reflect:\"ptr\""},{prop:"elem",name:"elem",pkg:"reflect",typ:FX,tag:""}]);CB.init([{prop:"rtype",name:"",pkg:"reflect",typ:BP,tag:"reflect:\"slice\""},{prop:"elem",name:"elem",pkg:"reflect",typ:FX,tag:""}]);CC.init([{prop:"name",name:"name",pkg:"reflect",typ:GP,tag:""},{prop:"pkgPath",name:"pkgPath",pkg:"reflect",typ:GP,tag:""},{prop:"typ",name:"typ",pkg:"reflect",typ:FX,tag:""},{prop:"tag",name:"tag",pkg:"reflect",typ:GP,tag:""},{prop:"offset",name:"offset",pkg:"reflect",typ:$Uintptr,tag:""}]);CD.init([{prop:"rtype",name:"",pkg:"reflect",typ:BP,tag:"reflect:\"struct\""},{prop:"fields",name:"fields",pkg:"reflect",typ:GT,tag:""}]);CE.init([{prop:"Name",name:"Name",pkg:"",typ:$String,tag:""},{prop:"PkgPath",name:"PkgPath",pkg:"",typ:$String,tag:""},{prop:"Type",name:"Type",pkg:"",typ:BN,tag:""},{prop:"Func",name:"Func",pkg:"",typ:DK,tag:""},{prop:"Index",name:"Index",pkg:"",typ:$Int,tag:""}]);CG.init([{prop:"Name",name:"Name",pkg:"",typ:$String,tag:""},{prop:"PkgPath",name:"PkgPath",pkg:"",typ:$String,tag:""},{prop:"Type",name:"Type",pkg:"",typ:BN,tag:""},{prop:"Tag",name:"Tag",pkg:"",typ:CH,tag:""},{prop:"Offset",name:"Offset",pkg:"",typ:$Uintptr,tag:""},{prop:"Index",name:"Index",pkg:"",typ:HH,tag:""},{prop:"Anonymous",name:"Anonymous",pkg:"",typ:$Bool,tag:""}]);CI.init([{prop:"typ",name:"typ",pkg:"reflect",typ:HJ,tag:""},{prop:"index",name:"index",pkg:"reflect",typ:HH,tag:""}]);DK.init([{prop:"typ",name:"typ",pkg:"reflect",typ:FX,tag:""},{prop:"ptr",name:"ptr",pkg:"reflect",typ:$UnsafePointer,tag:""},{prop:"flag",name:"",pkg:"reflect",typ:DL,tag:""}]);DO.init([{prop:"Method",name:"Method",pkg:"",typ:$String,tag:""},{prop:"Kind",name:"Kind",pkg:"",typ:BO,tag:""}]);DQ.init([{prop:"itab",name:"itab",pkg:"reflect",typ:HA,tag:""},{prop:"word",name:"word",pkg:"reflect",typ:$UnsafePointer,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=F.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E.$init();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}G=false;L={};AW=$assertType($internalize($call,$emptyInterface),GL);BB=$assertType($internalize($select,$emptyInterface),GL);CF=new GM(["invalid","bool","int","int8","int16","int32","int64","uint","uint8","uint16","uint32","uint64","uintptr","float32","float64","complex64","complex128","array","chan","func","interface","map","ptr","slice","string","struct","unsafe.Pointer"]);AX=J($jsObjectPtr);DX=$assertType(R(new $Uint8(0)),FX);$r=H();$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["encoding/binary"]=(function(){var $pkg={},$init,A,B,C,D,U;A=$packages["errors"];B=$packages["io"];C=$packages["math"];D=$packages["reflect"];$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}U=A.New("binary: varint overflows a 64-bit integer");}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["syscall"]=(function(){var $pkg={},$init,A,D,B,C,FQ,FR,MM,MV,MX,OO,OQ,OY,PW,QK,QL,QO,QP,QU,QV,QW,QX,RB,RE,E,F,N,O,P,W,X,Y,Z,FD,FS,FT,FU,GV,OX,GW,G,H,I,J,K,L,Q,R,S,V,AB,AD,BL,BM,CJ,CK,EW,EX,EY,FV,FX,FY,HP,HW,HZ,IA,IG,IH,JB,JW,KA,KI,KJ,KL,KW,KX,KY,KZ,MF;A=$packages["github.com/gopherjs/gopherjs/js"];D=$packages["internal/race"];B=$packages["runtime"];C=$packages["sync"];FQ=$pkg.mmapper=$newType(0,$kindStruct,"syscall.mmapper","mmapper","syscall",function(Mutex_,active_,mmap_,munmap_){this.$val=this;if(arguments.length===0){this.Mutex=new C.Mutex.ptr(0,0);this.active=false;this.mmap=$throwNilPointerError;this.munmap=$throwNilPointerError;return;}this.Mutex=Mutex_;this.active=active_;this.mmap=mmap_;this.munmap=munmap_;});FR=$pkg.Errno=$newType(4,$kindUintptr,"syscall.Errno","Errno","syscall",null);MM=$pkg.Timespec=$newType(0,$kindStruct,"syscall.Timespec","Timespec","syscall",function(Sec_,Nsec_){this.$val=this;if(arguments.length===0){this.Sec=new $Int64(0,0);this.Nsec=new $Int64(0,0);return;}this.Sec=Sec_;this.Nsec=Nsec_;});MV=$pkg.Stat_t=$newType(0,$kindStruct,"syscall.Stat_t","Stat_t","syscall",function(Dev_,Ino_,Nlink_,Mode_,Uid_,Gid_,X__pad0_,Rdev_,Size_,Blksize_,Blocks_,Atim_,Mtim_,Ctim_,X__unused_){this.$val=this;if(arguments.length===0){this.Dev=new $Uint64(0,0);this.Ino=new $Uint64(0,0);this.Nlink=new $Uint64(0,0);this.Mode=0;this.Uid=0;this.Gid=0;this.X__pad0=0;this.Rdev=new $Uint64(0,0);this.Size=new $Int64(0,0);this.Blksize=new $Int64(0,0);this.Blocks=new $Int64(0,0);this.Atim=new MM.ptr(new $Int64(0,0),new $Int64(0,0));this.Mtim=new MM.ptr(new $Int64(0,0),new $Int64(0,0));this.Ctim=new MM.ptr(new $Int64(0,0),new $Int64(0,0));this.X__unused=RE.zero();return;}this.Dev=Dev_;this.Ino=Ino_;this.Nlink=Nlink_;this.Mode=Mode_;this.Uid=Uid_;this.Gid=Gid_;this.X__pad0=X__pad0_;this.Rdev=Rdev_;this.Size=Size_;this.Blksize=Blksize_;this.Blocks=Blocks_;this.Atim=Atim_;this.Mtim=Mtim_;this.Ctim=Ctim_;this.X__unused=X__unused_;});MX=$pkg.Dirent=$newType(0,$kindStruct,"syscall.Dirent","Dirent","syscall",function(Ino_,Off_,Reclen_,Type_,Name_,Pad_cgo_0_){this.$val=this;if(arguments.length===0){this.Ino=new $Uint64(0,0);this.Off=new $Int64(0,0);this.Reclen=0;this.Type=0;this.Name=QK.zero();this.Pad_cgo_0=QL.zero();return;}this.Ino=Ino_;this.Off=Off_;this.Reclen=Reclen_;this.Type=Type_;this.Name=Name_;this.Pad_cgo_0=Pad_cgo_0_;});OO=$sliceType($Uint8);OQ=$sliceType($String);OY=$ptrType($Uint8);PW=$arrayType($Uint8,32);QK=$arrayType($Int8,256);QL=$arrayType($Uint8,5);QO=$structType([{prop:"addr",name:"addr",pkg:"syscall",typ:$Uintptr,tag:""},{prop:"len",name:"len",pkg:"syscall",typ:$Int,tag:""},{prop:"cap",name:"cap",pkg:"syscall",typ:$Int,tag:""}]);QP=$ptrType($Int64);QU=$ptrType(FQ);QV=$mapType(OY,OO);QW=$funcType([$Uintptr,$Uintptr,$Int,$Int,$Int,$Int64],[$Uintptr,$error],false);QX=$funcType([$Uintptr,$Uintptr],[$error],false);RB=$ptrType(MM);RE=$arrayType($Int64,3);G=function(){var $ptr;$flushConsole=(function(){var $ptr;if(!((F.$length===0))){$global.console.log($externalize($bytesToString(F),$String));F=OO.nil;}});};H=function(){var $ptr;if(!E){$global.console.error($externalize("warning: system calls not available, see https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md",$String));}E=true;};I=function(i){var $ptr,i,j,k;j=$global.goPrintToConsole;if(!(j===undefined)){j(i);return;}F=$appendSlice(F,i);while(true){k=K(F,10);if(k===-1){break;}$global.console.log($externalize($bytesToString($subslice(F,0,k)),$String));F=$subslice(F,(k+1>>0));}};J=function(i){var $ptr,i;};K=function(i,j){var $ptr,i,j,k,l,m,n;k=i;l=0;while(true){if(!(l=k.$length)?$throwRuntimeError("index out of range"):k.$array[k.$offset+l]);if(n===j){return m;}l++;}return-1;};L=function(){var $ptr,i,j,k,l,m,n;i=$global.process;if(i===undefined){return OQ.nil;}j=i.env;k=$global.Object.keys(j);l=$makeSlice(OQ,$parseInt(k.length));m=0;while(true){if(!(m<$parseInt(k.length))){break;}n=$internalize(k[m],$String);((m<0||m>=l.$length)?$throwRuntimeError("index out of range"):l.$array[l.$offset+m]=n+"="+$internalize(j[$externalize(n,$String)],$String));m=m+(1)>>0;}return l;};Q=function(i){var $ptr,i,j,$deferred;var $err=null;try{$deferred=[];$deferred.index=$curGoroutine.deferStack.length;$curGoroutine.deferStack.push($deferred);$deferred.push([(function(){var $ptr;$recover();}),[]]);if(N===null){if(O){return null;}O=true;j=$global.require;if(j===undefined){$panic(new $String(""));}N=j($externalize("syscall",$String));}return N[$externalize(i,$String)];}catch(err){$err=err;return null;}finally{$callDeferred($deferred,$err);}};R=function(i,j,k,l){var $ptr,aa,ab,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;m=0;n=0;o=0;p=Q("Syscall");if(!(p===null)){q=p(i,j,k,l);r=(($parseInt(q[0])>>0)>>>0);s=(($parseInt(q[1])>>0)>>>0);t=(($parseInt(q[2])>>0)>>>0);m=r;n=s;o=t;return[m,n,o];}if((i===1)&&((j===1)||(j===2))){u=k;v=$makeSlice(OO,$parseInt(u.length));v.$array=u;I(v);w=($parseInt(u.length)>>>0);x=0;y=0;m=w;n=x;o=y;return[m,n,o];}if(i===60){B.Goexit();}H();z=(P>>>0);aa=0;ab=13;m=z;n=aa;o=ab;return[m,n,o];};$pkg.Syscall=R;S=function(i,j,k,l,m,n,o){var $ptr,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;p=0;q=0;r=0;s=Q("Syscall6");if(!(s===null)){t=s(i,j,k,l,m,n,o);u=(($parseInt(t[0])>>0)>>>0);v=(($parseInt(t[1])>>0)>>>0);w=(($parseInt(t[2])>>0)>>>0);p=u;q=v;r=w;return[p,q,r];}if(!((i===202))){H();}x=(P>>>0);y=0;z=13;p=x;q=y;r=z;return[p,q,r];};$pkg.Syscall6=S;V=function(i){var $ptr,i,j,k,l,m,n;j=new($global.Uint8Array)(i.length+1>>0);k=new OO($stringToBytes(i));l=0;while(true){if(!(l=k.$length)?$throwRuntimeError("index out of range"):k.$array[k.$offset+l]);if(n===0){return[OY.nil,new FR(22)];}j[m]=n;l++;}j[i.length]=0;return[j,$ifaceNil];};$pkg.BytePtrFromString=V;AB=function(){var $ptr,i,j,k,l,m,n,o,p,q,r;Y={};i=Z;j=0;while(true){if(!(j=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+j]);m=0;while(true){if(!(m=Z.$length)?$throwRuntimeError("index out of range"):Z.$array[Z.$offset+k]="");}break;}m=m+(1)>>0;}j++;}};AD=function(i){var $ptr,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,$s,$deferred,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;$s=$f.$s;$deferred=$f.$deferred;$r=$f.$r;}var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$deferred.index=$curGoroutine.deferStack.length;$curGoroutine.deferStack.push($deferred);j="";k=false;$r=W.Do(AB);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(i.length===0){l="";m=false;j=l;k=m;return[j,k];}$r=X.RLock();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$deferred.push([$methodVal(X,"RUnlock"),[]]);n=(o=Y[$String.keyFor(i)],o!==undefined?[o.v,true]:[0,false]);p=n[0];q=n[1];if(!q){r="";s=false;j=r;k=s;return[j,k];}t=((p<0||p>=Z.$length)?$throwRuntimeError("index out of range"):Z.$array[Z.$offset+p]);u=0;while(true){if(!(u>0));w=true;j=v;k=w;return[j,k];}u=u+(1)>>0;}x="";y=false;j=x;k=y;return[j,k];}return;}}catch(err){$err=err;$s=-1;}finally{$callDeferred($deferred,$err);if(!$curGoroutine.asleep){return[j,k];}if($curGoroutine.asleep){if($f===undefined){$f={$blk:AD};}$f.$ptr=$ptr;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.$s=$s;$f.$deferred=$deferred;$f.$r=$r;return $f;}}};$pkg.Getenv=AD;BL=function(i,j){var $ptr,i,j;};BM=function(i,j){var $ptr,i,j;};CJ=function(i){var $ptr,i;if(i<0){return"-"+CK((-i>>>0));}return CK((i>>>0));};CK=function(i){var $ptr,i,j,k,l,m;j=PW.zero();k=31;while(true){if(!(i>=10)){break;}((k<0||k>=j.length)?$throwRuntimeError("index out of range"):j[k]=(((l=i%10,l===l?l:$throwRuntimeError("integer divide by zero"))+48>>>0)<<24>>>24));k=k-(1)>>0;i=(m=i/(10),(m===m&&m!==1/0&&m!==-1/0)?m>>>0:$throwRuntimeError("integer divide by zero"));}((k<0||k>=j.length)?$throwRuntimeError("index out of range"):j[k]=((i+48>>>0)<<24>>>24));return $bytesToString($subslice(new OO(j),k));};MM.ptr.prototype.Unix=function(){var $ptr,i,j,k,l,m;i=new $Int64(0,0);j=new $Int64(0,0);k=this;l=k.Sec;m=k.Nsec;i=l;j=m;return[i,j];};MM.prototype.Unix=function(){return this.$val.Unix();};MM.ptr.prototype.Nano=function(){var $ptr,i,j,k;i=this;return(j=$mul64(i.Sec,new $Int64(0,1000000000)),k=i.Nsec,new $Int64(j.$high+k.$high,j.$low+k.$low));};MM.prototype.Nano=function(){return this.$val.Nano();};EW=function(i){var $ptr,i,j;j=0;while(true){if(!(j=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+j])===0){return j;}j=j+(1)>>0;}return i.$length;};EX=function(i,j){var $ptr,i,j,k,l,m;k=0;l=$ifaceNil;m=IH(i,j);k=m[0];l=m[1];return[k,l];};$pkg.ReadDirent=EX;EY=function(i,j,k){var $ptr,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;l=0;m=0;n=OQ.nil;o=i.$length;m=0;while(true){if(!(!((j===0))&&i.$length>0)){break;}s=(p=$sliceToArray(i),q=new MX.ptr(new $Uint64(0,0),new $Int64(0,0),0,0,QK.zero(),QL.zero()),r=new DataView(p.buffer,p.byteOffset),q.Ino=new $Uint64(r.getUint32(4,true),r.getUint32(0,true)),q.Off=new $Int64(r.getUint32(12,true),r.getUint32(8,true)),q.Reclen=r.getUint16(16,true),q.Type=r.getUint8(18,true),q.Name=new($nativeArray($kindInt8))(p.buffer,$min(p.byteOffset+19,p.buffer.byteLength)),q.Pad_cgo_0=new($nativeArray($kindUint8))(p.buffer,$min(p.byteOffset+275,p.buffer.byteLength)),q);i=$subslice(i,s.Reclen);if((t=s.Ino,(t.$high===0&&t.$low===0))){continue;}u=$sliceToArray(new OO(s.Name));v=$bytesToString($subslice(new OO(u),0,EW(new OO(u))));if(v==="."||v===".."){continue;}j=j-(1)>>0;m=m+(1)>>0;k=$append(k,v);}w=o-i.$length>>0;x=m;y=k;l=w;m=x;n=y;return[l,m,n];};$pkg.ParseDirent=EY;FQ.ptr.prototype.Mmap=function(i,j,k,l,m){var $ptr,aa,ab,ac,ad,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$deferred,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$deferred=$f.$deferred;$r=$f.$r;}var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$deferred.index=$curGoroutine.deferStack.length;$curGoroutine.deferStack.push($deferred);n=[n];o=OO.nil;p=$ifaceNil;q=this;if(k<=0){r=OO.nil;s=new FR(22);o=r;p=s;return[o,p];}u=q.mmap(0,(k>>>0),l,m,i,j);$s=1;case 1:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}t=u;v=t[0];w=t[1];if(!($interfaceIsEqual(w,$ifaceNil))){x=OO.nil;y=w;o=x;p=y;return[o,p];}n[0]=new QO.ptr(v,k,k);z=n[0];aa=$indexPtr(z.$array,z.$offset+(z.$capacity-1>>0),OY);$r=q.Mutex.Lock();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$deferred.push([$methodVal(q.Mutex,"Unlock"),[]]);ab=aa;(q.active||$throwRuntimeError("assignment to entry in nil map"))[OY.keyFor(ab)]={k:ab,v:z};ac=z;ad=$ifaceNil;o=ac;p=ad;return[o,p];}return;}}catch(err){$err=err;$s=-1;}finally{$callDeferred($deferred,$err);if(!$curGoroutine.asleep){return[o,p];}if($curGoroutine.asleep){if($f===undefined){$f={$blk:FQ.ptr.prototype.Mmap};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$deferred=$deferred;$f.$r=$r;return $f;}}};FQ.prototype.Mmap=function(i,j,k,l,m){return this.$val.Mmap(i,j,k,l,m);};FQ.ptr.prototype.Munmap=function(i){var $ptr,i,j,k,l,m,n,o,p,$s,$deferred,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;$s=$f.$s;$deferred=$f.$deferred;$r=$f.$r;}var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$deferred.index=$curGoroutine.deferStack.length;$curGoroutine.deferStack.push($deferred);j=$ifaceNil;k=this;if((i.$length===0)||!((i.$length===i.$capacity))){j=new FR(22);return j;}l=$indexPtr(i.$array,i.$offset+(i.$capacity-1>>0),OY);$r=k.Mutex.Lock();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$deferred.push([$methodVal(k.Mutex,"Unlock"),[]]);n=(m=k.active[OY.keyFor(l)],m!==undefined?m.v:OO.nil);if(n===OO.nil||!($indexPtr(n.$array,n.$offset+0,OY)===$indexPtr(i.$array,i.$offset+0,OY))){j=new FR(22);return j;}o=k.munmap($sliceToArray(n),(n.$length>>>0));$s=2;case 2:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}p=o;if(!($interfaceIsEqual(p,$ifaceNil))){j=p;return j;}delete k.active[OY.keyFor(l)];j=$ifaceNil;return j;}return;}}catch(err){$err=err;$s=-1;}finally{$callDeferred($deferred,$err);if(!$curGoroutine.asleep){return j;}if($curGoroutine.asleep){if($f===undefined){$f={$blk:FQ.ptr.prototype.Munmap};}$f.$ptr=$ptr;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.$s=$s;$f.$deferred=$deferred;$f.$r=$r;return $f;}}};FQ.prototype.Munmap=function(i){return this.$val.Munmap(i);};FR.prototype.Error=function(){var $ptr,i,j;i=this.$val;if(0<=(i>>0)&&(i>>0)<133){j=((i<0||i>=GW.length)?$throwRuntimeError("index out of range"):GW[i]);if(!(j==="")){return j;}}return"errno "+CJ((i>>0));};$ptrType(FR).prototype.Error=function(){return new FR(this.$get()).Error();};FR.prototype.Temporary=function(){var $ptr,i;i=this.$val;return(i===4)||(i===24)||(i===104)||(i===103)||new FR(i).Timeout();};$ptrType(FR).prototype.Temporary=function(){return new FR(this.$get()).Temporary();};FR.prototype.Timeout=function(){var $ptr,i;i=this.$val;return(i===11)||(i===11)||(i===110);};$ptrType(FR).prototype.Timeout=function(){return new FR(this.$get()).Timeout();};FV=function(i){var $ptr,i,j;j=i;if(j===(0)){return $ifaceNil;}else if(j===(11)){return FS;}else if(j===(22)){return FT;}else if(j===(2)){return FU;}return new FR(i);};FX=function(i,j){var $ptr,i,j,k,l,m;k=0;l=$ifaceNil;m=JB(i,j);k=m[0];l=m[1];if(false){if(k>0){D.WriteRange($sliceToArray(j),k);}if($interfaceIsEqual(l,$ifaceNil)){D.Acquire((OX||(OX=new QP(function(){return GV;},function($v){GV=$v;}))));}}if(false&&k>0){BM($sliceToArray(j),k);}return[k,l];};$pkg.Read=FX;FY=function(i,j){var $ptr,i,j,k,l,m;k=0;l=$ifaceNil;if(false){D.ReleaseMerge((OX||(OX=new QP(function(){return GV;},function($v){GV=$v;}))));}m=JW(i,j);k=m[0];l=m[1];if(false&&k>0){D.ReadRange($sliceToArray(j),k);}if(false&&k>0){BL($sliceToArray(j),k);}return[k,l];};$pkg.Write=FY;HP=function(i){var $ptr,i,j,k,l;j=$ifaceNil;k=R(3,(i>>>0),0,0);l=k[2];if(!((l===0))){j=FV(l);}return j;};$pkg.Close=HP;HW=function(i){var $ptr,i;R(231,(i>>>0),0,0);return;};$pkg.Exit=HW;HZ=function(i){var $ptr,i,j,k,l;j=$ifaceNil;k=R(81,(i>>>0),0,0);l=k[2];if(!((l===0))){j=FV(l);}return j;};$pkg.Fchdir=HZ;IA=function(i,j){var $ptr,i,j,k,l,m;k=$ifaceNil;l=R(91,(i>>>0),(j>>>0),0);m=l[2];if(!((m===0))){k=FV(m);}return k;};$pkg.Fchmod=IA;IG=function(i){var $ptr,i,j,k,l;j=$ifaceNil;k=R(74,(i>>>0),0,0);l=k[2];if(!((l===0))){j=FV(l);}return j;};$pkg.Fsync=IG;IH=function(i,j){var $ptr,i,j,k,l,m,n,o,p;k=0;l=$ifaceNil;m=0;if(j.$length>0){m=$sliceToArray(j);}else{m=new Uint8Array(0);}n=R(217,(i>>>0),m,(j.$length>>>0));o=n[0];p=n[2];k=(o>>0);if(!((p===0))){l=FV(p);}return[k,l];};$pkg.Getdents=IH;JB=function(i,j){var $ptr,i,j,k,l,m,n,o,p;k=0;l=$ifaceNil;m=0;if(j.$length>0){m=$sliceToArray(j);}else{m=new Uint8Array(0);}n=R(0,(i>>>0),m,(j.$length>>>0));o=n[0];p=n[2];k=(o>>0);if(!((p===0))){l=FV(p);}return[k,l];};JW=function(i,j){var $ptr,i,j,k,l,m,n,o,p;k=0;l=$ifaceNil;m=0;if(j.$length>0){m=$sliceToArray(j);}else{m=new Uint8Array(0);}n=R(1,(i>>>0),m,(j.$length>>>0));o=n[0];p=n[2];k=(o>>0);if(!((p===0))){l=FV(p);}return[k,l];};KA=function(i,j){var $ptr,i,j,k,l,m;k=$ifaceNil;l=R(11,i,j,0);m=l[2];if(!((m===0))){k=FV(m);}return k;};KI=function(i,j,k){var $ptr,i,j,k,l,m,n;l=$ifaceNil;m=R(93,(i>>>0),(j>>>0),(k>>>0));n=m[2];if(!((n===0))){l=FV(n);}return l;};$pkg.Fchown=KI;KJ=function(i,j){var $ptr,i,j,k,l,m,n,o,p;k=$ifaceNil;m=new Uint8Array(144);l=R(5,(i>>>0),m,0);n=j,o=new DataView(m.buffer,m.byteOffset),n.Dev=new $Uint64(o.getUint32(4,true),o.getUint32(0,true)),n.Ino=new $Uint64(o.getUint32(12,true),o.getUint32(8,true)),n.Nlink=new $Uint64(o.getUint32(20,true),o.getUint32(16,true)),n.Mode=o.getUint32(24,true),n.Uid=o.getUint32(28,true),n.Gid=o.getUint32(32,true),n.X__pad0=o.getInt32(36,true),n.Rdev=new $Uint64(o.getUint32(44,true),o.getUint32(40,true)),n.Size=new $Int64(o.getUint32(52,true),o.getUint32(48,true)),n.Blksize=new $Int64(o.getUint32(60,true),o.getUint32(56,true)),n.Blocks=new $Int64(o.getUint32(68,true),o.getUint32(64,true)),n.Atim.Sec=new $Int64(o.getUint32(76,true),o.getUint32(72,true)),n.Atim.Nsec=new $Int64(o.getUint32(84,true),o.getUint32(80,true)),n.Mtim.Sec=new $Int64(o.getUint32(92,true),o.getUint32(88,true)),n.Mtim.Nsec=new $Int64(o.getUint32(100,true),o.getUint32(96,true)),n.Ctim.Sec=new $Int64(o.getUint32(108,true),o.getUint32(104,true)),n.Ctim.Nsec=new $Int64(o.getUint32(116,true),o.getUint32(112,true)),n.X__unused=new($nativeArray($kindInt64))(m.buffer,$min(m.byteOffset+120,m.buffer.byteLength));p=l[2];if(!((p===0))){k=FV(p);}return k;};$pkg.Fstat=KJ;KL=function(i,j){var $ptr,i,j,k,l,m;k=$ifaceNil;l=R(77,(i>>>0),(j.$low>>>0),0);m=l[2];if(!((m===0))){k=FV(m);}return k;};$pkg.Ftruncate=KL;KW=function(i,j){var $ptr,i,j,k,l,m,n,o,p,q,r;k=$ifaceNil;l=OY.nil;m=V(i);l=m[0];k=m[1];if(!($interfaceIsEqual(k,$ifaceNil))){return k;}o=new Uint8Array(144);n=R(6,l,o,0);p=j,q=new DataView(o.buffer,o.byteOffset),p.Dev=new $Uint64(q.getUint32(4,true),q.getUint32(0,true)),p.Ino=new $Uint64(q.getUint32(12,true),q.getUint32(8,true)),p.Nlink=new $Uint64(q.getUint32(20,true),q.getUint32(16,true)),p.Mode=q.getUint32(24,true),p.Uid=q.getUint32(28,true),p.Gid=q.getUint32(32,true),p.X__pad0=q.getInt32(36,true),p.Rdev=new $Uint64(q.getUint32(44,true),q.getUint32(40,true)),p.Size=new $Int64(q.getUint32(52,true),q.getUint32(48,true)),p.Blksize=new $Int64(q.getUint32(60,true),q.getUint32(56,true)),p.Blocks=new $Int64(q.getUint32(68,true),q.getUint32(64,true)),p.Atim.Sec=new $Int64(q.getUint32(76,true),q.getUint32(72,true)),p.Atim.Nsec=new $Int64(q.getUint32(84,true),q.getUint32(80,true)),p.Mtim.Sec=new $Int64(q.getUint32(92,true),q.getUint32(88,true)),p.Mtim.Nsec=new $Int64(q.getUint32(100,true),q.getUint32(96,true)),p.Ctim.Sec=new $Int64(q.getUint32(108,true),q.getUint32(104,true)),p.Ctim.Nsec=new $Int64(q.getUint32(116,true),q.getUint32(112,true)),p.X__unused=new($nativeArray($kindInt64))(o.buffer,$min(o.byteOffset+120,o.buffer.byteLength));r=n[2];J(l);if(!((r===0))){k=FV(r);}return k;};$pkg.Lstat=KW;KX=function(i,j,k){var $ptr,i,j,k,l,m,n,o,p,q;l=0;m=$ifaceNil;n=0;if(j.$length>0){n=$sliceToArray(j);}else{n=new Uint8Array(0);}o=S(17,(i>>>0),n,(j.$length>>>0),(k.$low>>>0),0,0);p=o[0];q=o[2];l=(p>>0);if(!((q===0))){m=FV(q);}return[l,m];};$pkg.Pread=KX;KY=function(i,j,k){var $ptr,i,j,k,l,m,n,o,p,q;l=0;m=$ifaceNil;n=0;if(j.$length>0){n=$sliceToArray(j);}else{n=new Uint8Array(0);}o=S(18,(i>>>0),n,(j.$length>>>0),(k.$low>>>0),0,0);p=o[0];q=o[2];l=(p>>0);if(!((q===0))){m=FV(q);}return[l,m];};$pkg.Pwrite=KY;KZ=function(i,j,k){var $ptr,i,j,k,l,m,n,o,p;l=new $Int64(0,0);m=$ifaceNil;n=R(8,(i>>>0),(j.$low>>>0),(k>>>0));o=n[0];p=n[2];l=new $Int64(0,o.constructor===Number?o:1);if(!((p===0))){m=FV(p);}return[l,m];};$pkg.Seek=KZ;MF=function(i,j,k,l,m,n){var $ptr,i,j,k,l,m,n,o,p,q,r,s;o=0;p=$ifaceNil;q=S(9,i,j,(k>>>0),(l>>>0),(m>>>0),(n.$low>>>0));r=q[0];s=q[2];o=r;if(!((s===0))){p=FV(s);}return[o,p];};QU.methods=[{prop:"Mmap",name:"Mmap",pkg:"",typ:$funcType([$Int,$Int64,$Int,$Int,$Int],[OO,$error],false)},{prop:"Munmap",name:"Munmap",pkg:"",typ:$funcType([OO],[$error],false)}];FR.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)},{prop:"Temporary",name:"Temporary",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Timeout",name:"Timeout",pkg:"",typ:$funcType([],[$Bool],false)}];RB.methods=[{prop:"Unix",name:"Unix",pkg:"",typ:$funcType([],[$Int64,$Int64],false)},{prop:"Nano",name:"Nano",pkg:"",typ:$funcType([],[$Int64],false)}];FQ.init([{prop:"Mutex",name:"",pkg:"",typ:C.Mutex,tag:""},{prop:"active",name:"active",pkg:"syscall",typ:QV,tag:""},{prop:"mmap",name:"mmap",pkg:"syscall",typ:QW,tag:""},{prop:"munmap",name:"munmap",pkg:"syscall",typ:QX,tag:""}]);MM.init([{prop:"Sec",name:"Sec",pkg:"",typ:$Int64,tag:""},{prop:"Nsec",name:"Nsec",pkg:"",typ:$Int64,tag:""}]);MV.init([{prop:"Dev",name:"Dev",pkg:"",typ:$Uint64,tag:""},{prop:"Ino",name:"Ino",pkg:"",typ:$Uint64,tag:""},{prop:"Nlink",name:"Nlink",pkg:"",typ:$Uint64,tag:""},{prop:"Mode",name:"Mode",pkg:"",typ:$Uint32,tag:""},{prop:"Uid",name:"Uid",pkg:"",typ:$Uint32,tag:""},{prop:"Gid",name:"Gid",pkg:"",typ:$Uint32,tag:""},{prop:"X__pad0",name:"X__pad0",pkg:"",typ:$Int32,tag:""},{prop:"Rdev",name:"Rdev",pkg:"",typ:$Uint64,tag:""},{prop:"Size",name:"Size",pkg:"",typ:$Int64,tag:""},{prop:"Blksize",name:"Blksize",pkg:"",typ:$Int64,tag:""},{prop:"Blocks",name:"Blocks",pkg:"",typ:$Int64,tag:""},{prop:"Atim",name:"Atim",pkg:"",typ:MM,tag:""},{prop:"Mtim",name:"Mtim",pkg:"",typ:MM,tag:""},{prop:"Ctim",name:"Ctim",pkg:"",typ:MM,tag:""},{prop:"X__unused",name:"X__unused",pkg:"",typ:RE,tag:""}]);MX.init([{prop:"Ino",name:"Ino",pkg:"",typ:$Uint64,tag:""},{prop:"Off",name:"Off",pkg:"",typ:$Int64,tag:""},{prop:"Reclen",name:"Reclen",pkg:"",typ:$Uint16,tag:""},{prop:"Type",name:"Type",pkg:"",typ:$Uint8,tag:""},{prop:"Name",name:"Name",pkg:"",typ:QK,tag:""},{prop:"Pad_cgo_0",name:"Pad_cgo_0",pkg:"",typ:QL,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}F=OO.nil;N=null;W=new C.Once.ptr(new C.Mutex.ptr(0,0),0);X=new C.RWMutex.ptr(new C.Mutex.ptr(0,0),0,0,0,0);Y=false;GV=new $Int64(0,0);E=false;O=false;P=-1;Z=L();$pkg.Stdin=0;$pkg.Stdout=1;$pkg.Stderr=2;FS=new FR(11);FT=new FR(22);FU=new FR(2);GW=$toNativeArray($kindString,["","operation not permitted","no such file or directory","no such process","interrupted system call","input/output error","no such device or address","argument list too long","exec format error","bad file descriptor","no child processes","resource temporarily unavailable","cannot allocate memory","permission denied","bad address","block device required","device or resource busy","file exists","invalid cross-device link","no such device","not a directory","is a directory","invalid argument","too many open files in system","too many open files","inappropriate ioctl for device","text file busy","file too large","no space left on device","illegal seek","read-only file system","too many links","broken pipe","numerical argument out of domain","numerical result out of range","resource deadlock avoided","file name too long","no locks available","function not implemented","directory not empty","too many levels of symbolic links","","no message of desired type","identifier removed","channel number out of range","level 2 not synchronized","level 3 halted","level 3 reset","link number out of range","protocol driver not attached","no CSI structure available","level 2 halted","invalid exchange","invalid request descriptor","exchange full","no anode","invalid request code","invalid slot","","bad font file format","device not a stream","no data available","timer expired","out of streams resources","machine is not on the network","package not installed","object is remote","link has been severed","advertise error","srmount error","communication error on send","protocol error","multihop attempted","RFS specific error","bad message","value too large for defined data type","name not unique on network","file descriptor in bad state","remote address changed","can not access a needed shared library","accessing a corrupted shared library",".lib section in a.out corrupted","attempting to link in too many shared libraries","cannot exec a shared library directly","invalid or incomplete multibyte or wide character","interrupted system call should be restarted","streams pipe error","too many users","socket operation on non-socket","destination address required","message too long","protocol wrong type for socket","protocol not available","protocol not supported","socket type not supported","operation not supported","protocol family not supported","address family not supported by protocol","address already in use","cannot assign requested address","network is down","network is unreachable","network dropped connection on reset","software caused connection abort","connection reset by peer","no buffer space available","transport endpoint is already connected","transport endpoint is not connected","cannot send after transport endpoint shutdown","too many references: cannot splice","connection timed out","connection refused","host is down","no route to host","operation already in progress","operation now in progress","stale NFS file handle","structure needs cleaning","not a XENIX named type file","no XENIX semaphores available","is a named type file","remote I/O error","disk quota exceeded","no medium found","wrong medium type","operation canceled","required key not available","key has expired","key has been revoked","key was rejected by service","owner died","state not recoverable","operation not possible due to RF-kill"]);FD=new FQ.ptr(new C.Mutex.ptr(0,0),{},MF,KA);G();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["github.com/gopherjs/gopherjs/nosync"]=(function(){var $pkg={},$init,A,B,C,D,F,G,H,I,J;A=$pkg.Mutex=$newType(0,$kindStruct,"nosync.Mutex","Mutex","github.com/gopherjs/gopherjs/nosync",function(locked_){this.$val=this;if(arguments.length===0){this.locked=false;return;}this.locked=locked_;});B=$pkg.RWMutex=$newType(0,$kindStruct,"nosync.RWMutex","RWMutex","github.com/gopherjs/gopherjs/nosync",function(writeLocked_,readLockCounter_){this.$val=this;if(arguments.length===0){this.writeLocked=false;this.readLockCounter=0;return;}this.writeLocked=writeLocked_;this.readLockCounter=readLockCounter_;});C=$pkg.WaitGroup=$newType(0,$kindStruct,"nosync.WaitGroup","WaitGroup","github.com/gopherjs/gopherjs/nosync",function(counter_){this.$val=this;if(arguments.length===0){this.counter=0;return;}this.counter=counter_;});D=$pkg.Once=$newType(0,$kindStruct,"nosync.Once","Once","github.com/gopherjs/gopherjs/nosync",function(doing_,done_){this.$val=this;if(arguments.length===0){this.doing=false;this.done=false;return;}this.doing=doing_;this.done=done_;});F=$ptrType(A);G=$ptrType(B);H=$ptrType(C);I=$funcType([],[],false);J=$ptrType(D);A.ptr.prototype.Lock=function(){var $ptr,a;a=this;if(a.locked){$panic(new $String("nosync: mutex is already locked"));}a.locked=true;};A.prototype.Lock=function(){return this.$val.Lock();};A.ptr.prototype.Unlock=function(){var $ptr,a;a=this;if(!a.locked){$panic(new $String("nosync: unlock of unlocked mutex"));}a.locked=false;};A.prototype.Unlock=function(){return this.$val.Unlock();};B.ptr.prototype.Lock=function(){var $ptr,a;a=this;if(!((a.readLockCounter===0))||a.writeLocked){$panic(new $String("nosync: mutex is already locked"));}a.writeLocked=true;};B.prototype.Lock=function(){return this.$val.Lock();};B.ptr.prototype.Unlock=function(){var $ptr,a;a=this;if(!a.writeLocked){$panic(new $String("nosync: unlock of unlocked mutex"));}a.writeLocked=false;};B.prototype.Unlock=function(){return this.$val.Unlock();};B.ptr.prototype.RLock=function(){var $ptr,a;a=this;if(a.writeLocked){$panic(new $String("nosync: mutex is already locked"));}a.readLockCounter=a.readLockCounter+(1)>>0;};B.prototype.RLock=function(){return this.$val.RLock();};B.ptr.prototype.RUnlock=function(){var $ptr,a;a=this;if(a.readLockCounter===0){$panic(new $String("nosync: unlock of unlocked mutex"));}a.readLockCounter=a.readLockCounter-(1)>>0;};B.prototype.RUnlock=function(){return this.$val.RUnlock();};C.ptr.prototype.Add=function(a){var $ptr,a,b;b=this;b.counter=b.counter+(a)>>0;if(b.counter<0){$panic(new $String("sync: negative WaitGroup counter"));}};C.prototype.Add=function(a){return this.$val.Add(a);};C.ptr.prototype.Done=function(){var $ptr,a;a=this;a.Add(-1);};C.prototype.Done=function(){return this.$val.Done();};C.ptr.prototype.Wait=function(){var $ptr,a;a=this;if(!((a.counter===0))){$panic(new $String("sync: WaitGroup counter not zero"));}};C.prototype.Wait=function(){return this.$val.Wait();};D.ptr.prototype.Do=function(a){var $ptr,a,b,$s,$deferred,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;$s=$f.$s;$deferred=$f.$deferred;$r=$f.$r;}var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$deferred.index=$curGoroutine.deferStack.length;$curGoroutine.deferStack.push($deferred);b=[b];b[0]=this;if(b[0].done){return;}if(b[0].doing){$panic(new $String("nosync: Do called within f"));}b[0].doing=true;$deferred.push([(function(b){return function(){var $ptr;b[0].doing=false;b[0].done=true;};})(b),[]]);$r=a();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}}catch(err){$err=err;$s=-1;}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){if($f===undefined){$f={$blk:D.ptr.prototype.Do};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.$s=$s;$f.$deferred=$deferred;$f.$r=$r;return $f;}}};D.prototype.Do=function(a){return this.$val.Do(a);};F.methods=[{prop:"Lock",name:"Lock",pkg:"",typ:$funcType([],[],false)},{prop:"Unlock",name:"Unlock",pkg:"",typ:$funcType([],[],false)}];G.methods=[{prop:"Lock",name:"Lock",pkg:"",typ:$funcType([],[],false)},{prop:"Unlock",name:"Unlock",pkg:"",typ:$funcType([],[],false)},{prop:"RLock",name:"RLock",pkg:"",typ:$funcType([],[],false)},{prop:"RUnlock",name:"RUnlock",pkg:"",typ:$funcType([],[],false)}];H.methods=[{prop:"Add",name:"Add",pkg:"",typ:$funcType([$Int],[],false)},{prop:"Done",name:"Done",pkg:"",typ:$funcType([],[],false)},{prop:"Wait",name:"Wait",pkg:"",typ:$funcType([],[],false)}];J.methods=[{prop:"Do",name:"Do",pkg:"",typ:$funcType([I],[],false)}];A.init([{prop:"locked",name:"locked",pkg:"github.com/gopherjs/gopherjs/nosync",typ:$Bool,tag:""}]);B.init([{prop:"writeLocked",name:"writeLocked",pkg:"github.com/gopherjs/gopherjs/nosync",typ:$Bool,tag:""},{prop:"readLockCounter",name:"readLockCounter",pkg:"github.com/gopherjs/gopherjs/nosync",typ:$Int,tag:""}]);C.init([{prop:"counter",name:"counter",pkg:"github.com/gopherjs/gopherjs/nosync",typ:$Int,tag:""}]);D.init([{prop:"doing",name:"doing",pkg:"github.com/gopherjs/gopherjs/nosync",typ:$Bool,tag:""},{prop:"done",name:"done",pkg:"github.com/gopherjs/gopherjs/nosync",typ:$Bool,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["strings"]=(function(){var $pkg={},$init,C,B,D,E,A,K,CA,CK,F,G,L,AJ,AK;C=$packages["errors"];B=$packages["github.com/gopherjs/gopherjs/js"];D=$packages["io"];E=$packages["unicode"];A=$packages["unicode/utf8"];K=$pkg.Reader=$newType(0,$kindStruct,"strings.Reader","Reader","strings",function(s_,i_,prevRune_){this.$val=this;if(arguments.length===0){this.s="";this.i=new $Int64(0,0);this.prevRune=0;return;}this.s=s_;this.i=i_;this.prevRune=prevRune_;});CA=$sliceType($Uint8);CK=$ptrType(K);F=function(e,f){var $ptr,e,f;return $parseInt(e.indexOf($global.String.fromCharCode(f)))>>0;};$pkg.IndexByte=F;G=function(e,f){var $ptr,e,f;return $parseInt(e.indexOf(f))>>0;};$pkg.Index=G;K.ptr.prototype.Len=function(){var $ptr,e,f,g,h,i,j;e=this;if((f=e.i,g=new $Int64(0,e.s.length),(f.$high>g.$high||(f.$high===g.$high&&f.$low>=g.$low)))){return 0;}return((h=(i=new $Int64(0,e.s.length),j=e.i,new $Int64(i.$high-j.$high,i.$low-j.$low)),h.$low+((h.$high>>31)*4294967296))>>0);};K.prototype.Len=function(){return this.$val.Len();};K.ptr.prototype.Size=function(){var $ptr,e;e=this;return new $Int64(0,e.s.length);};K.prototype.Size=function(){return this.$val.Size();};K.ptr.prototype.Read=function(e){var $ptr,e,f,g,h,i,j,k,l,m,n,o,p;f=0;g=$ifaceNil;h=this;if(e.$length===0){i=0;j=$ifaceNil;f=i;g=j;return[f,g];}if((k=h.i,l=new $Int64(0,h.s.length),(k.$high>l.$high||(k.$high===l.$high&&k.$low>=l.$low)))){m=0;n=D.EOF;f=m;g=n;return[f,g];}h.prevRune=-1;f=$copyString(e,h.s.substring($flatten64(h.i)));h.i=(o=h.i,p=new $Int64(0,f),new $Int64(o.$high+p.$high,o.$low+p.$low));return[f,g];};K.prototype.Read=function(e){return this.$val.Read(e);};K.ptr.prototype.ReadAt=function(e,f){var $ptr,e,f,g,h,i,j,k,l,m,n;g=0;h=$ifaceNil;i=this;if((f.$high<0||(f.$high===0&&f.$low<0))){j=0;k=C.New("strings.Reader.ReadAt: negative offset");g=j;h=k;return[g,h];}if((l=new $Int64(0,i.s.length),(f.$high>l.$high||(f.$high===l.$high&&f.$low>=l.$low)))){m=0;n=D.EOF;g=m;h=n;return[g,h];}g=$copyString(e,i.s.substring($flatten64(f)));if(gi.$high||(h.$high===i.$high&&h.$low>=i.$low)))){j=0;k=D.EOF;e=j;f=k;return[e,f];}e=g.s.charCodeAt($flatten64(g.i));g.i=(l=g.i,m=new $Int64(0,1),new $Int64(l.$high+m.$high,l.$low+m.$low));return[e,f];};K.prototype.ReadByte=function(){return this.$val.ReadByte();};K.ptr.prototype.UnreadByte=function(){var $ptr,e,f,g,h;e=this;e.prevRune=-1;if((f=e.i,(f.$high<0||(f.$high===0&&f.$low<=0)))){return C.New("strings.Reader.UnreadByte: at beginning of string");}e.i=(g=e.i,h=new $Int64(0,1),new $Int64(g.$high-h.$high,g.$low-h.$low));return $ifaceNil;};K.prototype.UnreadByte=function(){return this.$val.UnreadByte();};K.ptr.prototype.ReadRune=function(){var $ptr,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;e=0;f=0;g=$ifaceNil;h=this;if((i=h.i,j=new $Int64(0,h.s.length),(i.$high>j.$high||(i.$high===j.$high&&i.$low>=j.$low)))){h.prevRune=-1;k=0;l=0;m=D.EOF;e=k;f=l;g=m;return[e,f,g];}h.prevRune=((n=h.i,n.$low+((n.$high>>31)*4294967296))>>0);o=h.s.charCodeAt($flatten64(h.i));if(o<128){h.i=(p=h.i,q=new $Int64(0,1),new $Int64(p.$high+q.$high,p.$low+q.$low));r=(o>>0);s=1;t=$ifaceNil;e=r;f=s;g=t;return[e,f,g];}u=A.DecodeRuneInString(h.s.substring($flatten64(h.i)));e=u[0];f=u[1];h.i=(v=h.i,w=new $Int64(0,f),new $Int64(v.$high+w.$high,v.$low+w.$low));return[e,f,g];};K.prototype.ReadRune=function(){return this.$val.ReadRune();};K.ptr.prototype.UnreadRune=function(){var $ptr,e;e=this;if(e.prevRune<0){return C.New("strings.Reader.UnreadRune: previous operation was not ReadRune");}e.i=new $Int64(0,e.prevRune);e.prevRune=-1;return $ifaceNil;};K.prototype.UnreadRune=function(){return this.$val.UnreadRune();};K.ptr.prototype.Seek=function(e,f){var $ptr,e,f,g,h,i,j,k;g=this;g.prevRune=-1;h=new $Int64(0,0);i=f;if(i===(0)){h=e;}else if(i===(1)){h=(j=g.i,new $Int64(j.$high+e.$high,j.$low+e.$low));}else if(i===(2)){h=(k=new $Int64(0,g.s.length),new $Int64(k.$high+e.$high,k.$low+e.$low));}else{return[new $Int64(0,0),C.New("strings.Reader.Seek: invalid whence")];}if((h.$high<0||(h.$high===0&&h.$low<0))){return[new $Int64(0,0),C.New("strings.Reader.Seek: negative position")];}g.i=h;return[h,$ifaceNil];};K.prototype.Seek=function(e,f){return this.$val.Seek(e,f);};K.ptr.prototype.WriteTo=function(e){var $ptr,e,f,g,h,i,j,k,l,m,n,o,p,q,r,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=new $Int64(0,0);g=$ifaceNil;h=this;h.prevRune=-1;if((i=h.i,j=new $Int64(0,h.s.length),(i.$high>j.$high||(i.$high===j.$high&&i.$low>=j.$low)))){k=new $Int64(0,0);l=$ifaceNil;f=k;g=l;return[f,g];}m=h.s.substring($flatten64(h.i));o=D.WriteString(e,m);$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}n=o;p=n[0];g=n[1];if(p>m.length){$panic(new $String("strings.Reader.WriteTo: invalid WriteString count"));}h.i=(q=h.i,r=new $Int64(0,p),new $Int64(q.$high+r.$high,q.$low+r.$low));f=new $Int64(0,p);if(!((p===m.length))&&$interfaceIsEqual(g,$ifaceNil)){g=D.ErrShortWrite;}return[f,g];}return;}if($f===undefined){$f={$blk:K.ptr.prototype.WriteTo};}$f.$ptr=$ptr;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.$s=$s;$f.$r=$r;return $f;};K.prototype.WriteTo=function(e){return this.$val.WriteTo(e);};L=function(e){var $ptr,e;return new K.ptr(e,new $Int64(0,0),-1);};$pkg.NewReader=L;AJ=function(e,f){var $ptr,e,f;return AK(e,f)>=0;};$pkg.ContainsRune=AJ;AK=function(e,f){var $ptr,e,f,g,h,i,j,k;if(f<128){return F(e,(f<<24>>>24));}else{g=e;h=0;while(true){if(!(h>0),p);CJ.zone=new DA([new CG.ptr(CJ.name,$imul(($parseInt(m.getTimezoneOffset())>>0),-60),false)]);};S=function(m){var $ptr,m,n;if(m.length===0){return false;}n=m.charCodeAt(0);return 97<=n&&n<=122;};T=function(m){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,da,db,dc,dd,de,df,m,n,o,p,q,r,s,t,u,v,w,x,y,z;n="";o=0;p="";q=0;while(true){if(!(q>0);s=r;if(s===(74)){if(m.length>=(q+3>>0)&&m.substring(q,(q+3>>0))==="Jan"){if(m.length>=(q+7>>0)&&m.substring(q,(q+7>>0))==="January"){t=m.substring(0,q);u=257;v=m.substring((q+7>>0));n=t;o=u;p=v;return[n,o,p];}if(!S(m.substring((q+3>>0)))){w=m.substring(0,q);x=258;y=m.substring((q+3>>0));n=w;o=x;p=y;return[n,o,p];}}}else if(s===(77)){if(m.length>=(q+3>>0)){if(m.substring(q,(q+3>>0))==="Mon"){if(m.length>=(q+6>>0)&&m.substring(q,(q+6>>0))==="Monday"){z=m.substring(0,q);aa=261;ab=m.substring((q+6>>0));n=z;o=aa;p=ab;return[n,o,p];}if(!S(m.substring((q+3>>0)))){ac=m.substring(0,q);ad=262;ae=m.substring((q+3>>0));n=ac;o=ad;p=ae;return[n,o,p];}}if(m.substring(q,(q+3>>0))==="MST"){af=m.substring(0,q);ag=21;ah=m.substring((q+3>>0));n=af;o=ag;p=ah;return[n,o,p];}}}else if(s===(48)){if(m.length>=(q+2>>0)&&49<=m.charCodeAt((q+1>>0))&&m.charCodeAt((q+1>>0))<=54){ai=m.substring(0,q);aj=(ak=m.charCodeAt((q+1>>0))-49<<24>>>24,((ak<0||ak>=R.length)?$throwRuntimeError("index out of range"):R[ak]));al=m.substring((q+2>>0));n=ai;o=aj;p=al;return[n,o,p];}}else if(s===(49)){if(m.length>=(q+2>>0)&&(m.charCodeAt((q+1>>0))===53)){am=m.substring(0,q);an=522;ao=m.substring((q+2>>0));n=am;o=an;p=ao;return[n,o,p];}ap=m.substring(0,q);aq=259;ar=m.substring((q+1>>0));n=ap;o=aq;p=ar;return[n,o,p];}else if(s===(50)){if(m.length>=(q+4>>0)&&m.substring(q,(q+4>>0))==="2006"){as=m.substring(0,q);at=273;au=m.substring((q+4>>0));n=as;o=at;p=au;return[n,o,p];}av=m.substring(0,q);aw=263;ax=m.substring((q+1>>0));n=av;o=aw;p=ax;return[n,o,p];}else if(s===(95)){if(m.length>=(q+2>>0)&&(m.charCodeAt((q+1>>0))===50)){if(m.length>=(q+5>>0)&&m.substring((q+1>>0),(q+5>>0))==="2006"){ay=m.substring(0,(q+1>>0));az=273;ba=m.substring((q+5>>0));n=ay;o=az;p=ba;return[n,o,p];}bb=m.substring(0,q);bc=264;bd=m.substring((q+2>>0));n=bb;o=bc;p=bd;return[n,o,p];}}else if(s===(51)){be=m.substring(0,q);bf=523;bg=m.substring((q+1>>0));n=be;o=bf;p=bg;return[n,o,p];}else if(s===(52)){bh=m.substring(0,q);bi=525;bj=m.substring((q+1>>0));n=bh;o=bi;p=bj;return[n,o,p];}else if(s===(53)){bk=m.substring(0,q);bl=527;bm=m.substring((q+1>>0));n=bk;o=bl;p=bm;return[n,o,p];}else if(s===(80)){if(m.length>=(q+2>>0)&&(m.charCodeAt((q+1>>0))===77)){bn=m.substring(0,q);bo=531;bp=m.substring((q+2>>0));n=bn;o=bo;p=bp;return[n,o,p];}}else if(s===(112)){if(m.length>=(q+2>>0)&&(m.charCodeAt((q+1>>0))===109)){bq=m.substring(0,q);br=532;bs=m.substring((q+2>>0));n=bq;o=br;p=bs;return[n,o,p];}}else if(s===(45)){if(m.length>=(q+7>>0)&&m.substring(q,(q+7>>0))==="-070000"){bt=m.substring(0,q);bu=28;bv=m.substring((q+7>>0));n=bt;o=bu;p=bv;return[n,o,p];}if(m.length>=(q+9>>0)&&m.substring(q,(q+9>>0))==="-07:00:00"){bw=m.substring(0,q);bx=31;by=m.substring((q+9>>0));n=bw;o=bx;p=by;return[n,o,p];}if(m.length>=(q+5>>0)&&m.substring(q,(q+5>>0))==="-0700"){bz=m.substring(0,q);ca=27;cb=m.substring((q+5>>0));n=bz;o=ca;p=cb;return[n,o,p];}if(m.length>=(q+6>>0)&&m.substring(q,(q+6>>0))==="-07:00"){cc=m.substring(0,q);cd=30;ce=m.substring((q+6>>0));n=cc;o=cd;p=ce;return[n,o,p];}if(m.length>=(q+3>>0)&&m.substring(q,(q+3>>0))==="-07"){cf=m.substring(0,q);cg=29;ch=m.substring((q+3>>0));n=cf;o=cg;p=ch;return[n,o,p];}}else if(s===(90)){if(m.length>=(q+7>>0)&&m.substring(q,(q+7>>0))==="Z070000"){ci=m.substring(0,q);cj=23;ck=m.substring((q+7>>0));n=ci;o=cj;p=ck;return[n,o,p];}if(m.length>=(q+9>>0)&&m.substring(q,(q+9>>0))==="Z07:00:00"){cl=m.substring(0,q);cm=26;cn=m.substring((q+9>>0));n=cl;o=cm;p=cn;return[n,o,p];}if(m.length>=(q+5>>0)&&m.substring(q,(q+5>>0))==="Z0700"){co=m.substring(0,q);cp=22;cq=m.substring((q+5>>0));n=co;o=cp;p=cq;return[n,o,p];}if(m.length>=(q+6>>0)&&m.substring(q,(q+6>>0))==="Z07:00"){cr=m.substring(0,q);cs=25;ct=m.substring((q+6>>0));n=cr;o=cs;p=ct;return[n,o,p];}if(m.length>=(q+3>>0)&&m.substring(q,(q+3>>0))==="Z07"){cu=m.substring(0,q);cv=24;cw=m.substring((q+3>>0));n=cu;o=cv;p=cw;return[n,o,p];}}else if(s===(46)){if((q+1>>0)>0))===48)||(m.charCodeAt((q+1>>0))===57))){cx=m.charCodeAt((q+1>>0));cy=q+1>>0;while(true){if(!(cy>0;}if(!AH(m,cy)){cz=32;if(m.charCodeAt((q+1>>0))===57){cz=33;}cz=cz|((((cy-((q+1>>0))>>0))<<16>>0));da=m.substring(0,q);db=cz;dc=m.substring(cy);n=da;o=db;p=dc;return[n,o,p];}}}q=q+(1)>>0;}dd=m;de=0;df="";n=dd;o=de;p=df;return[n,o,p];};Y=function(m,n){var $ptr,m,n,o,p,q;o=0;while(true){if(!(o>>0;q=(q|(32))>>>0;if(!((p===q))||p<97||p>122){return false;}}o=o+(1)>>0;}return true;};Z=function(m,n){var $ptr,m,n,o,p,q,r;o=m;p=0;while(true){if(!(p=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+p]);if(n.length>=r.length&&Y(n.substring(0,r.length),r)){return[q,n.substring(r.length),$ifaceNil];}p++;}return[-1,n,AE];};AA=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u;p=(n>>>0);if(n<0){m=$append(m,45);p=(-n>>>0);}q=DF.zero();r=20;while(true){if(!(p>=10)){break;}r=r-(1)>>0;t=(s=p/10,(s===s&&s!==1/0&&s!==-1/0)?s>>>0:$throwRuntimeError("integer divide by zero"));((r<0||r>=q.length)?$throwRuntimeError("index out of range"):q[r]=(((48+p>>>0)-(t*10>>>0)>>>0)<<24>>>24));p=t;}r=r-(1)>>0;((r<0||r>=q.length)?$throwRuntimeError("index out of range"):q[r]=((48+p>>>0)<<24>>>24));u=20-r>>0;while(true){if(!(u>0;}return $appendSlice(m,$subslice(new DG(q),r));};AC=function(m){var $ptr,m,n,o,p,q,r,s,t,u,v,w;n=0;o=$ifaceNil;p=false;if(!(m==="")&&((m.charCodeAt(0)===45)||(m.charCodeAt(0)===43))){p=m.charCodeAt(0)===45;m=m.substring(1);}q=AS(m);r=q[0];s=q[1];o=q[2];n=((r.$low+((r.$high>>31)*4294967296))>>0);if(!($interfaceIsEqual(o,$ifaceNil))||!(s==="")){t=0;u=AB;n=t;o=u;return[n,o];}if(p){n=-n;}v=n;w=$ifaceNil;n=v;o=w;return[n,o];};AD=function(m,n,o,p){var $ptr,m,n,o,p,q,r,s,t,u,v;q=n;r=DH.zero();s=9;while(true){if(!(s>0)){break;}s=s-(1)>>0;((s<0||s>=r.length)?$throwRuntimeError("index out of range"):r[s]=(((t=q%10,t===t?t:$throwRuntimeError("integer divide by zero"))+48>>>0)<<24>>>24));q=(u=q/(10),(u===u&&u!==1/0&&u!==-1/0)?u>>>0:$throwRuntimeError("integer divide by zero"));}if(o>9){o=9;}if(p){while(true){if(!(o>0&&((v=o-1>>0,((v<0||v>=r.length)?$throwRuntimeError("index out of range"):r[v]))===48))){break;}o=o-(1)>>0;}if(o===0){return m;}}m=$append(m,46);return $appendSlice(m,$subslice(new DG(r),0,o));};BL.ptr.prototype.String=function(){var $ptr,m,n,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BL);n=m.Format("2006-01-02 15:04:05.999999999 -0700 MST");$s=1;case 1:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}$s=2;case 2:return n;}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.String};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.String=function(){return this.$val.String();};BL.ptr.prototype.Format=function(m){var $ptr,m,n,o,p,q,r,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=$clone(this,BL);o=DG.nil;p=m.length+10>>0;if(p<64){q=DI.zero();o=$subslice(new DG(q),0,0);}else{o=$makeSlice(DG,0,p);}r=n.AppendFormat(o,m);$s=1;case 1:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}o=r;return $bytesToString(o);}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.Format};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.Format=function(m){return this.$val.Format(m);};BL.ptr.prototype.AppendFormat=function(m,n){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;ax=$f.ax;ay=$f.ay;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:o=$clone(this,BL);q=o.locabs();$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}p=q;r=p[0];s=p[1];t=p[2];u=-1;v=0;w=0;x=-1;y=0;z=0;while(true){if(!(!(n===""))){break;}aa=T(n);ab=aa[0];ac=aa[1];ad=aa[2];if(!(ab==="")){m=$appendSlice(m,ab);}if(ac===0){break;}n=ad;if(u<0&&!(((ac&256)===0))){ae=BW(t,true);u=ae[0];v=ae[1];w=ae[2];}if(x<0&&!(((ac&512)===0))){af=BR(t);x=af[0];y=af[1];z=af[2];}switch(0){default:ag=ac&65535;if(ag===(274)){ah=u;if(ah<0){ah=-ah;}m=AA(m,(ai=ah%100,ai===ai?ai:$throwRuntimeError("integer divide by zero")),2);}else if(ag===(273)){m=AA(m,u,4);}else if(ag===(258)){m=$appendSlice(m,new BM(v).String().substring(0,3));}else if(ag===(257)){aj=new BM(v).String();m=$appendSlice(m,aj);}else if(ag===(259)){m=AA(m,(v>>0),0);}else if(ag===(260)){m=AA(m,(v>>0),2);}else if(ag===(262)){m=$appendSlice(m,new BO(BQ(t)).String().substring(0,3));}else if(ag===(261)){ak=new BO(BQ(t)).String();m=$appendSlice(m,ak);}else if(ag===(263)){m=AA(m,w,0);}else if(ag===(264)){if(w<10){m=$append(m,32);}m=AA(m,w,0);}else if(ag===(265)){m=AA(m,w,2);}else if(ag===(522)){m=AA(m,x,2);}else if(ag===(523)){am=(al=x%12,al===al?al:$throwRuntimeError("integer divide by zero"));if(am===0){am=12;}m=AA(m,am,0);}else if(ag===(524)){ao=(an=x%12,an===an?an:$throwRuntimeError("integer divide by zero"));if(ao===0){ao=12;}m=AA(m,ao,2);}else if(ag===(525)){m=AA(m,y,0);}else if(ag===(526)){m=AA(m,y,2);}else if(ag===(527)){m=AA(m,z,0);}else if(ag===(528)){m=AA(m,z,2);}else if(ag===(531)){if(x>=12){m=$appendSlice(m,"PM");}else{m=$appendSlice(m,"AM");}}else if(ag===(532)){if(x>=12){m=$appendSlice(m,"pm");}else{m=$appendSlice(m,"am");}}else if((ag===(22))||(ag===(25))||(ag===(23))||(ag===(24))||(ag===(26))||(ag===(27))||(ag===(30))||(ag===(28))||(ag===(29))||(ag===(31))){if((s===0)&&((ac===22)||(ac===25)||(ac===23)||(ac===24)||(ac===26))){m=$append(m,90);break;}aq=(ap=s/60,(ap===ap&&ap!==1/0&&ap!==-1/0)?ap>>0:$throwRuntimeError("integer divide by zero"));ar=s;if(aq<0){m=$append(m,45);aq=-aq;ar=-ar;}else{m=$append(m,43);}m=AA(m,(as=aq/60,(as===as&&as!==1/0&&as!==-1/0)?as>>0:$throwRuntimeError("integer divide by zero")),2);if((ac===25)||(ac===30)||(ac===26)||(ac===31)){m=$append(m,58);}if(!((ac===29))&&!((ac===24))){m=AA(m,(at=aq%60,at===at?at:$throwRuntimeError("integer divide by zero")),2);}if((ac===23)||(ac===28)||(ac===31)||(ac===26)){if((ac===31)||(ac===26)){m=$append(m,58);}m=AA(m,(au=ar%60,au===au?au:$throwRuntimeError("integer divide by zero")),2);}}else if(ag===(21)){if(!(r==="")){m=$appendSlice(m,r);break;}aw=(av=s/60,(av===av&&av!==1/0&&av!==-1/0)?av>>0:$throwRuntimeError("integer divide by zero"));if(aw<0){m=$append(m,45);aw=-aw;}else{m=$append(m,43);}m=AA(m,(ax=aw/60,(ax===ax&&ax!==1/0&&ax!==-1/0)?ax>>0:$throwRuntimeError("integer divide by zero")),2);m=AA(m,(ay=aw%60,ay===ay?ay:$throwRuntimeError("integer divide by zero")),2);}else if((ag===(32))||(ag===(33))){m=AD(m,(o.Nanosecond()>>>0),ac>>16>>0,(ac&65535)===33);}}}return m;}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.AppendFormat};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.ax=ax;$f.ay=ay;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.AppendFormat=function(m,n){return this.$val.AppendFormat(m,n);};AG=function(m){var $ptr,m;return"\""+m+"\"";};AF.ptr.prototype.Error=function(){var $ptr,m;m=this;if(m.Message===""){return"parsing time "+AG(m.Value)+" as "+AG(m.Layout)+": cannot parse "+AG(m.ValueElem)+" as "+AG(m.LayoutElem);}return"parsing time "+AG(m.Value)+m.Message;};AF.prototype.Error=function(){return this.$val.Error();};AH=function(m,n){var $ptr,m,n,o;if(m.length<=n){return false;}o=m.charCodeAt(n);return 48<=o&&o<=57;};AI=function(m,n){var $ptr,m,n;if(!AH(m,0)){return[0,m,AE];}if(!AH(m,1)){if(n){return[0,m,AE];}return[((m.charCodeAt(0)-48<<24>>>24)>>0),m.substring(1),$ifaceNil];}return[($imul(((m.charCodeAt(0)-48<<24>>>24)>>0),10))+((m.charCodeAt(1)-48<<24>>>24)>>0)>>0,m.substring(2),$ifaceNil];};AJ=function(m){var $ptr,m;while(true){if(!(m.length>0&&(m.charCodeAt(0)===32))){break;}m=m.substring(1);}return m;};AK=function(m,n){var $ptr,m,n;while(true){if(!(n.length>0)){break;}if(n.charCodeAt(0)===32){if(m.length>0&&!((m.charCodeAt(0)===32))){return[m,AE];}n=AJ(n);m=AJ(m);continue;}if((m.length===0)||!((m.charCodeAt(0)===n.charCodeAt(0)))){return[m,AE];}n=n.substring(1);m=m.substring(1);}return[m,$ifaceNil];};AL=function(m,n){var $ptr,m,n,o,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:o=AN(m,n,$pkg.UTC,$pkg.Local);$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}$s=2;case 2:return o;}return;}if($f===undefined){$f={$blk:AL};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Parse=AL;AN=function(m,n,o,p){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,da,db,dc,dd,de,df,dg,dh,di,dj,dk,dl,dm,dn,dp,dq,dr,ds,dt,du,dv,dw,dx,dy,dz,ea,eb,ec,ed,ee,ef,eg,eh,ei,ej,ek,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;ax=$f.ax;ay=$f.ay;az=$f.az;ba=$f.ba;bb=$f.bb;bc=$f.bc;bd=$f.bd;be=$f.be;bf=$f.bf;bg=$f.bg;bh=$f.bh;bi=$f.bi;bj=$f.bj;bk=$f.bk;bl=$f.bl;bm=$f.bm;bn=$f.bn;bo=$f.bo;bp=$f.bp;bq=$f.bq;br=$f.br;bs=$f.bs;bt=$f.bt;bu=$f.bu;bv=$f.bv;bw=$f.bw;bx=$f.bx;by=$f.by;bz=$f.bz;ca=$f.ca;cb=$f.cb;cc=$f.cc;cd=$f.cd;ce=$f.ce;cf=$f.cf;cg=$f.cg;ch=$f.ch;ci=$f.ci;cj=$f.cj;ck=$f.ck;cl=$f.cl;cm=$f.cm;cn=$f.cn;co=$f.co;cp=$f.cp;cq=$f.cq;cr=$f.cr;cs=$f.cs;ct=$f.ct;cu=$f.cu;cv=$f.cv;cw=$f.cw;cx=$f.cx;cy=$f.cy;cz=$f.cz;da=$f.da;db=$f.db;dc=$f.dc;dd=$f.dd;de=$f.de;df=$f.df;dg=$f.dg;dh=$f.dh;di=$f.di;dj=$f.dj;dk=$f.dk;dl=$f.dl;dm=$f.dm;dn=$f.dn;dp=$f.dp;dq=$f.dq;dr=$f.dr;ds=$f.ds;dt=$f.dt;du=$f.du;dv=$f.dv;dw=$f.dw;dx=$f.dx;dy=$f.dy;dz=$f.dz;ea=$f.ea;eb=$f.eb;ec=$f.ec;ed=$f.ed;ee=$f.ee;ef=$f.ef;eg=$f.eg;eh=$f.eh;ei=$f.ei;ej=$f.ej;ek=$f.ek;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:q=m;r=n;s=q;t=r;u="";v=false;w=false;x=0;y=1;z=1;aa=0;ab=0;ac=0;ad=0;ae=DJ.nil;af=-1;ag="";while(true){ah=$ifaceNil;ai=T(m);aj=ai[0];ak=ai[1];al=ai[2];am=m.substring(aj.length,(m.length-al.length>>0));an=AK(n,aj);n=an[0];ah=an[1];if(!($interfaceIsEqual(ah,$ifaceNil))){return[new BL.ptr(new $Int64(0,0),0,DJ.nil),new AF.ptr(s,t,aj,n,"")];}if(ak===0){if(!((n.length===0))){return[new BL.ptr(new $Int64(0,0),0,DJ.nil),new AF.ptr(s,t,"",n,": extra text: "+n)];}break;}m=al;ao="";switch(0){default:ap=ak&65535;if(ap===(274)){if(n.length<2){ah=AE;break;}aq=n.substring(0,2);ar=n.substring(2);ao=aq;n=ar;as=AC(ao);x=as[0];ah=as[1];if(x>=69){x=x+(1900)>>0;}else{x=x+(2000)>>0;}}else if(ap===(273)){if(n.length<4||!AH(n,0)){ah=AE;break;}at=n.substring(0,4);au=n.substring(4);ao=at;n=au;av=AC(ao);x=av[0];ah=av[1];}else if(ap===(258)){aw=Z(W,n);y=aw[0];n=aw[1];ah=aw[2];}else if(ap===(257)){ax=Z(X,n);y=ax[0];n=ax[1];ah=ax[2];}else if((ap===(259))||(ap===(260))){ay=AI(n,ak===260);y=ay[0];n=ay[1];ah=ay[2];if(y<=0||120&&(n.charCodeAt(0)===32)){n=n.substring(1);}bb=AI(n,ak===265);z=bb[0];n=bb[1];ah=bb[2];if(z<0){u="day";}}else if(ap===(522)){bc=AI(n,false);aa=bc[0];n=bc[1];ah=bc[2];if(aa<0||24<=aa){u="hour";}}else if((ap===(523))||(ap===(524))){bd=AI(n,ak===524);aa=bd[0];n=bd[1];ah=bd[2];if(aa<0||12=2&&(n.charCodeAt(0)===46)&&AH(n,1)){bg=T(m);ak=bg[1];ak=ak&(65535);if((ak===32)||(ak===33)){break;}bh=2;while(true){if(!(bh>0;}bi=AQ(n,bh);ad=bi[0];u=bi[1];ah=bi[2];n=n.substring(bh);}}else if(ap===(531)){if(n.length<2){ah=AE;break;}bj=n.substring(0,2);bk=n.substring(2);ao=bj;n=bk;bl=ao;if(bl===("PM")){w=true;}else if(bl===("AM")){v=true;}else{ah=AE;}}else if(ap===(532)){if(n.length<2){ah=AE;break;}bm=n.substring(0,2);bn=n.substring(2);ao=bm;n=bn;bo=ao;if(bo===("pm")){w=true;}else if(bo===("am")){v=true;}else{ah=AE;}}else if((ap===(22))||(ap===(25))||(ap===(23))||(ap===(24))||(ap===(26))||(ap===(27))||(ap===(29))||(ap===(30))||(ap===(28))||(ap===(31))){if(((ak===22)||(ak===24)||(ak===25))&&n.length>=1&&(n.charCodeAt(0)===90)){n=n.substring(1);ae=$pkg.UTC;break;}bp="";bq="";br="";bs="";bt=bp;bu=bq;bv=br;bw=bs;if((ak===25)||(ak===30)){if(n.length<6){ah=AE;break;}if(!((n.charCodeAt(3)===58))){ah=AE;break;}bx=n.substring(0,1);by=n.substring(1,3);bz=n.substring(4,6);ca="00";cb=n.substring(6);bt=bx;bu=by;bv=bz;bw=ca;n=cb;}else if((ak===29)||(ak===24)){if(n.length<3){ah=AE;break;}cc=n.substring(0,1);cd=n.substring(1,3);ce="00";cf="00";cg=n.substring(3);bt=cc;bu=cd;bv=ce;bw=cf;n=cg;}else if((ak===26)||(ak===31)){if(n.length<9){ah=AE;break;}if(!((n.charCodeAt(3)===58))||!((n.charCodeAt(6)===58))){ah=AE;break;}ch=n.substring(0,1);ci=n.substring(1,3);cj=n.substring(4,6);ck=n.substring(7,9);cl=n.substring(9);bt=ch;bu=ci;bv=cj;bw=ck;n=cl;}else if((ak===23)||(ak===28)){if(n.length<7){ah=AE;break;}cm=n.substring(0,1);cn=n.substring(1,3);co=n.substring(3,5);cp=n.substring(5,7);cq=n.substring(7);bt=cm;bu=cn;bv=co;bw=cp;n=cq;}else{if(n.length<5){ah=AE;break;}cr=n.substring(0,1);cs=n.substring(1,3);ct=n.substring(3,5);cu="00";cv=n.substring(5);bt=cr;bu=cs;bv=ct;bw=cu;n=cv;}cw=0;cx=0;cy=0;cz=cw;da=cx;db=cy;dc=AC(bu);cz=dc[0];ah=dc[1];if($interfaceIsEqual(ah,$ifaceNil)){dd=AC(bv);da=dd[0];ah=dd[1];}if($interfaceIsEqual(ah,$ifaceNil)){de=AC(bw);db=de[0];ah=de[1];}af=($imul(((($imul(cz,60))+da>>0)),60))+db>>0;df=bt.charCodeAt(0);if(df===(43)){}else if(df===(45)){af=-af;}else{ah=AE;}}else if(ap===(21)){if(n.length>=3&&n.substring(0,3)==="UTC"){ae=$pkg.UTC;n=n.substring(3);break;}dg=AO(n);dh=dg[0];di=dg[1];if(!di){ah=AE;break;}dj=n.substring(0,dh);dk=n.substring(dh);ag=dj;n=dk;}else if(ap===(32)){dl=1+((ak>>16>>0))>>0;if(n.length>0)>0))&&n.charCodeAt((dn+1>>0))<=57)){break;}dn=dn+(1)>>0;}dp=AQ(n,1+dn>>0);ad=dp[0];u=dp[1];ah=dp[2];n=n.substring((1+dn>>0));}}if(!(u==="")){return[new BL.ptr(new $Int64(0,0),0,DJ.nil),new AF.ptr(s,t,am,n,": "+u+" out of range")];}if(!($interfaceIsEqual(ah,$ifaceNil))){return[new BL.ptr(new $Int64(0,0),0,DJ.nil),new AF.ptr(s,t,am,n,"")];}}if(w&&aa<12){aa=aa+(12)>>0;}else if(v&&(aa===12)){aa=0;}if(z>BY((y>>0),x)){return[new BL.ptr(new $Int64(0,0),0,DJ.nil),new AF.ptr(s,t,"",n,": day out of range")];}if(!(ae===DJ.nil)){$s=1;continue;}$s=2;continue;case 1:dq=CD(x,(y>>0),z,aa,ab,ac,ad,ae);$s=3;case 3:if($c){$c=false;dq=dq.$blk();}if(dq&&dq.$blk!==undefined){break s;}$s=4;case 4:return[dq,$ifaceNil];case 2:if(!((af===-1))){$s=5;continue;}$s=6;continue;case 5:dr=CD(x,(y>>0),z,aa,ab,ac,ad,$pkg.UTC);$s=7;case 7:if($c){$c=false;dr=dr.$blk();}if(dr&&dr.$blk!==undefined){break s;}ds=$clone(dr,BL);ds.sec=(dt=ds.sec,du=new $Int64(0,af),new $Int64(dt.$high-du.$high,dt.$low-du.$low));dx=p.lookup((dw=ds.sec,new $Int64(dw.$high+-15,dw.$low+2288912640)));$s=8;case 8:if($c){$c=false;dx=dx.$blk();}if(dx&&dx.$blk!==undefined){break s;}dv=dx;dy=dv[0];dz=dv[1];if((dz===af)&&(ag===""||dy===ag)){ds.loc=p;return[ds,$ifaceNil];}ds.loc=CL(ag,af);return[ds,$ifaceNil];case 6:if(!(ag==="")){$s=9;continue;}$s=10;continue;case 9:ea=CD(x,(y>>0),z,aa,ab,ac,ad,$pkg.UTC);$s=11;case 11:if($c){$c=false;ea=ea.$blk();}if(ea&&ea.$blk!==undefined){break s;}eb=$clone(ea,BL);ee=p.lookupName(ag,(ed=eb.sec,new $Int64(ed.$high+-15,ed.$low+2288912640)));$s=12;case 12:if($c){$c=false;ee=ee.$blk();}if(ee&&ee.$blk!==undefined){break s;}ec=ee;ef=ec[0];eg=ec[2];if(eg){eb.sec=(eh=eb.sec,ei=new $Int64(0,ef),new $Int64(eh.$high-ei.$high,eh.$low-ei.$low));eb.loc=p;return[eb,$ifaceNil];}if(ag.length>3&&ag.substring(0,3)==="GMT"){ej=AC(ag.substring(3));ef=ej[0];ef=$imul(ef,(3600));}eb.loc=CL(ag,ef);return[eb,$ifaceNil];case 10:ek=CD(x,(y>>0),z,aa,ab,ac,ad,o);$s=13;case 13:if($c){$c=false;ek=ek.$blk();}if(ek&&ek.$blk!==undefined){break s;}$s=14;case 14:return[ek,$ifaceNil];}return;}if($f===undefined){$f={$blk:AN};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.ax=ax;$f.ay=ay;$f.az=az;$f.ba=ba;$f.bb=bb;$f.bc=bc;$f.bd=bd;$f.be=be;$f.bf=bf;$f.bg=bg;$f.bh=bh;$f.bi=bi;$f.bj=bj;$f.bk=bk;$f.bl=bl;$f.bm=bm;$f.bn=bn;$f.bo=bo;$f.bp=bp;$f.bq=bq;$f.br=br;$f.bs=bs;$f.bt=bt;$f.bu=bu;$f.bv=bv;$f.bw=bw;$f.bx=bx;$f.by=by;$f.bz=bz;$f.ca=ca;$f.cb=cb;$f.cc=cc;$f.cd=cd;$f.ce=ce;$f.cf=cf;$f.cg=cg;$f.ch=ch;$f.ci=ci;$f.cj=cj;$f.ck=ck;$f.cl=cl;$f.cm=cm;$f.cn=cn;$f.co=co;$f.cp=cp;$f.cq=cq;$f.cr=cr;$f.cs=cs;$f.ct=ct;$f.cu=cu;$f.cv=cv;$f.cw=cw;$f.cx=cx;$f.cy=cy;$f.cz=cz;$f.da=da;$f.db=db;$f.dc=dc;$f.dd=dd;$f.de=de;$f.df=df;$f.dg=dg;$f.dh=dh;$f.di=di;$f.dj=dj;$f.dk=dk;$f.dl=dl;$f.dm=dm;$f.dn=dn;$f.dp=dp;$f.dq=dq;$f.dr=dr;$f.ds=ds;$f.dt=dt;$f.du=du;$f.dv=dv;$f.dw=dw;$f.dx=dx;$f.dy=dy;$f.dz=dz;$f.ea=ea;$f.eb=eb;$f.ec=ec;$f.ed=ed;$f.ee=ee;$f.ef=ef;$f.eg=eg;$f.eh=eh;$f.ei=ei;$f.ej=ej;$f.ek=ek;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};AO=function(m){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,m,n,o,p,q,r,s,t,u,v,w,x,y,z;n=0;o=false;if(m.length<3){p=0;q=false;n=p;o=q;return[n,o];}if(m.length>=4&&(m.substring(0,4)==="ChST"||m.substring(0,4)==="MeST")){r=4;s=true;n=r;o=s;return[n,o];}if(m.substring(0,3)==="GMT"){n=AP(m);t=n;u=true;n=t;o=u;return[n,o];}v=0;v=0;while(true){if(!(v<6)){break;}if(v>=m.length){break;}w=m.charCodeAt(v);if(w<65||90>0;}x=v;if((x===(0))||(x===(1))||(x===(2))||(x===(6))){y=0;z=false;n=y;o=z;return[n,o];}else if(x===(5)){if(m.charCodeAt(4)===84){aa=5;ab=true;n=aa;o=ab;return[n,o];}}else if(x===(4)){if(m.charCodeAt(3)===84){ac=4;ad=true;n=ac;o=ad;return[n,o];}}else if(x===(3)){ae=3;af=true;n=ae;o=af;return[n,o];}ag=0;ah=false;n=ag;o=ah;return[n,o];};AP=function(m){var $ptr,m,n,o,p,q,r;m=m.substring(3);if(m.length===0){return 3;}n=m.charCodeAt(0);if(!((n===45))&&!((n===43))){return 3;}o=AS(m.substring(1));p=o[0];q=o[1];r=o[2];if(!($interfaceIsEqual(r,$ifaceNil))){return 3;}if(n===45){p=new $Int64(-p.$high,-p.$low);}if((p.$high===0&&p.$low===0)||(p.$high<-1||(p.$high===-1&&p.$low<4294967282))||(0>0)-q.length>>0;};AQ=function(m,n){var $ptr,m,n,o,p,q,r,s,t;o=0;p="";q=$ifaceNil;if(!((m.charCodeAt(0)===46))){q=AE;return[o,p,q];}r=AC(m.substring(1,n));o=r[0];q=r[1];if(!($interfaceIsEqual(q,$ifaceNil))){return[o,p,q];}if(o<0||1000000000<=o){p="fractional second";return[o,p,q];}s=10-n>>0;t=0;while(true){if(!(t>0;}return[o,p,q];};AS=function(m){var $ptr,aa,ab,ac,ad,m,n,o,p,q,r,s,t,u,v,w,x,y,z;n=new $Int64(0,0);o="";p=$ifaceNil;q=0;while(true){if(!(q57){break;}if((n.$high>214748364||(n.$high===214748364&&n.$low>3435973836))){s=new $Int64(0,0);t="";u=AR;n=s;o=t;p=u;return[n,o,p];}n=(v=(w=$mul64(n,new $Int64(0,10)),x=new $Int64(0,r),new $Int64(w.$high+x.$high,w.$low+x.$low)),new $Int64(v.$high-0,v.$low-48));if((n.$high<0||(n.$high===0&&n.$low<0))){y=new $Int64(0,0);z="";aa=AR;n=y;o=z;p=aa;return[n,o,p];}q=q+(1)>>0;}ab=n;ac=m.substring(q);ad=$ifaceNil;n=ab;o=ac;p=ad;return[n,o,p];};AU=function(m){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,m,n,o,p,q,r,s,t,u,v,w,x,y,z;n=m;o=new $Int64(0,0);p=false;if(!(m==="")){q=m.charCodeAt(0);if((q===45)||(q===43)){p=q===45;m=m.substring(1);}}if(m==="0"){return[new BS(0,0),$ifaceNil];}if(m===""){return[new BS(0,0),D.New("time: invalid duration "+n)];}while(true){if(!(!(m===""))){break;}r=new $Int64(0,0);s=new $Int64(0,0);t=r;u=s;v=1;w=$ifaceNil;if(!((m.charCodeAt(0)===46)||48<=m.charCodeAt(0)&&m.charCodeAt(0)<=57)){return[new BS(0,0),D.New("time: invalid duration "+n)];}x=m.length;y=AS(m);t=y[0];m=y[1];w=y[2];if(!($interfaceIsEqual(w,$ifaceNil))){return[new BS(0,0),D.New("time: invalid duration "+n)];}z=!((x===m.length));aa=false;if(!(m==="")&&(m.charCodeAt(0)===46)){m=m.substring(1);ab=m.length;ac=AS(m);u=ac[0];m=ac[1];w=ac[2];if(!($interfaceIsEqual(w,$ifaceNil))){return[new BS(0,0),D.New("time: invalid duration "+n)];}ad=ab-m.length>>0;while(true){if(!(ad>0)){break;}v=v*(10);ad=ad-(1)>>0;}aa=!((ab===m.length));}if(!z&&!aa){return[new BS(0,0),D.New("time: invalid duration "+n)];}ae=0;while(true){if(!(ae>0;}if(ae===0){return[new BS(0,0),D.New("time: missing unit in duration "+n)];}ag=m.substring(0,ae);m=m.substring(ae);ah=(ai=AT[$String.keyFor(ag)],ai!==undefined?[ai.v,true]:[new $Int64(0,0),false]);aj=ah[0];ak=ah[1];if(!ak){return[new BS(0,0),D.New("time: unknown unit "+ag+" in duration "+n)];}if((al=$div64(new $Int64(2147483647,4294967295),aj,false),(t.$high>al.$high||(t.$high===al.$high&&t.$low>al.$low)))){return[new BS(0,0),D.New("time: invalid duration "+n)];}t=$mul64(t,(aj));if((u.$high>0||(u.$high===0&&u.$low>0))){t=(am=new $Int64(0,$flatten64(u)*($flatten64(aj)/v)),new $Int64(t.$high+am.$high,t.$low+am.$low));if((t.$high<0||(t.$high===0&&t.$low<0))){return[new BS(0,0),D.New("time: invalid duration "+n)];}}o=(an=t,new $Int64(o.$high+an.$high,o.$low+an.$low));if((o.$high<0||(o.$high===0&&o.$low<0))){return[new BS(0,0),D.New("time: invalid duration "+n)];}}if(p){o=new $Int64(-o.$high,-o.$low);}return[new BS(o.$high,o.$low),$ifaceNil];};$pkg.ParseDuration=AU;BL.ptr.prototype.After=function(m){var $ptr,m,n,o,p,q,r;m=$clone(m,BL);n=$clone(this,BL);return(o=n.sec,p=m.sec,(o.$high>p.$high||(o.$high===p.$high&&o.$low>p.$low)))||(q=n.sec,r=m.sec,(q.$high===r.$high&&q.$low===r.$low))&&n.nsec>m.nsec;};BL.prototype.After=function(m){return this.$val.After(m);};BL.ptr.prototype.Before=function(m){var $ptr,m,n,o,p,q,r;m=$clone(m,BL);n=$clone(this,BL);return(o=n.sec,p=m.sec,(o.$high>0,((n<0||n>=BN.length)?$throwRuntimeError("index out of range"):BN[n]));};$ptrType(BM).prototype.String=function(){return new BM(this.$get()).String();};BO.prototype.String=function(){var $ptr,m;m=this.$val;return((m<0||m>=BP.length)?$throwRuntimeError("index out of range"):BP[m]);};$ptrType(BO).prototype.String=function(){return new BO(this.$get()).String();};BL.ptr.prototype.IsZero=function(){var $ptr,m,n;m=$clone(this,BL);return(n=m.sec,(n.$high===0&&n.$low===0))&&(m.nsec===0);};BL.prototype.IsZero=function(){return this.$val.IsZero();};BL.ptr.prototype.abs=function(){var $ptr,m,n,o,p,q,r,s,t,u,v,w,x,y,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BL);n=m.loc;if(n===DJ.nil||n===CJ){$s=1;continue;}$s=2;continue;case 1:o=n.get();$s=3;case 3:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}n=o;case 2:q=(p=m.sec,new $Int64(p.$high+-15,p.$low+2288912640));if(!(n===CI)){$s=4;continue;}$s=5;continue;case 4:if(!(n.cacheZone===DC.nil)&&(r=n.cacheStart,(r.$high>0)/86400,(o===o&&o!==1/0&&o!==-1/0)?o>>0:$throwRuntimeError("integer divide by zero"))>>0);};BL.ptr.prototype.ISOWeek=function(){var $ptr,aa,ab,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=0;n=0;o=$clone(this,BL);q=o.date(true);$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}p=q;m=p[0];r=p[1];s=p[2];t=p[3];v=o.Weekday();$s=2;case 2:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}w=(u=((v+6>>0)>>0)%7,u===u?u:$throwRuntimeError("integer divide by zero"));n=(x=(((t-w>>0)+7>>0))/7,(x===x&&x!==1/0&&x!==-1/0)?x>>0:$throwRuntimeError("integer divide by zero"));z=(y=(((w-t>>0)+371>>0))%7,y===y?y:$throwRuntimeError("integer divide by zero"));if(1<=z&&z<=3){n=n+(1)>>0;}if(n===0){m=m-(1)>>0;n=52;if((z===4)||((z===5)&&CB(m))){n=n+(1)>>0;}}if((r===12)&&s>=29&&w<3){ab=(aa=(((w+31>>0)-s>>0))%7,aa===aa?aa:$throwRuntimeError("integer divide by zero"));if(0<=ab&&ab<=2){m=m+(1)>>0;n=1;}}return[m,n];}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.ISOWeek};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.ISOWeek=function(){return this.$val.ISOWeek();};BL.ptr.prototype.Clock=function(){var $ptr,m,n,o,p,q,r,s,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=0;n=0;o=0;p=$clone(this,BL);r=p.abs();$s=1;case 1:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}s=BR(r);$s=2;case 2:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}q=s;m=q[0];n=q[1];o=q[2];$s=3;case 3:return[m,n,o];}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.Clock};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.Clock=function(){return this.$val.Clock();};BR=function(m){var $ptr,m,n,o,p,q,r;n=0;o=0;p=0;p=($div64(m,new $Uint64(0,86400),true).$low>>0);n=(q=p/3600,(q===q&&q!==1/0&&q!==-1/0)?q>>0:$throwRuntimeError("integer divide by zero"));p=p-(($imul(n,3600)))>>0;o=(r=p/60,(r===r&&r!==1/0&&r!==-1/0)?r>>0:$throwRuntimeError("integer divide by zero"));p=p-(($imul(o,60)))>>0;return[n,o,p];};BL.ptr.prototype.Hour=function(){var $ptr,m,n,o,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BL);o=m.abs();$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}$s=2;case 2:return(n=($div64(o,new $Uint64(0,86400),true).$low>>0)/3600,(n===n&&n!==1/0&&n!==-1/0)?n>>0:$throwRuntimeError("integer divide by zero"));}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.Hour};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.Hour=function(){return this.$val.Hour();};BL.ptr.prototype.Minute=function(){var $ptr,m,n,o,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BL);o=m.abs();$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}$s=2;case 2:return(n=($div64(o,new $Uint64(0,3600),true).$low>>0)/60,(n===n&&n!==1/0&&n!==-1/0)?n>>0:$throwRuntimeError("integer divide by zero"));}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.Minute};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.Minute=function(){return this.$val.Minute();};BL.ptr.prototype.Second=function(){var $ptr,m,n,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BL);n=m.abs();$s=1;case 1:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}$s=2;case 2:return($div64(n,new $Uint64(0,60),true).$low>>0);}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.Second};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.Second=function(){return this.$val.Second();};BL.ptr.prototype.Nanosecond=function(){var $ptr,m;m=$clone(this,BL);return(m.nsec>>0);};BL.prototype.Nanosecond=function(){return this.$val.Nanosecond();};BL.ptr.prototype.YearDay=function(){var $ptr,m,n,o,p,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BL);o=m.date(false);$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}n=o;p=n[3];return p+1>>0;}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.YearDay};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.YearDay=function(){return this.$val.YearDay();};BS.prototype.String=function(){var $ptr,m,n,o,p,q,r,s,t;m=this;n=DN.zero();o=32;p=new $Uint64(m.$high,m.$low);q=(m.$high<0||(m.$high===0&&m.$low<0));if(q){p=new $Uint64(-p.$high,-p.$low);}if((p.$high<0||(p.$high===0&&p.$low<1000000000))){r=0;o=o-(1)>>0;((o<0||o>=n.length)?$throwRuntimeError("index out of range"):n[o]=115);o=o-(1)>>0;if((p.$high===0&&p.$low===0)){return"0";}else if((p.$high<0||(p.$high===0&&p.$low<1000))){r=0;((o<0||o>=n.length)?$throwRuntimeError("index out of range"):n[o]=110);}else if((p.$high<0||(p.$high===0&&p.$low<1000000))){r=3;o=o-(1)>>0;$copyString($subslice(new DG(n),o),"\xC2\xB5");}else{r=6;((o<0||o>=n.length)?$throwRuntimeError("index out of range"):n[o]=109);}s=BT($subslice(new DG(n),0,o),p,r);o=s[0];p=s[1];o=BU($subslice(new DG(n),0,o),p);}else{o=o-(1)>>0;((o<0||o>=n.length)?$throwRuntimeError("index out of range"):n[o]=115);t=BT($subslice(new DG(n),0,o),p,9);o=t[0];p=t[1];o=BU($subslice(new DG(n),0,o),$div64(p,new $Uint64(0,60),true));p=$div64(p,(new $Uint64(0,60)),false);if((p.$high>0||(p.$high===0&&p.$low>0))){o=o-(1)>>0;((o<0||o>=n.length)?$throwRuntimeError("index out of range"):n[o]=109);o=BU($subslice(new DG(n),0,o),$div64(p,new $Uint64(0,60),true));p=$div64(p,(new $Uint64(0,60)),false);if((p.$high>0||(p.$high===0&&p.$low>0))){o=o-(1)>>0;((o<0||o>=n.length)?$throwRuntimeError("index out of range"):n[o]=104);o=BU($subslice(new DG(n),0,o),p);}}}if(q){o=o-(1)>>0;((o<0||o>=n.length)?$throwRuntimeError("index out of range"):n[o]=45);}return $bytesToString($subslice(new DG(n),o));};$ptrType(BS).prototype.String=function(){return this.$get().String();};BT=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u,v,w;p=0;q=new $Uint64(0,0);r=m.$length;s=false;t=0;while(true){if(!(t>0;((r<0||r>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+r]=((u.$low<<24>>>24)+48<<24>>>24));}n=$div64(n,(new $Uint64(0,10)),false);t=t+(1)>>0;}if(s){r=r-(1)>>0;((r<0||r>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+r]=46);}v=r;w=n;p=v;q=w;return[p,q];};BU=function(m,n){var $ptr,m,n,o;o=m.$length;if((n.$high===0&&n.$low===0)){o=o-(1)>>0;((o<0||o>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+o]=48);}else{while(true){if(!((n.$high>0||(n.$high===0&&n.$low>0)))){break;}o=o-(1)>>0;((o<0||o>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+o]=(($div64(n,new $Uint64(0,10),true).$low<<24>>>24)+48<<24>>>24));n=$div64(n,(new $Uint64(0,10)),false);}}return o;};BS.prototype.Nanoseconds=function(){var $ptr,m;m=this;return new $Int64(m.$high,m.$low);};$ptrType(BS).prototype.Nanoseconds=function(){return this.$get().Nanoseconds();};BS.prototype.Seconds=function(){var $ptr,m,n,o;m=this;n=$div64(m,new BS(0,1000000000),false);o=$div64(m,new BS(0,1000000000),true);return $flatten64(n)+$flatten64(o)*1e-09;};$ptrType(BS).prototype.Seconds=function(){return this.$get().Seconds();};BS.prototype.Minutes=function(){var $ptr,m,n,o;m=this;n=$div64(m,new BS(13,4165425152),false);o=$div64(m,new BS(13,4165425152),true);return $flatten64(n)+$flatten64(o)*1.6666666666666667e-11;};$ptrType(BS).prototype.Minutes=function(){return this.$get().Minutes();};BS.prototype.Hours=function(){var $ptr,m,n,o;m=this;n=$div64(m,new BS(838,817405952),false);o=$div64(m,new BS(838,817405952),true);return $flatten64(n)+$flatten64(o)*2.777777777777778e-13;};$ptrType(BS).prototype.Hours=function(){return this.$get().Hours();};BL.ptr.prototype.Add=function(m){var $ptr,m,n,o,p,q,r,s,t,u,v,w;n=$clone(this,BL);n.sec=(o=n.sec,p=(q=$div64(m,new BS(0,1000000000),false),new $Int64(q.$high,q.$low)),new $Int64(o.$high+p.$high,o.$low+p.$low));s=n.nsec+((r=$div64(m,new BS(0,1000000000),true),r.$low+((r.$high>>31)*4294967296))>>0)>>0;if(s>=1000000000){n.sec=(t=n.sec,u=new $Int64(0,1),new $Int64(t.$high+u.$high,t.$low+u.$low));s=s-(1000000000)>>0;}else if(s<0){n.sec=(v=n.sec,w=new $Int64(0,1),new $Int64(v.$high-w.$high,v.$low-w.$low));s=s+(1000000000)>>0;}n.nsec=s;return n;};BL.prototype.Add=function(m){return this.$val.Add(m);};BL.ptr.prototype.Sub=function(m){var $ptr,m,n,o,p,q,r,s,t;m=$clone(m,BL);n=$clone(this,BL);t=(o=$mul64((p=(q=n.sec,r=m.sec,new $Int64(q.$high-r.$high,q.$low-r.$low)),new BS(p.$high,p.$low)),new BS(0,1000000000)),s=new BS(0,(n.nsec-m.nsec>>0)),new BS(o.$high+s.$high,o.$low+s.$low));if(m.Add(t).Equal(n)){return t;}else if(n.Before(m)){return new BS(-2147483648,0);}else{return new BS(2147483647,4294967295);}};BL.prototype.Sub=function(m){return this.$val.Sub(m);};BL.ptr.prototype.AddDate=function(m,n,o){var $ptr,aa,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:p=$clone(this,BL);r=p.Date();$s=1;case 1:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}q=r;s=q[0];t=q[1];u=q[2];w=p.Clock();$s=2;case 2:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}v=w;x=v[0];y=v[1];z=v[2];aa=CD(s+m>>0,t+(n>>0)>>0,u+o>>0,x,y,z,(p.nsec>>0),p.loc);$s=3;case 3:if($c){$c=false;aa=aa.$blk();}if(aa&&aa.$blk!==undefined){break s;}$s=4;case 4:return aa;}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.AddDate};}$f.$ptr=$ptr;$f.aa=aa;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.AddDate=function(m,n,o){return this.$val.AddDate(m,n,o);};BL.ptr.prototype.date=function(m){var $ptr,m,n,o,p,q,r,s,t,u,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=0;o=0;p=0;q=0;r=$clone(this,BL);t=r.abs();$s=1;case 1:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}u=BW(t,m);$s=2;case 2:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}s=u;n=s[0];o=s[1];p=s[2];q=s[3];$s=3;case 3:return[n,o,p,q];}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.date};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.date=function(m){return this.$val.date(m);};BW=function(m,n){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,m,n,o,p,q,r,s,t,u,v,w,x,y,z;o=0;p=0;q=0;r=0;s=$div64(m,new $Uint64(0,86400),false);t=$div64(s,new $Uint64(0,146097),false);u=$mul64(new $Uint64(0,400),t);s=(v=$mul64(new $Uint64(0,146097),t),new $Uint64(s.$high-v.$high,s.$low-v.$low));t=$div64(s,new $Uint64(0,36524),false);t=(w=$shiftRightUint64(t,2),new $Uint64(t.$high-w.$high,t.$low-w.$low));u=(x=$mul64(new $Uint64(0,100),t),new $Uint64(u.$high+x.$high,u.$low+x.$low));s=(y=$mul64(new $Uint64(0,36524),t),new $Uint64(s.$high-y.$high,s.$low-y.$low));t=$div64(s,new $Uint64(0,1461),false);u=(z=$mul64(new $Uint64(0,4),t),new $Uint64(u.$high+z.$high,u.$low+z.$low));s=(aa=$mul64(new $Uint64(0,1461),t),new $Uint64(s.$high-aa.$high,s.$low-aa.$low));t=$div64(s,new $Uint64(0,365),false);t=(ab=$shiftRightUint64(t,2),new $Uint64(t.$high-ab.$high,t.$low-ab.$low));u=(ac=t,new $Uint64(u.$high+ac.$high,u.$low+ac.$low));s=(ad=$mul64(new $Uint64(0,365),t),new $Uint64(s.$high-ad.$high,s.$low-ad.$low));o=((ae=(af=new $Int64(u.$high,u.$low),new $Int64(af.$high+-69,af.$low+4075721025)),ae.$low+((ae.$high>>31)*4294967296))>>0);r=(s.$low>>0);if(!n){return[o,p,q,r];}q=r;if(CB(o)){if(q>59){q=q-(1)>>0;}else if((q===59)){p=2;q=29;return[o,p,q,r];}}p=((ag=q/31,(ag===ag&&ag!==1/0&&ag!==-1/0)?ag>>0:$throwRuntimeError("integer divide by zero"))>>0);ai=((ah=p+1>>0,((ah<0||ah>=BX.length)?$throwRuntimeError("index out of range"):BX[ah]))>>0);aj=0;if(q>=ai){p=p+(1)>>0;aj=ai;}else{aj=(((p<0||p>=BX.length)?$throwRuntimeError("index out of range"):BX[p])>>0);}p=p+(1)>>0;q=(q-aj>>0)+1>>0;return[o,p,q,r];};BY=function(m,n){var $ptr,m,n,o;if((m===2)&&CB(n)){return 29;}return((((m<0||m>=BX.length)?$throwRuntimeError("index out of range"):BX[m])-(o=m-1>>0,((o<0||o>=BX.length)?$throwRuntimeError("index out of range"):BX[o]))>>0)>>0);};BL.ptr.prototype.UTC=function(){var $ptr,m;m=$clone(this,BL);m.loc=$pkg.UTC;return m;};BL.prototype.UTC=function(){return this.$val.UTC();};BL.ptr.prototype.Local=function(){var $ptr,m;m=$clone(this,BL);m.loc=$pkg.Local;return m;};BL.prototype.Local=function(){return this.$val.Local();};BL.ptr.prototype.In=function(m){var $ptr,m,n;n=$clone(this,BL);if(m===DJ.nil){$panic(new $String("time: missing Location in call to Time.In"));}n.loc=m;return n;};BL.prototype.In=function(m){return this.$val.In(m);};BL.ptr.prototype.Location=function(){var $ptr,m,n;m=$clone(this,BL);n=m.loc;if(n===DJ.nil){n=$pkg.UTC;}return n;};BL.prototype.Location=function(){return this.$val.Location();};BL.ptr.prototype.Zone=function(){var $ptr,m,n,o,p,q,r,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m="";n=0;o=$clone(this,BL);r=o.loc.lookup((q=o.sec,new $Int64(q.$high+-15,q.$low+2288912640)));$s=1;case 1:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}p=r;m=p[0];n=p[1];return[m,n];}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.Zone};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.Zone=function(){return this.$val.Zone();};BL.ptr.prototype.Unix=function(){var $ptr,m,n;m=$clone(this,BL);return(n=m.sec,new $Int64(n.$high+-15,n.$low+2288912640));};BL.prototype.Unix=function(){return this.$val.Unix();};BL.ptr.prototype.UnixNano=function(){var $ptr,m,n,o,p;m=$clone(this,BL);return(n=$mul64(((o=m.sec,new $Int64(o.$high+-15,o.$low+2288912640))),new $Int64(0,1000000000)),p=new $Int64(0,m.nsec),new $Int64(n.$high+p.$high,n.$low+p.$low));};BL.prototype.UnixNano=function(){return this.$val.UnixNano();};BL.ptr.prototype.MarshalBinary=function(){var $ptr,m,n,o,p,q,r,s,t,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BL);n=0;if(m.Location()===CI){$s=1;continue;}$s=2;continue;case 1:n=-1;$s=3;continue;case 2:p=m.Zone();$s=4;case 4:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}o=p;q=o[1];if(!(((r=q%60,r===r?r:$throwRuntimeError("integer divide by zero"))===0))){return[DG.nil,D.New("Time.MarshalBinary: zone offset has fractional minute")];}q=(s=q/(60),(s===s&&s!==1/0&&s!==-1/0)?s>>0:$throwRuntimeError("integer divide by zero"));if(q<-32768||(q===-1)||q>32767){return[DG.nil,D.New("Time.MarshalBinary: unexpected zone offset")];}n=(q<<16>>16);case 3:t=new DG([1,($shiftRightInt64(m.sec,56).$low<<24>>>24),($shiftRightInt64(m.sec,48).$low<<24>>>24),($shiftRightInt64(m.sec,40).$low<<24>>>24),($shiftRightInt64(m.sec,32).$low<<24>>>24),($shiftRightInt64(m.sec,24).$low<<24>>>24),($shiftRightInt64(m.sec,16).$low<<24>>>24),($shiftRightInt64(m.sec,8).$low<<24>>>24),(m.sec.$low<<24>>>24),((m.nsec>>24>>0)<<24>>>24),((m.nsec>>16>>0)<<24>>>24),((m.nsec>>8>>0)<<24>>>24),(m.nsec<<24>>>24),((n>>8<<16>>16)<<24>>>24),(n<<24>>>24)]);return[t,$ifaceNil];}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.MarshalBinary};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.MarshalBinary=function(){return this.$val.MarshalBinary();};BL.ptr.prototype.UnmarshalBinary=function(m){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=this;o=m;if(o.$length===0){return D.New("Time.UnmarshalBinary: no data");}if(!(((0>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0])===1))){return D.New("Time.UnmarshalBinary: unsupported version");}if(!((o.$length===15))){return D.New("Time.UnmarshalBinary: invalid length");}o=$subslice(o,1);n.sec=(p=(q=(r=(s=(t=(u=(v=new $Int64(0,(7>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+7])),w=$shiftLeft64(new $Int64(0,(6>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+6])),8),new $Int64(v.$high|w.$high,(v.$low|w.$low)>>>0)),x=$shiftLeft64(new $Int64(0,(5>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+5])),16),new $Int64(u.$high|x.$high,(u.$low|x.$low)>>>0)),y=$shiftLeft64(new $Int64(0,(4>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+4])),24),new $Int64(t.$high|y.$high,(t.$low|y.$low)>>>0)),z=$shiftLeft64(new $Int64(0,(3>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+3])),32),new $Int64(s.$high|z.$high,(s.$low|z.$low)>>>0)),aa=$shiftLeft64(new $Int64(0,(2>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+2])),40),new $Int64(r.$high|aa.$high,(r.$low|aa.$low)>>>0)),ab=$shiftLeft64(new $Int64(0,(1>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+1])),48),new $Int64(q.$high|ab.$high,(q.$low|ab.$low)>>>0)),ac=$shiftLeft64(new $Int64(0,(0>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0])),56),new $Int64(p.$high|ac.$high,(p.$low|ac.$low)>>>0));o=$subslice(o,8);n.nsec=((((3>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+3])>>0)|(((2>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+2])>>0)<<8>>0))|(((1>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+1])>>0)<<16>>0))|(((0>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0])>>0)<<24>>0);o=$subslice(o,4);ad=$imul(((((1>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+1])<<16>>16)|(((0>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0])<<16>>16)<<8<<16>>16))>>0),60);if(ad===-60){$s=1;continue;}$s=2;continue;case 1:n.loc=CI;$s=3;continue;case 2:ag=$pkg.Local.lookup((af=n.sec,new $Int64(af.$high+-15,af.$low+2288912640)));$s=4;case 4:if($c){$c=false;ag=ag.$blk();}if(ag&&ag.$blk!==undefined){break s;}ae=ag;ah=ae[1];if(ad===ah){n.loc=$pkg.Local;}else{n.loc=CL("",ad);}case 3:return $ifaceNil;}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.UnmarshalBinary};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.UnmarshalBinary=function(m){return this.$val.UnmarshalBinary(m);};BL.ptr.prototype.GobEncode=function(){var $ptr,m,n,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BL);n=m.MarshalBinary();$s=1;case 1:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}$s=2;case 2:return n;}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.GobEncode};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.GobEncode=function(){return this.$val.GobEncode();};BL.ptr.prototype.GobDecode=function(m){var $ptr,m,n,o,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=this;o=n.UnmarshalBinary(m);$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}$s=2;case 2:return o;}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.GobDecode};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.GobDecode=function(m){return this.$val.GobDecode(m);};BL.ptr.prototype.MarshalJSON=function(){var $ptr,m,n,o,p,q,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BL);n=m.Year();$s=1;case 1:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}o=n;if(o<0||o>=10000){return[DG.nil,D.New("Time.MarshalJSON: year outside of range [0,9999]")];}p=$makeSlice(DG,0,37);p=$append(p,34);q=m.AppendFormat(p,"2006-01-02T15:04:05.999999999Z07:00");$s=2;case 2:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}p=q;p=$append(p,34);return[p,$ifaceNil];}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.MarshalJSON};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.MarshalJSON=function(){return this.$val.MarshalJSON();};BL.ptr.prototype.UnmarshalJSON=function(m){var $ptr,m,n,o,p,q,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=$ifaceNil;o=this;q=AL("\"2006-01-02T15:04:05Z07:00\"",$bytesToString(m));$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}p=q;BL.copy(o,p[0]);n=p[1];return n;}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.UnmarshalJSON};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.UnmarshalJSON=function(m){return this.$val.UnmarshalJSON(m);};BL.ptr.prototype.MarshalText=function(){var $ptr,m,n,o,p,q,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BL);n=m.Year();$s=1;case 1:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}o=n;if(o<0||o>=10000){return[DG.nil,D.New("Time.MarshalText: year outside of range [0,9999]")];}p=$makeSlice(DG,0,35);q=m.AppendFormat(p,"2006-01-02T15:04:05.999999999Z07:00");$s=2;case 2:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}$s=3;case 3:return[q,$ifaceNil];}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.MarshalText};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.MarshalText=function(){return this.$val.MarshalText();};BL.ptr.prototype.UnmarshalText=function(m){var $ptr,m,n,o,p,q,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=$ifaceNil;o=this;q=AL("2006-01-02T15:04:05Z07:00",$bytesToString(m));$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}p=q;BL.copy(o,p[0]);n=p[1];return n;}return;}if($f===undefined){$f={$blk:BL.ptr.prototype.UnmarshalText};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.$s=$s;$f.$r=$r;return $f;};BL.prototype.UnmarshalText=function(m){return this.$val.UnmarshalText(m);};CA=function(m,n){var $ptr,m,n,o,p,q,r,s;if((n.$high<0||(n.$high===0&&n.$low<0))||(n.$high>0||(n.$high===0&&n.$low>=1000000000))){o=$div64(n,new $Int64(0,1000000000),false);m=(p=o,new $Int64(m.$high+p.$high,m.$low+p.$low));n=(q=$mul64(o,new $Int64(0,1000000000)),new $Int64(n.$high-q.$high,n.$low-q.$low));if((n.$high<0||(n.$high===0&&n.$low<0))){n=(r=new $Int64(0,1000000000),new $Int64(n.$high+r.$high,n.$low+r.$low));m=(s=new $Int64(0,1),new $Int64(m.$high-s.$high,m.$low-s.$low));}}return new BL.ptr(new $Int64(m.$high+14,m.$low+2006054656),((n.$low+((n.$high>>31)*4294967296))>>0),$pkg.Local);};$pkg.Unix=CA;CB=function(m){var $ptr,m,n,o,p;return((n=m%4,n===n?n:$throwRuntimeError("integer divide by zero"))===0)&&(!(((o=m%100,o===o?o:$throwRuntimeError("integer divide by zero"))===0))||((p=m%400,p===p?p:$throwRuntimeError("integer divide by zero"))===0));};CC=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u,v,w;p=0;q=0;if(n<0){s=(r=((-n-1>>0))/o,(r===r&&r!==1/0&&r!==-1/0)?r>>0:$throwRuntimeError("integer divide by zero"))+1>>0;m=m-(s)>>0;n=n+(($imul(s,o)))>>0;}if(n>=o){u=(t=n/o,(t===t&&t!==1/0&&t!==-1/0)?t>>0:$throwRuntimeError("integer divide by zero"));m=m+(u)>>0;n=n-(($imul(u,o)))>>0;}v=m;w=n;p=v;q=w;return[p,q];};CD=function(m,n,o,p,q,r,s,t){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,bc,bd,be,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;ax=$f.ax;ay=$f.ay;az=$f.az;ba=$f.ba;bb=$f.bb;bc=$f.bc;bd=$f.bd;be=$f.be;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:if(t===DJ.nil){$panic(new $String("time: missing Location in call to Date"));}u=(n>>0)-1>>0;v=CC(m,u,12);m=v[0];u=v[1];n=(u>>0)+1>>0;w=CC(r,s,1000000000);r=w[0];s=w[1];x=CC(q,r,60);q=x[0];r=x[1];y=CC(p,q,60);p=y[0];q=y[1];z=CC(o,p,24);o=z[0];p=z[1];ac=(aa=(ab=new $Int64(0,m),new $Int64(ab.$high- -69,ab.$low-4075721025)),new $Uint64(aa.$high,aa.$low));ad=$div64(ac,new $Uint64(0,400),false);ac=(ae=$mul64(new $Uint64(0,400),ad),new $Uint64(ac.$high-ae.$high,ac.$low-ae.$low));af=$mul64(new $Uint64(0,146097),ad);ad=$div64(ac,new $Uint64(0,100),false);ac=(ag=$mul64(new $Uint64(0,100),ad),new $Uint64(ac.$high-ag.$high,ac.$low-ag.$low));af=(ah=$mul64(new $Uint64(0,36524),ad),new $Uint64(af.$high+ah.$high,af.$low+ah.$low));ad=$div64(ac,new $Uint64(0,4),false);ac=(ai=$mul64(new $Uint64(0,4),ad),new $Uint64(ac.$high-ai.$high,ac.$low-ai.$low));af=(aj=$mul64(new $Uint64(0,1461),ad),new $Uint64(af.$high+aj.$high,af.$low+aj.$low));ad=ac;af=(ak=$mul64(new $Uint64(0,365),ad),new $Uint64(af.$high+ak.$high,af.$low+ak.$low));af=(al=new $Uint64(0,(am=n-1>>0,((am<0||am>=BX.length)?$throwRuntimeError("index out of range"):BX[am]))),new $Uint64(af.$high+al.$high,af.$low+al.$low));if(CB(m)&&n>=3){af=(an=new $Uint64(0,1),new $Uint64(af.$high+an.$high,af.$low+an.$low));}af=(ao=new $Uint64(0,(o-1>>0)),new $Uint64(af.$high+ao.$high,af.$low+ao.$low));ap=$mul64(af,new $Uint64(0,86400));ap=(aq=new $Uint64(0,((($imul(p,3600))+($imul(q,60))>>0)+r>>0)),new $Uint64(ap.$high+aq.$high,ap.$low+aq.$low));as=(ar=new $Int64(ap.$high,ap.$low),new $Int64(ar.$high+-2147483647,ar.$low+3844486912));au=t.lookup(as);$s=1;case 1:if($c){$c=false;au=au.$blk();}if(au&&au.$blk!==undefined){break s;}at=au;av=at[1];aw=at[3];ax=at[4];if(!((av===0))){$s=2;continue;}$s=3;continue;case 2:az=(ay=new $Int64(0,av),new $Int64(as.$high-ay.$high,as.$low-ay.$low));if((az.$highax.$high||(az.$high===ax.$high&&az.$low>=ax.$low))){$s=6;continue;}$s=7;continue;case 5:bb=t.lookup(new $Int64(aw.$high-0,aw.$low-1));$s=8;case 8:if($c){$c=false;bb=bb.$blk();}if(bb&&bb.$blk!==undefined){break s;}ba=bb;av=ba[1];$s=7;continue;case 6:bd=t.lookup(ax);$s=9;case 9:if($c){$c=false;bd=bd.$blk();}if(bd&&bd.$blk!==undefined){break s;}bc=bd;av=bc[1];case 7:case 4:as=(be=new $Int64(0,av),new $Int64(as.$high-be.$high,as.$low-be.$low));case 3:return new BL.ptr(new $Int64(as.$high+14,as.$low+2006054656),(s>>0),t);}return;}if($f===undefined){$f={$blk:CD};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.ax=ax;$f.ay=ay;$f.az=az;$f.ba=ba;$f.bb=bb;$f.bc=bc;$f.bd=bd;$f.be=be;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Date=CD;BL.ptr.prototype.Truncate=function(m){var $ptr,m,n,o,p;n=$clone(this,BL);if((m.$high<0||(m.$high===0&&m.$low<=0))){return n;}o=CE(n,m);p=o[1];return n.Add(new BS(-p.$high,-p.$low));};BL.prototype.Truncate=function(m){return this.$val.Truncate(m);};BL.ptr.prototype.Round=function(m){var $ptr,m,n,o,p,q;n=$clone(this,BL);if((m.$high<0||(m.$high===0&&m.$low<=0))){return n;}o=CE(n,m);p=o[1];if((q=new BS(p.$high+p.$high,p.$low+p.$low),(q.$high>0;m.sec=(u=m.sec,v=new $Int64(0,1),new $Int64(u.$high-v.$high,u.$low-v.$low));}}if((n.$high<0||(n.$high===0&&n.$low<1000000000))&&(w=$div64(new BS(0,1000000000),(new BS(n.$high+n.$high,n.$low+n.$low)),true),(w.$high===0&&w.$low===0))){o=((y=r/((n.$low+((n.$high>>31)*4294967296))>>0),(y===y&&y!==1/0&&y!==-1/0)?y>>0:$throwRuntimeError("integer divide by zero"))>>0)&1;p=new BS(0,(z=r%((n.$low+((n.$high>>31)*4294967296))>>0),z===z?z:$throwRuntimeError("integer divide by zero")));}else if((x=$div64(n,new BS(0,1000000000),true),(x.$high===0&&x.$low===0))){ab=(aa=$div64(n,new BS(0,1000000000),false),new $Int64(aa.$high,aa.$low));o=((ac=$div64(m.sec,ab,false),ac.$low+((ac.$high>>31)*4294967296))>>0)&1;p=(ad=$mul64((ae=$div64(m.sec,ab,true),new BS(ae.$high,ae.$low)),new BS(0,1000000000)),af=new BS(0,r),new BS(ad.$high+af.$high,ad.$low+af.$low));}else{ah=(ag=m.sec,new $Uint64(ag.$high,ag.$low));ai=$mul64(($shiftRightUint64(ah,32)),new $Uint64(0,1000000000));aj=$shiftRightUint64(ai,32);ak=$shiftLeft64(ai,32);ai=$mul64(new $Uint64(ah.$high&0,(ah.$low&4294967295)>>>0),new $Uint64(0,1000000000));al=ak;am=new $Uint64(ak.$high+ai.$high,ak.$low+ai.$low);an=al;ak=am;if((ak.$highat.$high||(aj.$high===at.$high&&aj.$low>at.$low))||(aj.$high===at.$high&&aj.$low===at.$low)&&(ak.$high>av.$high||(ak.$high===av.$high&&ak.$low>=av.$low))){o=1;aw=ak;ax=new $Uint64(ak.$high-av.$high,ak.$low-av.$low);an=aw;ak=ax;if((ak.$high>an.$high||(ak.$high===an.$high&&ak.$low>an.$low))){aj=(ay=new $Uint64(0,1),new $Uint64(aj.$high-ay.$high,aj.$low-ay.$low));}aj=(az=at,new $Uint64(aj.$high-az.$high,aj.$low-az.$low));}if((at.$high===0&&at.$low===0)&&(ba=new $Uint64(n.$high,n.$low),(av.$high===ba.$high&&av.$low===ba.$low))){break;}av=$shiftRightUint64(av,(1));av=(bb=$shiftLeft64((new $Uint64(at.$high&0,(at.$low&1)>>>0)),63),new $Uint64(av.$high|bb.$high,(av.$low|bb.$low)>>>0));at=$shiftRightUint64(at,(1));}p=new BS(ak.$high,ak.$low);}if(q&&!((p.$high===0&&p.$low===0))){o=(o^(1))>>0;p=new BS(n.$high-p.$high,n.$low-p.$low);}return[o,p];};CF.ptr.prototype.get=function(){var $ptr,m,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=this;if(m===DJ.nil){return CI;}if(m===CJ){$s=1;continue;}$s=2;continue;case 1:$r=CK.Do(I);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:return m;}return;}if($f===undefined){$f={$blk:CF.ptr.prototype.get};}$f.$ptr=$ptr;$f.m=m;$f.$s=$s;$f.$r=$r;return $f;};CF.prototype.get=function(){return this.$val.get();};CF.ptr.prototype.String=function(){var $ptr,m,n,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=this;n=m.get();$s=1;case 1:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}$s=2;case 2:return n.name;}return;}if($f===undefined){$f={$blk:CF.ptr.prototype.String};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.$s=$s;$f.$r=$r;return $f;};CF.prototype.String=function(){return this.$val.String();};CL=function(m,n){var $ptr,m,n,o,p;o=new CF.ptr(m,new DA([new CG.ptr(m,n,false)]),new DB([new CH.ptr(new $Int64(-2147483648,0),0,false,false)]),new $Int64(-2147483648,0),new $Int64(2147483647,4294967295),DC.nil);o.cacheZone=(p=o.zone,(0>=p.$length?$throwRuntimeError("index out of range"):p.$array[p.$offset+0]));return o;};$pkg.FixedZone=CL;CF.ptr.prototype.lookup=function(m){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n="";o=0;p=false;q=new $Int64(0,0);r=new $Int64(0,0);s=this;t=s.get();$s=1;case 1:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}s=t;if(s.zone.$length===0){n="UTC";o=0;p=false;q=new $Int64(-2147483648,0);r=new $Int64(2147483647,4294967295);return[n,o,p,q,r];}u=s.cacheZone;if(!(u===DC.nil)&&(v=s.cacheStart,(v.$high=y.$length?$throwRuntimeError("index out of range"):y.$array[y.$offset+0])).when,(m.$high=z.$length)?$throwRuntimeError("index out of range"):z.$array[z.$offset+aa]));n=ab.name;o=ab.offset;p=ab.isDST;q=new $Int64(-2147483648,0);if(s.tx.$length>0){r=(ac=s.tx,(0>=ac.$length?$throwRuntimeError("index out of range"):ac.$array[ac.$offset+0])).when;}else{r=new $Int64(2147483647,4294967295);}return[n,o,p,q,r];}ad=s.tx;r=new $Int64(2147483647,4294967295);ae=0;af=ad.$length;while(true){if(!((af-ae>>0)>1)){break;}ah=ae+(ag=((af-ae>>0))/2,(ag===ag&&ag!==1/0&&ag!==-1/0)?ag>>0:$throwRuntimeError("integer divide by zero"))>>0;ai=((ah<0||ah>=ad.$length)?$throwRuntimeError("index out of range"):ad.$array[ad.$offset+ah]).when;if((m.$high=ad.$length)?$throwRuntimeError("index out of range"):ad.$array[ad.$offset+ae]).index,((ak<0||ak>=aj.$length)?$throwRuntimeError("index out of range"):aj.$array[aj.$offset+ak]));n=al.name;o=al.offset;p=al.isDST;q=((ae<0||ae>=ad.$length)?$throwRuntimeError("index out of range"):ad.$array[ad.$offset+ae]).when;return[n,o,p,q,r];}return;}if($f===undefined){$f={$blk:CF.ptr.prototype.lookup};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};CF.prototype.lookup=function(m){return this.$val.lookup(m);};CF.ptr.prototype.lookupFirstZone=function(){var $ptr,m,n,o,p,q,r,s,t,u,v,w;m=this;if(!m.firstZoneUsed()){return 0;}if(m.tx.$length>0&&(n=m.zone,o=(p=m.tx,(0>=p.$length?$throwRuntimeError("index out of range"):p.$array[p.$offset+0])).index,((o<0||o>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+o])).isDST){r=((q=m.tx,(0>=q.$length?$throwRuntimeError("index out of range"):q.$array[q.$offset+0])).index>>0)-1>>0;while(true){if(!(r>=0)){break;}if(!(s=m.zone,((r<0||r>=s.$length)?$throwRuntimeError("index out of range"):s.$array[s.$offset+r])).isDST){return r;}r=r-(1)>>0;}}t=m.zone;u=0;while(true){if(!(u=w.$length)?$throwRuntimeError("index out of range"):w.$array[w.$offset+v])).isDST){return v;}u++;}return 0;};CF.prototype.lookupFirstZone=function(){return this.$val.lookupFirstZone();};CF.ptr.prototype.firstZoneUsed=function(){var $ptr,m,n,o,p;m=this;n=m.tx;o=0;while(true){if(!(o=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+o]),CH);if(p.index===0){return true;}o++;}return false;};CF.prototype.firstZoneUsed=function(){return this.$val.firstZoneUsed();};CF.ptr.prototype.lookupName=function(m,n){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:o=0;p=false;q=false;r=this;s=r.get();$s=1;case 1:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}r=s;t=r.zone;u=0;case 2:if(!(u=w.$length)?$throwRuntimeError("index out of range"):w.$array[w.$offset+v]));if(x.name===m){$s=4;continue;}$s=5;continue;case 4:aa=r.lookup((z=new $Int64(0,x.offset),new $Int64(n.$high-z.$high,n.$low-z.$low)));$s=6;case 6:if($c){$c=false;aa=aa.$blk();}if(aa&&aa.$blk!==undefined){break s;}y=aa;ab=y[0];ac=y[1];ad=y[2];if(ab===x.name){ae=ac;af=ad;ag=true;o=ae;p=af;q=ag;return[o,p,q];}case 5:u++;$s=2;continue;case 3:ah=r.zone;ai=0;while(true){if(!(ai=ak.$length)?$throwRuntimeError("index out of range"):ak.$array[ak.$offset+aj]));if(al.name===m){am=al.offset;an=al.isDST;ao=true;o=am;p=an;q=ao;return[o,p,q];}ai++;}return[o,p,q];}return;}if($f===undefined){$f={$blk:CF.ptr.prototype.lookupName};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};CF.prototype.lookupName=function(m,n){return this.$val.lookupName(m,n);};DR.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];BL.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Format",name:"Format",pkg:"",typ:$funcType([$String],[$String],false)},{prop:"AppendFormat",name:"AppendFormat",pkg:"",typ:$funcType([DG,$String],[DG],false)},{prop:"After",name:"After",pkg:"",typ:$funcType([BL],[$Bool],false)},{prop:"Before",name:"Before",pkg:"",typ:$funcType([BL],[$Bool],false)},{prop:"Equal",name:"Equal",pkg:"",typ:$funcType([BL],[$Bool],false)},{prop:"IsZero",name:"IsZero",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"abs",name:"abs",pkg:"time",typ:$funcType([],[$Uint64],false)},{prop:"locabs",name:"locabs",pkg:"time",typ:$funcType([],[$String,$Int,$Uint64],false)},{prop:"Date",name:"Date",pkg:"",typ:$funcType([],[$Int,BM,$Int],false)},{prop:"Year",name:"Year",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Month",name:"Month",pkg:"",typ:$funcType([],[BM],false)},{prop:"Day",name:"Day",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Weekday",name:"Weekday",pkg:"",typ:$funcType([],[BO],false)},{prop:"ISOWeek",name:"ISOWeek",pkg:"",typ:$funcType([],[$Int,$Int],false)},{prop:"Clock",name:"Clock",pkg:"",typ:$funcType([],[$Int,$Int,$Int],false)},{prop:"Hour",name:"Hour",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Minute",name:"Minute",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Second",name:"Second",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Nanosecond",name:"Nanosecond",pkg:"",typ:$funcType([],[$Int],false)},{prop:"YearDay",name:"YearDay",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Add",name:"Add",pkg:"",typ:$funcType([BS],[BL],false)},{prop:"Sub",name:"Sub",pkg:"",typ:$funcType([BL],[BS],false)},{prop:"AddDate",name:"AddDate",pkg:"",typ:$funcType([$Int,$Int,$Int],[BL],false)},{prop:"date",name:"date",pkg:"time",typ:$funcType([$Bool],[$Int,BM,$Int,$Int],false)},{prop:"UTC",name:"UTC",pkg:"",typ:$funcType([],[BL],false)},{prop:"Local",name:"Local",pkg:"",typ:$funcType([],[BL],false)},{prop:"In",name:"In",pkg:"",typ:$funcType([DJ],[BL],false)},{prop:"Location",name:"Location",pkg:"",typ:$funcType([],[DJ],false)},{prop:"Zone",name:"Zone",pkg:"",typ:$funcType([],[$String,$Int],false)},{prop:"Unix",name:"Unix",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"UnixNano",name:"UnixNano",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"MarshalBinary",name:"MarshalBinary",pkg:"",typ:$funcType([],[DG,$error],false)},{prop:"GobEncode",name:"GobEncode",pkg:"",typ:$funcType([],[DG,$error],false)},{prop:"MarshalJSON",name:"MarshalJSON",pkg:"",typ:$funcType([],[DG,$error],false)},{prop:"MarshalText",name:"MarshalText",pkg:"",typ:$funcType([],[DG,$error],false)},{prop:"Truncate",name:"Truncate",pkg:"",typ:$funcType([BS],[BL],false)},{prop:"Round",name:"Round",pkg:"",typ:$funcType([BS],[BL],false)}];DV.methods=[{prop:"UnmarshalBinary",name:"UnmarshalBinary",pkg:"",typ:$funcType([DG],[$error],false)},{prop:"GobDecode",name:"GobDecode",pkg:"",typ:$funcType([DG],[$error],false)},{prop:"UnmarshalJSON",name:"UnmarshalJSON",pkg:"",typ:$funcType([DG],[$error],false)},{prop:"UnmarshalText",name:"UnmarshalText",pkg:"",typ:$funcType([DG],[$error],false)}];BM.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];BO.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];BS.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Nanoseconds",name:"Nanoseconds",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"Seconds",name:"Seconds",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Minutes",name:"Minutes",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Hours",name:"Hours",pkg:"",typ:$funcType([],[$Float64],false)}];DJ.methods=[{prop:"get",name:"get",pkg:"time",typ:$funcType([],[DJ],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"lookup",name:"lookup",pkg:"time",typ:$funcType([$Int64],[$String,$Int,$Bool,$Int64,$Int64],false)},{prop:"lookupFirstZone",name:"lookupFirstZone",pkg:"time",typ:$funcType([],[$Int],false)},{prop:"firstZoneUsed",name:"firstZoneUsed",pkg:"time",typ:$funcType([],[$Bool],false)},{prop:"lookupName",name:"lookupName",pkg:"time",typ:$funcType([$String,$Int64],[$Int,$Bool,$Bool],false)}];AF.init([{prop:"Layout",name:"Layout",pkg:"",typ:$String,tag:""},{prop:"Value",name:"Value",pkg:"",typ:$String,tag:""},{prop:"LayoutElem",name:"LayoutElem",pkg:"",typ:$String,tag:""},{prop:"ValueElem",name:"ValueElem",pkg:"",typ:$String,tag:""},{prop:"Message",name:"Message",pkg:"",typ:$String,tag:""}]);BL.init([{prop:"sec",name:"sec",pkg:"time",typ:$Int64,tag:""},{prop:"nsec",name:"nsec",pkg:"time",typ:$Int32,tag:""},{prop:"loc",name:"loc",pkg:"time",typ:DJ,tag:""}]);CF.init([{prop:"name",name:"name",pkg:"time",typ:$String,tag:""},{prop:"zone",name:"zone",pkg:"time",typ:DA,tag:""},{prop:"tx",name:"tx",pkg:"time",typ:DB,tag:""},{prop:"cacheStart",name:"cacheStart",pkg:"time",typ:$Int64,tag:""},{prop:"cacheEnd",name:"cacheEnd",pkg:"time",typ:$Int64,tag:""},{prop:"cacheZone",name:"cacheZone",pkg:"time",typ:DC,tag:""}]);CG.init([{prop:"name",name:"name",pkg:"time",typ:$String,tag:""},{prop:"offset",name:"offset",pkg:"time",typ:$Int,tag:""},{prop:"isDST",name:"isDST",pkg:"time",typ:$Bool,tag:""}]);CH.init([{prop:"when",name:"when",pkg:"time",typ:$Int64,tag:""},{prop:"index",name:"index",pkg:"time",typ:$Uint8,tag:""},{prop:"isstd",name:"isstd",pkg:"time",typ:$Bool,tag:""},{prop:"isutc",name:"isutc",pkg:"time",typ:$Bool,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=D.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=F.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E.$init();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}CJ=new CF.ptr("",DA.nil,DB.nil,new $Int64(0,0),new $Int64(0,0),DC.nil);CK=new F.Once.ptr(false,false);R=$toNativeArray($kindInt,[260,265,524,526,528,274]);U=new DD(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]);V=new DD(["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);W=new DD(["---","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]);X=new DD(["---","January","February","March","April","May","June","July","August","September","October","November","December"]);AB=D.New("time: invalid number");AE=D.New("bad value for field");AR=D.New("time: bad [0-9]*");BN=$toNativeArray($kindString,["January","February","March","April","May","June","July","August","September","October","November","December"]);BP=$toNativeArray($kindString,["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]);AT=$makeMap($String.keyFor,[{k:"ns",v:new $Int64(0,1)},{k:"us",v:new $Int64(0,1000)},{k:"\xC2\xB5s",v:new $Int64(0,1000)},{k:"\xCE\xBCs",v:new $Int64(0,1000)},{k:"ms",v:new $Int64(0,1000000)},{k:"s",v:new $Int64(0,1000000000)},{k:"m",v:new $Int64(13,4165425152)},{k:"h",v:new $Int64(838,817405952)}]);BX=$toNativeArray($kindInt32,[0,31,59,90,120,151,181,212,243,273,304,334,365]);CI=new CF.ptr("UTC",DA.nil,DB.nil,new $Int64(0,0),new $Int64(0,0),DC.nil);$pkg.UTC=CI;$pkg.Local=CJ;l=E.Getenv("ZONEINFO");$s=7;case 7:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}k=l;CM=k[0];CQ=D.New("malformed time zone information");CW=new DD(["/usr/share/zoneinfo/","/usr/share/lib/zoneinfo/","/usr/lib/locale/TZ/",A.GOROOT()+"/lib/time/zoneinfo.zip"]);G();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["os"]=(function(){var $pkg={},$init,E,A,B,F,H,G,C,D,Z,AA,AS,BJ,BK,BM,CS,CT,CV,CX,CY,CZ,DA,DB,DC,DD,DE,DQ,DR,DS,DT,DZ,EA,AQ,AX,I,J,K,AB,AD,AG,AZ,BA,BC,BL,BN,BQ,BT,CE,CK,CL,CM;E=$packages["errors"];A=$packages["github.com/gopherjs/gopherjs/js"];B=$packages["io"];F=$packages["runtime"];H=$packages["sync"];G=$packages["sync/atomic"];C=$packages["syscall"];D=$packages["time"];Z=$pkg.PathError=$newType(0,$kindStruct,"os.PathError","PathError","os",function(Op_,Path_,Err_){this.$val=this;if(arguments.length===0){this.Op="";this.Path="";this.Err=$ifaceNil;return;}this.Op=Op_;this.Path=Path_;this.Err=Err_;});AA=$pkg.SyscallError=$newType(0,$kindStruct,"os.SyscallError","SyscallError","os",function(Syscall_,Err_){this.$val=this;if(arguments.length===0){this.Syscall="";this.Err=$ifaceNil;return;}this.Syscall=Syscall_;this.Err=Err_;});AS=$pkg.LinkError=$newType(0,$kindStruct,"os.LinkError","LinkError","os",function(Op_,Old_,New_,Err_){this.$val=this;if(arguments.length===0){this.Op="";this.Old="";this.New="";this.Err=$ifaceNil;return;}this.Op=Op_;this.Old=Old_;this.New=New_;this.Err=Err_;});BJ=$pkg.File=$newType(0,$kindStruct,"os.File","File","os",function(file_){this.$val=this;if(arguments.length===0){this.file=DQ.nil;return;}this.file=file_;});BK=$pkg.file=$newType(0,$kindStruct,"os.file","file","os",function(fd_,name_,dirinfo_){this.$val=this;if(arguments.length===0){this.fd=0;this.name="";this.dirinfo=CY.nil;return;}this.fd=fd_;this.name=name_;this.dirinfo=dirinfo_;});BM=$pkg.dirInfo=$newType(0,$kindStruct,"os.dirInfo","dirInfo","os",function(buf_,nbuf_,bufp_){this.$val=this;if(arguments.length===0){this.buf=CZ.nil;this.nbuf=0;this.bufp=0;return;}this.buf=buf_;this.nbuf=nbuf_;this.bufp=bufp_;});CS=$pkg.FileInfo=$newType(8,$kindInterface,"os.FileInfo","FileInfo","os",null);CT=$pkg.FileMode=$newType(4,$kindUint32,"os.FileMode","FileMode","os",null);CV=$pkg.fileStat=$newType(0,$kindStruct,"os.fileStat","fileStat","os",function(name_,size_,mode_,modTime_,sys_){this.$val=this;if(arguments.length===0){this.name="";this.size=new $Int64(0,0);this.mode=0;this.modTime=new D.Time.ptr(new $Int64(0,0),0,DS.nil);this.sys=new C.Stat_t.ptr(new $Uint64(0,0),new $Uint64(0,0),new $Uint64(0,0),0,0,0,0,new $Uint64(0,0),new $Int64(0,0),new $Int64(0,0),new $Int64(0,0),new C.Timespec.ptr(new $Int64(0,0),new $Int64(0,0)),new C.Timespec.ptr(new $Int64(0,0),new $Int64(0,0)),new C.Timespec.ptr(new $Int64(0,0),new $Int64(0,0)),DT.zero());return;}this.name=name_;this.size=size_;this.mode=mode_;this.modTime=modTime_;this.sys=sys_;});CX=$sliceType($String);CY=$ptrType(BM);CZ=$sliceType($Uint8);DA=$sliceType(CS);DB=$ptrType(BJ);DC=$ptrType(Z);DD=$ptrType(AS);DE=$ptrType(AA);DQ=$ptrType(BK);DR=$funcType([DQ],[$error],false);DS=$ptrType(D.Location);DT=$arrayType($Int64,3);DZ=$arrayType($Uint8,32);EA=$ptrType(CV);I=function(){var $ptr;return $pkg.Args;};J=function(){var $ptr,c,d,e;c=$global.process;if(!(c===undefined)){d=c.argv;$pkg.Args=$makeSlice(CX,($parseInt(d.length)-1>>0));e=0;while(true){if(!(e<($parseInt(d.length)-1>>0))){break;}((e<0||e>=$pkg.Args.$length)?$throwRuntimeError("index out of range"):$pkg.Args.$array[$pkg.Args.$offset+e]=$internalize(d[(e+1>>0)],$String));e=e+(1)>>0;}}if($pkg.Args.$length===0){$pkg.Args=new CX(["?"]);}};K=function(){var $ptr;};BJ.ptr.prototype.readdirnames=function(c){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;d=CX.nil;e=$ifaceNil;f=this;if(f.file.dirinfo===CY.nil){f.file.dirinfo=new BM.ptr(CZ.nil,0,0);f.file.dirinfo.buf=$makeSlice(CZ,4096);}g=f.file.dirinfo;h=c;if(h<=0){h=100;c=-1;}d=$makeSlice(CX,0,h);while(true){if(!(!((c===0)))){break;}if(g.bufp>=g.nbuf){g.bufp=0;i=$ifaceNil;k=C.ReadDirent(f.file.fd,g.buf);j=AZ(k[0],k[1]);g.nbuf=j[0];i=j[1];if(!($interfaceIsEqual(i,$ifaceNil))){l=d;m=AB("readdirent",i);d=l;e=m;return[d,e];}if(g.nbuf<=0){break;}}n=0;o=0;p=n;q=o;r=C.ParseDirent($subslice(g.buf,g.bufp,g.nbuf),c,d);p=r[0];q=r[1];d=r[2];g.bufp=g.bufp+(p)>>0;c=c-(q)>>0;}if(c>=0&&(d.$length===0)){s=d;t=B.EOF;d=s;e=t;return[d,e];}u=d;v=$ifaceNil;d=u;e=v;return[d,e];};BJ.prototype.readdirnames=function(c){return this.$val.readdirnames(c);};BJ.ptr.prototype.Readdir=function(c){var $ptr,c,d,e,f,g,h,i,j,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=DA.nil;e=$ifaceNil;f=this;if(f===DB.nil){g=DA.nil;h=$pkg.ErrInvalid;d=g;e=h;return[d,e];}j=f.readdir(c);$s=1;case 1:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}i=j;d=i[0];e=i[1];$s=2;case 2:return[d,e];}return;}if($f===undefined){$f={$blk:BJ.ptr.prototype.Readdir};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.$s=$s;$f.$r=$r;return $f;};BJ.prototype.Readdir=function(c){return this.$val.Readdir(c);};BJ.ptr.prototype.Readdirnames=function(c){var $ptr,c,d,e,f,g,h,i;d=CX.nil;e=$ifaceNil;f=this;if(f===DB.nil){g=CX.nil;h=$pkg.ErrInvalid;d=g;e=h;return[d,e];}i=f.readdirnames(c);d=i[0];e=i[1];return[d,e];};BJ.prototype.Readdirnames=function(c){return this.$val.Readdirnames(c);};Z.ptr.prototype.Error=function(){var $ptr,c,d,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=this;d=c.Err.Error();$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}$s=2;case 2:return c.Op+" "+c.Path+": "+d;}return;}if($f===undefined){$f={$blk:Z.ptr.prototype.Error};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.$s=$s;$f.$r=$r;return $f;};Z.prototype.Error=function(){return this.$val.Error();};AA.ptr.prototype.Error=function(){var $ptr,c,d,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=this;d=c.Err.Error();$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}$s=2;case 2:return c.Syscall+": "+d;}return;}if($f===undefined){$f={$blk:AA.ptr.prototype.Error};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.$s=$s;$f.$r=$r;return $f;};AA.prototype.Error=function(){return this.$val.Error();};AB=function(c,d){var $ptr,c,d;if($interfaceIsEqual(d,$ifaceNil)){return $ifaceNil;}return new AA.ptr(c,d);};$pkg.NewSyscallError=AB;AD=function(c){var $ptr,c;return AG(c);};$pkg.IsNotExist=AD;AG=function(c){var $ptr,c,d,e,f,g,h;d=c;if(d===$ifaceNil){e=d;return false;}else if($assertType(d,DC,true)[1]){f=d.$val;c=f.Err;}else if($assertType(d,DD,true)[1]){g=d.$val;c=g.Err;}else if($assertType(d,DE,true)[1]){h=d.$val;c=h.Err;}return $interfaceIsEqual(c,new C.Errno(2))||$interfaceIsEqual(c,$pkg.ErrNotExist);};BJ.ptr.prototype.Name=function(){var $ptr,c;c=this;return c.file.name;};BJ.prototype.Name=function(){return this.$val.Name();};AS.ptr.prototype.Error=function(){var $ptr,c,d,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=this;d=c.Err.Error();$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}$s=2;case 2:return c.Op+" "+c.Old+" "+c.New+": "+d;}return;}if($f===undefined){$f={$blk:AS.ptr.prototype.Error};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.$s=$s;$f.$r=$r;return $f;};AS.prototype.Error=function(){return this.$val.Error();};BJ.ptr.prototype.Read=function(c){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n;d=0;e=$ifaceNil;f=this;if(f===DB.nil){g=0;h=$pkg.ErrInvalid;d=g;e=h;return[d,e];}i=f.read(c);d=i[0];j=i[1];if((d===0)&&c.$length>0&&$interfaceIsEqual(j,$ifaceNil)){k=0;l=B.EOF;d=k;e=l;return[d,e];}if(!($interfaceIsEqual(j,$ifaceNil))){e=new Z.ptr("read",f.file.name,j);}m=d;n=e;d=m;e=n;return[d,e];};BJ.prototype.Read=function(c){return this.$val.Read(c);};BJ.ptr.prototype.ReadAt=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o;e=0;f=$ifaceNil;g=this;if(g===DB.nil){h=0;i=$pkg.ErrInvalid;e=h;f=i;return[e,f];}while(true){if(!(c.$length>0)){break;}j=g.pread(c,d);k=j[0];l=j[1];if((k===0)&&$interfaceIsEqual(l,$ifaceNil)){m=e;n=B.EOF;e=m;f=n;return[e,f];}if(!($interfaceIsEqual(l,$ifaceNil))){f=new Z.ptr("read",g.file.name,l);break;}e=e+(k)>>0;c=$subslice(c,k);d=(o=new $Int64(0,k),new $Int64(d.$high+o.$high,d.$low+o.$low));}return[e,f];};BJ.prototype.ReadAt=function(c,d){return this.$val.ReadAt(c,d);};BJ.ptr.prototype.Write=function(c){var $ptr,c,d,e,f,g,h,i,j,k,l;d=0;e=$ifaceNil;f=this;if(f===DB.nil){g=0;h=$pkg.ErrInvalid;d=g;e=h;return[d,e];}i=f.write(c);d=i[0];j=i[1];if(d<0){d=0;}if(!((d===c.$length))){e=B.ErrShortWrite;}BN(f,j);if(!($interfaceIsEqual(j,$ifaceNil))){e=new Z.ptr("write",f.file.name,j);}k=d;l=e;d=k;e=l;return[d,e];};BJ.prototype.Write=function(c){return this.$val.Write(c);};BJ.ptr.prototype.WriteAt=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k,l,m;e=0;f=$ifaceNil;g=this;if(g===DB.nil){h=0;i=$pkg.ErrInvalid;e=h;f=i;return[e,f];}while(true){if(!(c.$length>0)){break;}j=g.pwrite(c,d);k=j[0];l=j[1];if(!($interfaceIsEqual(l,$ifaceNil))){f=new Z.ptr("write",g.file.name,l);break;}e=e+(k)>>0;c=$subslice(c,k);d=(m=new $Int64(0,k),new $Int64(d.$high+m.$high,d.$low+m.$low));}return[e,f];};BJ.prototype.WriteAt=function(c,d){return this.$val.WriteAt(c,d);};BJ.ptr.prototype.Seek=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p;e=new $Int64(0,0);f=$ifaceNil;g=this;if(g===DB.nil){h=new $Int64(0,0);i=$pkg.ErrInvalid;e=h;f=i;return[e,f];}j=g.seek(c,d);k=j[0];l=j[1];if($interfaceIsEqual(l,$ifaceNil)&&!(g.file.dirinfo===CY.nil)&&!((k.$high===0&&k.$low===0))){l=new C.Errno(21);}if(!($interfaceIsEqual(l,$ifaceNil))){m=new $Int64(0,0);n=new Z.ptr("seek",g.file.name,l);e=m;f=n;return[e,f];}o=k;p=$ifaceNil;e=o;f=p;return[e,f];};BJ.prototype.Seek=function(c,d){return this.$val.Seek(c,d);};BJ.ptr.prototype.WriteString=function(c){var $ptr,c,d,e,f,g,h,i;d=0;e=$ifaceNil;f=this;if(f===DB.nil){g=0;h=$pkg.ErrInvalid;d=g;e=h;return[d,e];}i=f.Write(new CZ($stringToBytes(c)));d=i[0];e=i[1];return[d,e];};BJ.prototype.WriteString=function(c){return this.$val.WriteString(c);};BJ.ptr.prototype.Chdir=function(){var $ptr,c,d;c=this;if(c===DB.nil){return $pkg.ErrInvalid;}d=C.Fchdir(c.file.fd);if(!($interfaceIsEqual(d,$ifaceNil))){return new Z.ptr("chdir",c.file.name,d);}return $ifaceNil;};BJ.prototype.Chdir=function(){return this.$val.Chdir();};AZ=function(c,d){var $ptr,c,d;if(c<0){c=0;}return[c,d];};BA=function(){$throwRuntimeError("native function not implemented: os.sigpipe");};BC=function(c){var $ptr,c,d;d=0;d=(d|((new CT(c).Perm()>>>0)))>>>0;if(!((((c&8388608)>>>0)===0))){d=(d|(2048))>>>0;}if(!((((c&4194304)>>>0)===0))){d=(d|(1024))>>>0;}if(!((((c&1048576)>>>0)===0))){d=(d|(512))>>>0;}return d;};BJ.ptr.prototype.Chmod=function(c){var $ptr,c,d,e;d=this;if(d===DB.nil){return $pkg.ErrInvalid;}e=C.Fchmod(d.file.fd,BC(c));if(!($interfaceIsEqual(e,$ifaceNil))){return new Z.ptr("chmod",d.file.name,e);}return $ifaceNil;};BJ.prototype.Chmod=function(c){return this.$val.Chmod(c);};BJ.ptr.prototype.Chown=function(c,d){var $ptr,c,d,e,f;e=this;if(e===DB.nil){return $pkg.ErrInvalid;}f=C.Fchown(e.file.fd,c,d);if(!($interfaceIsEqual(f,$ifaceNil))){return new Z.ptr("chown",e.file.name,f);}return $ifaceNil;};BJ.prototype.Chown=function(c,d){return this.$val.Chown(c,d);};BJ.ptr.prototype.Truncate=function(c){var $ptr,c,d,e;d=this;if(d===DB.nil){return $pkg.ErrInvalid;}e=C.Ftruncate(d.file.fd,c);if(!($interfaceIsEqual(e,$ifaceNil))){return new Z.ptr("truncate",d.file.name,e);}return $ifaceNil;};BJ.prototype.Truncate=function(c){return this.$val.Truncate(c);};BJ.ptr.prototype.Sync=function(){var $ptr,c,d;c=this;if(c===DB.nil){return $pkg.ErrInvalid;}d=C.Fsync(c.file.fd);if(!($interfaceIsEqual(d,$ifaceNil))){return AB("fsync",d);}return $ifaceNil;};BJ.prototype.Sync=function(){return this.$val.Sync();};BJ.ptr.prototype.Fd=function(){var $ptr,c;c=this;if(c===DB.nil){return 4294967295;}return(c.file.fd>>>0);};BJ.prototype.Fd=function(){return this.$val.Fd();};BL=function(c,d){var $ptr,c,d,e,f;e=(c>>0);if(e<0){return DB.nil;}f=new BJ.ptr(new BK.ptr(e,d,CY.nil));F.SetFinalizer(f.file,new DR($methodExpr(DQ,"close")));return f;};$pkg.NewFile=BL;BN=function(c,d){var $ptr,c,d;if($interfaceIsEqual(d,new C.Errno(32))&&((c.file.fd===1)||(c.file.fd===2))){BA();}};BJ.ptr.prototype.Close=function(){var $ptr,c;c=this;if(c===DB.nil){return $pkg.ErrInvalid;}return c.file.close();};BJ.prototype.Close=function(){return this.$val.Close();};BK.ptr.prototype.close=function(){var $ptr,c,d,e;c=this;if(c===DQ.nil||c.fd<0){return new C.Errno(22);}d=$ifaceNil;e=C.Close(c.fd);if(!($interfaceIsEqual(e,$ifaceNil))){d=new Z.ptr("close",c.name,e);}c.fd=-1;F.SetFinalizer(c,$ifaceNil);return d;};BK.prototype.close=function(){return this.$val.close();};BJ.ptr.prototype.Stat=function(){var $ptr,c,d,e;c=this;if(c===DB.nil){return[$ifaceNil,$pkg.ErrInvalid];}d=new CV.ptr("",new $Int64(0,0),0,new D.Time.ptr(new $Int64(0,0),0,DS.nil),new C.Stat_t.ptr(new $Uint64(0,0),new $Uint64(0,0),new $Uint64(0,0),0,0,0,0,new $Uint64(0,0),new $Int64(0,0),new $Int64(0,0),new $Int64(0,0),new C.Timespec.ptr(new $Int64(0,0),new $Int64(0,0)),new C.Timespec.ptr(new $Int64(0,0),new $Int64(0,0)),new C.Timespec.ptr(new $Int64(0,0),new $Int64(0,0)),DT.zero()));e=C.Fstat(c.file.fd,d.sys);if(!($interfaceIsEqual(e,$ifaceNil))){return[$ifaceNil,new Z.ptr("stat",c.file.name,e)];}CL(d,c.file.name);return[d,$ifaceNil];};BJ.prototype.Stat=function(){return this.$val.Stat();};BQ=function(c){var $ptr,c,d,e;d=new CV.ptr("",new $Int64(0,0),0,new D.Time.ptr(new $Int64(0,0),0,DS.nil),new C.Stat_t.ptr(new $Uint64(0,0),new $Uint64(0,0),new $Uint64(0,0),0,0,0,0,new $Uint64(0,0),new $Int64(0,0),new $Int64(0,0),new $Int64(0,0),new C.Timespec.ptr(new $Int64(0,0),new $Int64(0,0)),new C.Timespec.ptr(new $Int64(0,0),new $Int64(0,0)),new C.Timespec.ptr(new $Int64(0,0),new $Int64(0,0)),DT.zero()));e=C.Lstat(c,d.sys);if(!($interfaceIsEqual(e,$ifaceNil))){return[$ifaceNil,new Z.ptr("lstat",c,e)];}CL(d,c);return[d,$ifaceNil];};$pkg.Lstat=BQ;BJ.ptr.prototype.readdir=function(c){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=DA.nil;e=$ifaceNil;f=this;g=f.file.name;if(g===""){g=".";}h=f.Readdirnames(c);i=h[0];e=h[1];d=$makeSlice(DA,0,i.$length);j=i;k=0;case 1:if(!(k=j.$length)?$throwRuntimeError("index out of range"):j.$array[j.$offset+k]);n=AX(g+"/"+l);$s=3;case 3:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}m=n;o=m[0];p=m[1];if(AD(p)){k++;$s=1;continue;}if(!($interfaceIsEqual(p,$ifaceNil))){q=d;r=p;d=q;e=r;return[d,e];}d=$append(d,o);k++;$s=1;continue;case 2:s=d;t=e;d=s;e=t;return[d,e];}return;}if($f===undefined){$f={$blk:BJ.ptr.prototype.readdir};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.$s=$s;$f.$r=$r;return $f;};BJ.prototype.readdir=function(c){return this.$val.readdir(c);};BJ.ptr.prototype.read=function(c){var $ptr,c,d,e,f,g,h;d=0;e=$ifaceNil;f=this;if(false&&c.$length>1073741824){c=$subslice(c,0,1073741824);}h=C.Read(f.file.fd,c);g=AZ(h[0],h[1]);d=g[0];e=g[1];return[d,e];};BJ.prototype.read=function(c){return this.$val.read(c);};BJ.ptr.prototype.pread=function(c,d){var $ptr,c,d,e,f,g,h,i;e=0;f=$ifaceNil;g=this;if(false&&c.$length>1073741824){c=$subslice(c,0,1073741824);}i=C.Pread(g.file.fd,c,d);h=AZ(i[0],i[1]);e=h[0];f=h[1];return[e,f];};BJ.prototype.pread=function(c,d){return this.$val.pread(c,d);};BJ.ptr.prototype.write=function(c){var $ptr,c,d,e,f,g,h,i,j,k,l,m;d=0;e=$ifaceNil;f=this;while(true){g=c;if(false&&g.$length>1073741824){g=$subslice(g,0,1073741824);}i=C.Write(f.file.fd,g);h=AZ(i[0],i[1]);j=h[0];k=h[1];d=d+(j)>>0;if(01073741824){c=$subslice(c,0,1073741824);}i=C.Pwrite(g.file.fd,c,d);h=AZ(i[0],i[1]);e=h[0];f=h[1];return[e,f];};BJ.prototype.pwrite=function(c,d){return this.$val.pwrite(c,d);};BJ.ptr.prototype.seek=function(c,d){var $ptr,c,d,e,f,g,h;e=new $Int64(0,0);f=$ifaceNil;g=this;h=C.Seek(g.file.fd,c,d);e=h[0];f=h[1];return[e,f];};BJ.prototype.seek=function(c,d){return this.$val.seek(c,d);};BT=function(c){var $ptr,c,d;d=c.length-1>>0;while(true){if(!(d>0&&(c.charCodeAt(d)===47))){break;}c=c.substring(0,d);d=d-(1)>>0;}d=d-(1)>>0;while(true){if(!(d>=0)){break;}if(c.charCodeAt(d)===47){c=c.substring((d+1>>0));break;}d=d-(1)>>0;}return c;};CE=function(){var $ptr;if(false){return;}$pkg.Args=I();};CK=function(c){var $ptr,c;if(c===0){K();}C.Exit(c);};$pkg.Exit=CK;CL=function(c,d){var $ptr,c,d,e;c.name=BT(d);c.size=c.sys.Size;D.Time.copy(c.modTime,CM(c.sys.Mtim));c.mode=(((c.sys.Mode&511)>>>0)>>>0);e=(c.sys.Mode&61440)>>>0;if(e===(24576)){c.mode=(c.mode|(67108864))>>>0;}else if(e===(8192)){c.mode=(c.mode|(69206016))>>>0;}else if(e===(16384)){c.mode=(c.mode|(2147483648))>>>0;}else if(e===(4096)){c.mode=(c.mode|(33554432))>>>0;}else if(e===(40960)){c.mode=(c.mode|(134217728))>>>0;}else if(e===(32768)){}else if(e===(49152)){c.mode=(c.mode|(16777216))>>>0;}if(!((((c.sys.Mode&1024)>>>0)===0))){c.mode=(c.mode|(4194304))>>>0;}if(!((((c.sys.Mode&2048)>>>0)===0))){c.mode=(c.mode|(8388608))>>>0;}if(!((((c.sys.Mode&512)>>>0)===0))){c.mode=(c.mode|(1048576))>>>0;}};CM=function(c){var $ptr,c;c=$clone(c,C.Timespec);return D.Unix(c.Sec,c.Nsec);};CT.prototype.String=function(){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;c=this.$val;d=DZ.zero();e=0;f="dalTLDpSugct";g=0;while(true){if(!(g>0)>>>0),k<32?(1<>>0)))>>>0)===0))){((e<0||e>=d.length)?$throwRuntimeError("index out of range"):d[e]=(j<<24>>>24));e=e+(1)>>0;}g+=h[1];}if(e===0){((e<0||e>=d.length)?$throwRuntimeError("index out of range"):d[e]=45);e=e+(1)>>0;}l="rwxrwxrwx";m=0;while(true){if(!(m>0)>>>0),q<32?(1<>>0)))>>>0)===0))){((e<0||e>=d.length)?$throwRuntimeError("index out of range"):d[e]=(p<<24>>>24));}else{((e<0||e>=d.length)?$throwRuntimeError("index out of range"):d[e]=45);}e=e+(1)>>0;m+=n[1];}return $bytesToString($subslice(new CZ(d),0,e));};$ptrType(CT).prototype.String=function(){return new CT(this.$get()).String();};CT.prototype.IsDir=function(){var $ptr,c;c=this.$val;return!((((c&2147483648)>>>0)===0));};$ptrType(CT).prototype.IsDir=function(){return new CT(this.$get()).IsDir();};CT.prototype.IsRegular=function(){var $ptr,c;c=this.$val;return((c&2399141888)>>>0)===0;};$ptrType(CT).prototype.IsRegular=function(){return new CT(this.$get()).IsRegular();};CT.prototype.Perm=function(){var $ptr,c;c=this.$val;return(c&511)>>>0;};$ptrType(CT).prototype.Perm=function(){return new CT(this.$get()).Perm();};CV.ptr.prototype.Name=function(){var $ptr,c;c=this;return c.name;};CV.prototype.Name=function(){return this.$val.Name();};CV.ptr.prototype.IsDir=function(){var $ptr,c;c=this;return new CT(c.Mode()).IsDir();};CV.prototype.IsDir=function(){return this.$val.IsDir();};CV.ptr.prototype.Size=function(){var $ptr,c;c=this;return c.size;};CV.prototype.Size=function(){return this.$val.Size();};CV.ptr.prototype.Mode=function(){var $ptr,c;c=this;return c.mode;};CV.prototype.Mode=function(){return this.$val.Mode();};CV.ptr.prototype.ModTime=function(){var $ptr,c;c=this;return c.modTime;};CV.prototype.ModTime=function(){return this.$val.ModTime();};CV.ptr.prototype.Sys=function(){var $ptr,c;c=this;return c.sys;};CV.prototype.Sys=function(){return this.$val.Sys();};DC.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];DE.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];DD.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];DB.methods=[{prop:"readdirnames",name:"readdirnames",pkg:"os",typ:$funcType([$Int],[CX,$error],false)},{prop:"Readdir",name:"Readdir",pkg:"",typ:$funcType([$Int],[DA,$error],false)},{prop:"Readdirnames",name:"Readdirnames",pkg:"",typ:$funcType([$Int],[CX,$error],false)},{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"Read",name:"Read",pkg:"",typ:$funcType([CZ],[$Int,$error],false)},{prop:"ReadAt",name:"ReadAt",pkg:"",typ:$funcType([CZ,$Int64],[$Int,$error],false)},{prop:"Write",name:"Write",pkg:"",typ:$funcType([CZ],[$Int,$error],false)},{prop:"WriteAt",name:"WriteAt",pkg:"",typ:$funcType([CZ,$Int64],[$Int,$error],false)},{prop:"Seek",name:"Seek",pkg:"",typ:$funcType([$Int64,$Int],[$Int64,$error],false)},{prop:"WriteString",name:"WriteString",pkg:"",typ:$funcType([$String],[$Int,$error],false)},{prop:"Chdir",name:"Chdir",pkg:"",typ:$funcType([],[$error],false)},{prop:"Chmod",name:"Chmod",pkg:"",typ:$funcType([CT],[$error],false)},{prop:"Chown",name:"Chown",pkg:"",typ:$funcType([$Int,$Int],[$error],false)},{prop:"Truncate",name:"Truncate",pkg:"",typ:$funcType([$Int64],[$error],false)},{prop:"Sync",name:"Sync",pkg:"",typ:$funcType([],[$error],false)},{prop:"Fd",name:"Fd",pkg:"",typ:$funcType([],[$Uintptr],false)},{prop:"Close",name:"Close",pkg:"",typ:$funcType([],[$error],false)},{prop:"Stat",name:"Stat",pkg:"",typ:$funcType([],[CS,$error],false)},{prop:"readdir",name:"readdir",pkg:"os",typ:$funcType([$Int],[DA,$error],false)},{prop:"read",name:"read",pkg:"os",typ:$funcType([CZ],[$Int,$error],false)},{prop:"pread",name:"pread",pkg:"os",typ:$funcType([CZ,$Int64],[$Int,$error],false)},{prop:"write",name:"write",pkg:"os",typ:$funcType([CZ],[$Int,$error],false)},{prop:"pwrite",name:"pwrite",pkg:"os",typ:$funcType([CZ,$Int64],[$Int,$error],false)},{prop:"seek",name:"seek",pkg:"os",typ:$funcType([$Int64,$Int],[$Int64,$error],false)}];DQ.methods=[{prop:"close",name:"close",pkg:"os",typ:$funcType([],[$error],false)}];CT.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"IsDir",name:"IsDir",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"IsRegular",name:"IsRegular",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Perm",name:"Perm",pkg:"",typ:$funcType([],[CT],false)}];EA.methods=[{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"IsDir",name:"IsDir",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"Mode",name:"Mode",pkg:"",typ:$funcType([],[CT],false)},{prop:"ModTime",name:"ModTime",pkg:"",typ:$funcType([],[D.Time],false)},{prop:"Sys",name:"Sys",pkg:"",typ:$funcType([],[$emptyInterface],false)}];Z.init([{prop:"Op",name:"Op",pkg:"",typ:$String,tag:""},{prop:"Path",name:"Path",pkg:"",typ:$String,tag:""},{prop:"Err",name:"Err",pkg:"",typ:$error,tag:""}]);AA.init([{prop:"Syscall",name:"Syscall",pkg:"",typ:$String,tag:""},{prop:"Err",name:"Err",pkg:"",typ:$error,tag:""}]);AS.init([{prop:"Op",name:"Op",pkg:"",typ:$String,tag:""},{prop:"Old",name:"Old",pkg:"",typ:$String,tag:""},{prop:"New",name:"New",pkg:"",typ:$String,tag:""},{prop:"Err",name:"Err",pkg:"",typ:$error,tag:""}]);BJ.init([{prop:"file",name:"",pkg:"os",typ:DQ,tag:""}]);BK.init([{prop:"fd",name:"fd",pkg:"os",typ:$Int,tag:""},{prop:"name",name:"name",pkg:"os",typ:$String,tag:""},{prop:"dirinfo",name:"dirinfo",pkg:"os",typ:CY,tag:""}]);BM.init([{prop:"buf",name:"buf",pkg:"os",typ:CZ,tag:""},{prop:"nbuf",name:"nbuf",pkg:"os",typ:$Int,tag:""},{prop:"bufp",name:"bufp",pkg:"os",typ:$Int,tag:""}]);CS.init([{prop:"IsDir",name:"IsDir",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"ModTime",name:"ModTime",pkg:"",typ:$funcType([],[D.Time],false)},{prop:"Mode",name:"Mode",pkg:"",typ:$funcType([],[CT],false)},{prop:"Name",name:"Name",pkg:"",typ:$funcType([],[$String],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"Sys",name:"Sys",pkg:"",typ:$funcType([],[$emptyInterface],false)}]);CV.init([{prop:"name",name:"name",pkg:"os",typ:$String,tag:""},{prop:"size",name:"size",pkg:"os",typ:$Int64,tag:""},{prop:"mode",name:"mode",pkg:"os",typ:CT,tag:""},{prop:"modTime",name:"modTime",pkg:"os",typ:D.Time,tag:""},{prop:"sys",name:"sys",pkg:"os",typ:C.Stat_t,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=E.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=F.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=H.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=G.$init();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.Args=CX.nil;$pkg.ErrInvalid=E.New("invalid argument");$pkg.ErrPermission=E.New("permission denied");$pkg.ErrExist=E.New("file already exists");$pkg.ErrNotExist=E.New("file does not exist");AQ=E.New("os: process already finished");$pkg.Stdin=BL((C.Stdin>>>0),"/dev/stdin");$pkg.Stdout=BL((C.Stdout>>>0),"/dev/stdout");$pkg.Stderr=BL((C.Stderr>>>0),"/dev/stderr");AX=BQ;J();CE();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["fmt"]=(function(){var $pkg={},$init,D,E,A,F,G,B,H,C,L,M,AF,AG,AH,AI,AJ,AK,BF,BG,BS,BT,BU,CG,CH,CI,CJ,CK,CL,CM,CN,CO,CR,DL,DM,I,J,N,O,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD,AE,AL,BA,BB,BC,BV,BZ,CB,CC,a,b,K,P,AM,AN,AP,AQ,AR,AU,AX,AY,AZ,BD,BE,BW,BX,CD;D=$packages["errors"];E=$packages["io"];A=$packages["math"];F=$packages["os"];G=$packages["reflect"];B=$packages["strconv"];H=$packages["sync"];C=$packages["unicode/utf8"];L=$pkg.fmtFlags=$newType(0,$kindStruct,"fmt.fmtFlags","fmtFlags","fmt",function(widPresent_,precPresent_,minus_,plus_,sharp_,space_,unicode_,uniQuote_,zero_,plusV_,sharpV_){this.$val=this;if(arguments.length===0){this.widPresent=false;this.precPresent=false;this.minus=false;this.plus=false;this.sharp=false;this.space=false;this.unicode=false;this.uniQuote=false;this.zero=false;this.plusV=false;this.sharpV=false;return;}this.widPresent=widPresent_;this.precPresent=precPresent_;this.minus=minus_;this.plus=plus_;this.sharp=sharp_;this.space=space_;this.unicode=unicode_;this.uniQuote=uniQuote_;this.zero=zero_;this.plusV=plusV_;this.sharpV=sharpV_;});M=$pkg.fmt=$newType(0,$kindStruct,"fmt.fmt","fmt","fmt",function(intbuf_,buf_,wid_,prec_,fmtFlags_){this.$val=this;if(arguments.length===0){this.intbuf=CK.zero();this.buf=CL.nil;this.wid=0;this.prec=0;this.fmtFlags=new L.ptr(false,false,false,false,false,false,false,false,false,false,false);return;}this.intbuf=intbuf_;this.buf=buf_;this.wid=wid_;this.prec=prec_;this.fmtFlags=fmtFlags_;});AF=$pkg.State=$newType(8,$kindInterface,"fmt.State","State","fmt",null);AG=$pkg.Formatter=$newType(8,$kindInterface,"fmt.Formatter","Formatter","fmt",null);AH=$pkg.Stringer=$newType(8,$kindInterface,"fmt.Stringer","Stringer","fmt",null);AI=$pkg.GoStringer=$newType(8,$kindInterface,"fmt.GoStringer","GoStringer","fmt",null);AJ=$pkg.buffer=$newType(12,$kindSlice,"fmt.buffer","buffer","fmt",null);AK=$pkg.pp=$newType(0,$kindStruct,"fmt.pp","pp","fmt",function(n_,panicking_,erroring_,buf_,arg_,value_,reordered_,goodArgNum_,runeBuf_,fmt_){this.$val=this;if(arguments.length===0){this.n=0;this.panicking=false;this.erroring=false;this.buf=AJ.nil;this.arg=$ifaceNil;this.value=new G.Value.ptr(CI.nil,0,0);this.reordered=false;this.goodArgNum=false;this.runeBuf=CJ.zero();this.fmt=new M.ptr(CK.zero(),CL.nil,0,0,new L.ptr(false,false,false,false,false,false,false,false,false,false,false));return;}this.n=n_;this.panicking=panicking_;this.erroring=erroring_;this.buf=buf_;this.arg=arg_;this.value=value_;this.reordered=reordered_;this.goodArgNum=goodArgNum_;this.runeBuf=runeBuf_;this.fmt=fmt_;});BF=$pkg.runeUnreader=$newType(8,$kindInterface,"fmt.runeUnreader","runeUnreader","fmt",null);BG=$pkg.ScanState=$newType(8,$kindInterface,"fmt.ScanState","ScanState","fmt",null);BS=$pkg.scanError=$newType(0,$kindStruct,"fmt.scanError","scanError","fmt",function(err_){this.$val=this;if(arguments.length===0){this.err=$ifaceNil;return;}this.err=err_;});BT=$pkg.ss=$newType(0,$kindStruct,"fmt.ss","ss","fmt",function(rr_,buf_,peekRune_,prevRune_,count_,atEOF_,ssave_){this.$val=this;if(arguments.length===0){this.rr=$ifaceNil;this.buf=AJ.nil;this.peekRune=0;this.prevRune=0;this.count=0;this.atEOF=false;this.ssave=new BU.ptr(false,false,false,0,0,0);return;}this.rr=rr_;this.buf=buf_;this.peekRune=peekRune_;this.prevRune=prevRune_;this.count=count_;this.atEOF=atEOF_;this.ssave=ssave_;});BU=$pkg.ssave=$newType(0,$kindStruct,"fmt.ssave","ssave","fmt",function(validSave_,nlIsEnd_,nlIsSpace_,argLimit_,limit_,maxWid_){this.$val=this;if(arguments.length===0){this.validSave=false;this.nlIsEnd=false;this.nlIsSpace=false;this.argLimit=0;this.limit=0;this.maxWid=0;return;}this.validSave=validSave_;this.nlIsEnd=nlIsEnd_;this.nlIsSpace=nlIsSpace_;this.argLimit=argLimit_;this.limit=limit_;this.maxWid=maxWid_;});CG=$sliceType($Uint8);CH=$sliceType($emptyInterface);CI=$ptrType(G.rtype);CJ=$arrayType($Uint8,4);CK=$arrayType($Uint8,65);CL=$ptrType(AJ);CM=$arrayType($Uint16,2);CN=$sliceType(CM);CO=$ptrType(AK);CR=$ptrType(BT);DL=$ptrType(M);DM=$funcType([$Int32],[$Bool],false);K=function(){var $ptr,c;c=0;while(true){if(!(c<65)){break;}((c<0||c>=I.$length)?$throwRuntimeError("index out of range"):I.$array[I.$offset+c]=48);((c<0||c>=J.$length)?$throwRuntimeError("index out of range"):J.$array[J.$offset+c]=32);c=c+(1)>>0;}};M.ptr.prototype.clearflags=function(){var $ptr,c;c=this;L.copy(c.fmtFlags,new L.ptr(false,false,false,false,false,false,false,false,false,false,false));};M.prototype.clearflags=function(){return this.$val.clearflags();};M.ptr.prototype.init=function(c){var $ptr,c,d;d=this;d.buf=c;d.clearflags();};M.prototype.init=function(c){return this.$val.init(c);};M.ptr.prototype.computePadding=function(c){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;d=CG.nil;e=0;f=0;g=this;h=!g.fmtFlags.minus;i=g.wid;if(i<0){h=false;i=-i;}i=i-(c)>>0;if(i>0){if(h&&g.fmtFlags.zero){j=I;k=i;l=0;d=j;e=k;f=l;return[d,e,f];}if(h){m=J;n=i;o=0;d=m;e=n;f=o;return[d,e,f];}else{p=J;q=0;r=i;d=p;e=q;f=r;return[d,e,f];}}return[d,e,f];};M.prototype.computePadding=function(c){return this.$val.computePadding(c);};M.ptr.prototype.writePadding=function(c,d){var $ptr,c,d,e,f;e=this;while(true){if(!(c>0)){break;}f=c;if(f>65){f=65;}e.buf.Write($subslice(d,0,f));c=c-(f)>>0;}};M.prototype.writePadding=function(c,d){return this.$val.writePadding(c,d);};M.ptr.prototype.pad=function(c){var $ptr,c,d,e,f,g,h;d=this;if(!d.fmtFlags.widPresent||(d.wid===0)){d.buf.Write(c);return;}e=d.computePadding(C.RuneCount(c));f=e[0];g=e[1];h=e[2];if(g>0){d.writePadding(g,f);}d.buf.Write(c);if(h>0){d.writePadding(h,f);}};M.prototype.pad=function(c){return this.$val.pad(c);};M.ptr.prototype.padString=function(c){var $ptr,c,d,e,f,g,h;d=this;if(!d.fmtFlags.widPresent||(d.wid===0)){d.buf.WriteString(c);return;}e=d.computePadding(C.RuneCountInString(c));f=e[0];g=e[1];h=e[2];if(g>0){d.writePadding(g,f);}d.buf.WriteString(c);if(h>0){d.writePadding(h,f);}};M.prototype.padString=function(c){return this.$val.padString(c);};M.ptr.prototype.fmt_boolean=function(c){var $ptr,c,d;d=this;if(c){d.pad(N);}else{d.pad(O);}};M.prototype.fmt_boolean=function(c){return this.$val.fmt_boolean(c);};M.ptr.prototype.integer=function(c,d,e,f){var $ptr,aa,ab,ac,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;g=this;if(g.fmtFlags.precPresent&&(g.prec===0)&&(c.$high===0&&c.$low===0)){return;}h=e&&(c.$high<0||(c.$high===0&&c.$low<0));if(h){c=new $Int64(-c.$high,-c.$low);}i=$subslice(new CG(g.intbuf),0);if(g.fmtFlags.widPresent||g.fmtFlags.precPresent||g.fmtFlags.plus||g.fmtFlags.space){j=g.wid+g.prec>>0;if((d.$high===0&&d.$low===16)&&g.fmtFlags.sharp){j=j+(2)>>0;}if(g.fmtFlags.unicode){j=j+(2)>>0;if(g.fmtFlags.uniQuote){j=j+(7)>>0;}}if(h||g.fmtFlags.plus||g.fmtFlags.space){j=j+(1)>>0;}if(j>65){i=$makeSlice(CG,j);}}k=0;if(g.fmtFlags.precPresent){k=g.prec;g.fmtFlags.zero=false;}else if(g.fmtFlags.zero&&g.fmtFlags.widPresent&&!g.fmtFlags.minus&&g.wid>0){k=g.wid;if(h||g.fmtFlags.plus||g.fmtFlags.space){k=k-(1)>>0;}}l=i.$length;m=new $Uint64(c.$high,c.$low);n=d;if((o=new $Uint64(0,10),(n.$high===o.$high&&n.$low===o.$low))){while(true){if(!((m.$high>0||(m.$high===0&&m.$low>=10)))){break;}l=l-(1)>>0;s=$div64(m,new $Uint64(0,10),false);((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=((t=new $Uint64(0+m.$high,48+m.$low),u=$mul64(s,new $Uint64(0,10)),new $Uint64(t.$high-u.$high,t.$low-u.$low)).$low<<24>>>24));m=s;}}else if((p=new $Uint64(0,16),(n.$high===p.$high&&n.$low===p.$low))){while(true){if(!((m.$high>0||(m.$high===0&&m.$low>=16)))){break;}l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=f.charCodeAt($flatten64(new $Uint64(m.$high&0,(m.$low&15)>>>0))));m=$shiftRightUint64(m,(4));}}else if((q=new $Uint64(0,8),(n.$high===q.$high&&n.$low===q.$low))){while(true){if(!((m.$high>0||(m.$high===0&&m.$low>=8)))){break;}l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=((v=new $Uint64(m.$high&0,(m.$low&7)>>>0),new $Uint64(0+v.$high,48+v.$low)).$low<<24>>>24));m=$shiftRightUint64(m,(3));}}else if((r=new $Uint64(0,2),(n.$high===r.$high&&n.$low===r.$low))){while(true){if(!((m.$high>0||(m.$high===0&&m.$low>=2)))){break;}l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=((w=new $Uint64(m.$high&0,(m.$low&1)>>>0),new $Uint64(0+w.$high,48+w.$low)).$low<<24>>>24));m=$shiftRightUint64(m,(1));}}else{$panic(new $String("fmt: unknown base; can't happen"));}l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=f.charCodeAt($flatten64(m)));while(true){if(!(l>0&&k>(i.$length-l>>0))){break;}l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=48);}if(g.fmtFlags.sharp){x=d;if((y=new $Uint64(0,8),(x.$high===y.$high&&x.$low===y.$low))){if(!((((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l])===48))){l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=48);}}else if((z=new $Uint64(0,16),(x.$high===z.$high&&x.$low===z.$low))){l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=((120+f.charCodeAt(10)<<24>>>24)-97<<24>>>24));l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=48);}}if(g.fmtFlags.unicode){l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=43);l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=85);}if(h){l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=45);}else if(g.fmtFlags.plus){l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=43);}else if(g.fmtFlags.space){l=l-(1)>>0;((l<0||l>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+l]=32);}if(g.fmtFlags.unicode&&g.fmtFlags.uniQuote&&(c.$high>0||(c.$high===0&&c.$low>=0))&&(c.$high<0||(c.$high===0&&c.$low<=1114111))&&B.IsPrint(((c.$low+((c.$high>>31)*4294967296))>>0))){aa=C.RuneLen(((c.$low+((c.$high>>31)*4294967296))>>0));ab=(2+aa>>0)+1>>0;$copySlice($subslice(i,(l-ab>>0)),$subslice(i,l));l=l-(ab)>>0;ac=i.$length-ab>>0;((ac<0||ac>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+ac]=32);ac=ac+(1)>>0;((ac<0||ac>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+ac]=39);ac=ac+(1)>>0;C.EncodeRune($subslice(i,ac),((c.$low+((c.$high>>31)*4294967296))>>0));ac=ac+(aa)>>0;((ac<0||ac>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+ac]=39);}g.pad($subslice(i,l));};M.prototype.integer=function(c,d,e,f){return this.$val.integer(c,d,e,f);};M.ptr.prototype.truncate=function(c){var $ptr,c,d,e,f,g,h,i;d=this;if(d.fmtFlags.precPresent&&d.prec>0;g+=h[1];}}return c;};M.prototype.truncate=function(c){return this.$val.truncate(c);};M.ptr.prototype.fmt_s=function(c){var $ptr,c,d;d=this;c=d.truncate(c);d.padString(c);};M.prototype.fmt_s=function(c){return this.$val.fmt_s(c);};M.ptr.prototype.fmt_sbx=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k;f=this;g=d.$length;if(d===CG.nil){g=c.length;}h=(e.charCodeAt(10)-97<<24>>>24)+120<<24>>>24;i=CG.nil;j=0;while(true){if(!(j0&&f.fmtFlags.space){i=$append(i,32);}if(f.fmtFlags.sharp&&(f.fmtFlags.space||(j===0))){i=$append(i,48,h);}k=0;if(d===CG.nil){k=c.charCodeAt(j);}else{k=((j<0||j>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+j]);}i=$append(i,e.charCodeAt((k>>>4<<24>>>24)),e.charCodeAt(((k&15)>>>0)));j=j+(1)>>0;}f.pad(i);};M.prototype.fmt_sbx=function(c,d,e){return this.$val.fmt_sbx(c,d,e);};M.ptr.prototype.fmt_sx=function(c,d){var $ptr,c,d,e;e=this;if(e.fmtFlags.precPresent&&e.prec>31)*4294967296))>>0));}else{e=B.AppendQuoteRune($subslice(new CG(d.intbuf),0,0),((c.$low+((c.$high>>31)*4294967296))>>0));}d.pad(e);};M.prototype.fmt_qc=function(c){return this.$val.fmt_qc(c);};P=function(c,d){var $ptr,c,d;if(c.fmtFlags.precPresent){return c.prec;}return d;};M.ptr.prototype.formatFloat=function(c,d,e,f){var $ptr,c,d,e,f,g,h,$deferred;var $err=null;try{$deferred=[];$deferred.index=$curGoroutine.deferStack.length;$curGoroutine.deferStack.push($deferred);g=this;h=B.AppendFloat($subslice(new CG(g.intbuf),0,1),c,d,e,f);if(((1>=h.$length?$throwRuntimeError("index out of range"):h.$array[h.$offset+1])===45)||((1>=h.$length?$throwRuntimeError("index out of range"):h.$array[h.$offset+1])===43)){h=$subslice(h,1);}else{(0>=h.$length?$throwRuntimeError("index out of range"):h.$array[h.$offset+0]=43);}if(A.IsInf(c,0)){if(g.fmtFlags.zero){$deferred.push([(function(){var $ptr;g.fmtFlags.zero=true;}),[]]);g.fmtFlags.zero=false;}}if(g.fmtFlags.zero&&g.fmtFlags.widPresent&&g.wid>h.$length){if(g.fmtFlags.space&&c>=0){g.buf.WriteByte(32);g.wid=g.wid-(1)>>0;}else if(g.fmtFlags.plus||c<0){g.buf.WriteByte((0>=h.$length?$throwRuntimeError("index out of range"):h.$array[h.$offset+0]));g.wid=g.wid-(1)>>0;}g.pad($subslice(h,1));return;}if(g.fmtFlags.space&&((0>=h.$length?$throwRuntimeError("index out of range"):h.$array[h.$offset+0])===43)){(0>=h.$length?$throwRuntimeError("index out of range"):h.$array[h.$offset+0]=32);g.pad(h);return;}if(g.fmtFlags.plus||((0>=h.$length?$throwRuntimeError("index out of range"):h.$array[h.$offset+0])===45)||A.IsInf(c,0)){g.pad(h);return;}g.pad($subslice(h,1));}catch(err){$err=err;}finally{$callDeferred($deferred,$err);}};M.prototype.formatFloat=function(c,d,e,f){return this.$val.formatFloat(c,d,e,f);};M.ptr.prototype.fmt_e64=function(c){var $ptr,c,d;d=this;d.formatFloat(c,101,P(d,6),64);};M.prototype.fmt_e64=function(c){return this.$val.fmt_e64(c);};M.ptr.prototype.fmt_E64=function(c){var $ptr,c,d;d=this;d.formatFloat(c,69,P(d,6),64);};M.prototype.fmt_E64=function(c){return this.$val.fmt_E64(c);};M.ptr.prototype.fmt_f64=function(c){var $ptr,c,d;d=this;d.formatFloat(c,102,P(d,6),64);};M.prototype.fmt_f64=function(c){return this.$val.fmt_f64(c);};M.ptr.prototype.fmt_g64=function(c){var $ptr,c,d;d=this;d.formatFloat(c,103,P(d,-1),64);};M.prototype.fmt_g64=function(c){return this.$val.fmt_g64(c);};M.ptr.prototype.fmt_G64=function(c){var $ptr,c,d;d=this;d.formatFloat(c,71,P(d,-1),64);};M.prototype.fmt_G64=function(c){return this.$val.fmt_G64(c);};M.ptr.prototype.fmt_fb64=function(c){var $ptr,c,d;d=this;d.formatFloat(c,98,0,64);};M.prototype.fmt_fb64=function(c){return this.$val.fmt_fb64(c);};M.ptr.prototype.fmt_e32=function(c){var $ptr,c,d;d=this;d.formatFloat(c,101,P(d,6),32);};M.prototype.fmt_e32=function(c){return this.$val.fmt_e32(c);};M.ptr.prototype.fmt_E32=function(c){var $ptr,c,d;d=this;d.formatFloat(c,69,P(d,6),32);};M.prototype.fmt_E32=function(c){return this.$val.fmt_E32(c);};M.ptr.prototype.fmt_f32=function(c){var $ptr,c,d;d=this;d.formatFloat(c,102,P(d,6),32);};M.prototype.fmt_f32=function(c){return this.$val.fmt_f32(c);};M.ptr.prototype.fmt_g32=function(c){var $ptr,c,d;d=this;d.formatFloat(c,103,P(d,-1),32);};M.prototype.fmt_g32=function(c){return this.$val.fmt_g32(c);};M.ptr.prototype.fmt_G32=function(c){var $ptr,c,d;d=this;d.formatFloat(c,71,P(d,-1),32);};M.prototype.fmt_G32=function(c){return this.$val.fmt_G32(c);};M.ptr.prototype.fmt_fb32=function(c){var $ptr,c,d;d=this;d.formatFloat(c,98,0,32);};M.prototype.fmt_fb32=function(c){return this.$val.fmt_fb32(c);};M.ptr.prototype.fmt_c64=function(c,d){var $ptr,c,d,e;e=this;e.fmt_complex(c.$real,c.$imag,32,d);};M.prototype.fmt_c64=function(c,d){return this.$val.fmt_c64(c,d);};M.ptr.prototype.fmt_c128=function(c,d){var $ptr,c,d,e;e=this;e.fmt_complex(c.$real,c.$imag,64,d);};M.prototype.fmt_c128=function(c,d){return this.$val.fmt_c128(c,d);};M.ptr.prototype.fmt_complex=function(c,d,e,f){var $ptr,c,d,e,f,g,h,i,j,k,l;g=this;g.buf.WriteByte(40);h=g.fmtFlags.plus;i=g.fmtFlags.space;j=g.wid;k=0;while(true){l=f;if(l===(98)){g.formatFloat(c,98,0,e);}else if(l===(101)){g.formatFloat(c,101,P(g,6),e);}else if(l===(69)){g.formatFloat(c,69,P(g,6),e);}else if((l===(102))||(l===(70))){g.formatFloat(c,102,P(g,6),e);}else if(l===(103)){g.formatFloat(c,103,P(g,-1),e);}else if(l===(71)){g.formatFloat(c,71,P(g,-1),e);}if(!((k===0))){break;}g.fmtFlags.plus=true;g.fmtFlags.space=false;g.wid=j;c=d;k=k+(1)>>0;}g.fmtFlags.space=i;g.fmtFlags.plus=h;g.wid=j;g.buf.Write(AA);};M.prototype.fmt_complex=function(c,d,e,f){return this.$val.fmt_complex(c,d,e,f);};$ptrType(AJ).prototype.Write=function(c){var $ptr,c,d,e,f,g,h;d=0;e=$ifaceNil;f=this;f.$set($appendSlice(f.$get(),c));g=c.$length;h=$ifaceNil;d=g;e=h;return[d,e];};$ptrType(AJ).prototype.WriteString=function(c){var $ptr,c,d,e,f,g,h;d=0;e=$ifaceNil;f=this;f.$set($appendSlice(f.$get(),c));g=c.length;h=$ifaceNil;d=g;e=h;return[d,e];};$ptrType(AJ).prototype.WriteByte=function(c){var $ptr,c,d;d=this;d.$set($append(d.$get(),c));return $ifaceNil;};$ptrType(AJ).prototype.WriteRune=function(c){var $ptr,c,d,e,f,g,h;d=this;if(c<128){d.$set($append(d.$get(),(c<<24>>>24)));return $ifaceNil;}e=d.$get();f=e.$length;while(true){if(!((f+4>>0)>e.$capacity)){break;}e=$append(e,0);}h=C.EncodeRune((g=$subslice(e,f,(f+4>>0)),$subslice(new CG(g.$array),g.$offset,g.$offset+g.$length)),c);d.$set($subslice(e,0,(f+h>>0)));return $ifaceNil;};AM=function(){var $ptr,c,d,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=AL.Get();$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=$assertType(c,CO);d.panicking=false;d.erroring=false;d.fmt.init((d.$ptr_buf||(d.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))));return d;}return;}if($f===undefined){$f={$blk:AM};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.$s=$s;$f.$r=$r;return $f;};AK.ptr.prototype.free=function(){var $ptr,c;c=this;if(c.buf.$capacity>1024){return;}c.buf=$subslice(c.buf,0,0);c.arg=$ifaceNil;c.value=new G.Value.ptr(CI.nil,0,0);AL.Put(c);};AK.prototype.free=function(){return this.$val.free();};AK.ptr.prototype.Width=function(){var $ptr,c,d,e,f,g;c=0;d=false;e=this;f=e.fmt.wid;g=e.fmt.fmtFlags.widPresent;c=f;d=g;return[c,d];};AK.prototype.Width=function(){return this.$val.Width();};AK.ptr.prototype.Precision=function(){var $ptr,c,d,e,f,g;c=0;d=false;e=this;f=e.fmt.prec;g=e.fmt.fmtFlags.precPresent;c=f;d=g;return[c,d];};AK.prototype.Precision=function(){return this.$val.Precision();};AK.ptr.prototype.Flag=function(c){var $ptr,c,d,e;d=this;e=c;if(e===(45)){return d.fmt.fmtFlags.minus;}else if(e===(43)){return d.fmt.fmtFlags.plus;}else if(e===(35)){return d.fmt.fmtFlags.sharp;}else if(e===(32)){return d.fmt.fmtFlags.space;}else if(e===(48)){return d.fmt.fmtFlags.zero;}return false;};AK.prototype.Flag=function(c){return this.$val.Flag(c);};AK.ptr.prototype.add=function(c){var $ptr,c,d;d=this;(d.$ptr_buf||(d.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).WriteRune(c);};AK.prototype.add=function(c){return this.$val.add(c);};AK.ptr.prototype.Write=function(c){var $ptr,c,d,e,f,g;d=0;e=$ifaceNil;f=this;g=(f.$ptr_buf||(f.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},f))).Write(c);d=g[0];e=g[1];return[d,e];};AK.prototype.Write=function(c){return this.$val.Write(c);};AN=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,l,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=0;g=$ifaceNil;h=AM();$s=1;case 1:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}i=h;$r=i.doPrintf(d,e);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}l=c.Write((k=i.buf,$subslice(new CG(k.$array),k.$offset,k.$offset+k.$length)));$s=3;case 3:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}j=l;f=j[0];g=j[1];i.free();return[f,g];}return;}if($f===undefined){$f={$blk:AN};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Fprintf=AN;AP=function(c,d){var $ptr,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=AM();$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=e;$r=f.doPrintf(c,d);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g=$bytesToString(f.buf);f.free();return g;}return;}if($f===undefined){$f={$blk:AP};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Sprintf=AP;AQ=function(c,d){var $ptr,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=AP(c,d);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=D.New(e);$s=2;case 2:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}$s=3;case 3:return f;}return;}if($f===undefined){$f={$blk:AQ};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Errorf=AQ;AR=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=0;f=$ifaceNil;g=AM();$s=1;case 1:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=g;$r=h.doPrint(d,false,false);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}k=c.Write((j=h.buf,$subslice(new CG(j.$array),j.$offset,j.$offset+j.$length)));$s=3;case 3:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}i=k;e=i[0];f=i[1];h.free();return[e,f];}return;}if($f===undefined){$f={$blk:AR};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Fprint=AR;AU=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=0;f=$ifaceNil;g=AM();$s=1;case 1:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=g;$r=h.doPrint(d,true,true);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}k=c.Write((j=h.buf,$subslice(new CG(j.$array),j.$offset,j.$offset+j.$length)));$s=3;case 3:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}i=k;e=i[0];f=i[1];h.free();return[e,f];}return;}if($f===undefined){$f={$blk:AU};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Fprintln=AU;AX=function(c,d){var $ptr,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=c;e=c.Field(d);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=e;if((f.Kind()===20)&&!f.IsNil()){$s=2;continue;}$s=3;continue;case 2:g=f.Elem();$s=4;case 4:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}f=g;case 3:return f;}return;}if($f===undefined){$f={$blk:AX};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};AY=function(c){var $ptr,c;return c>1000000||c<-1000000;};AZ=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n;f=0;g=false;h=0;if(d>=e){i=0;j=false;k=e;f=i;g=j;h=k;return[f,g,h];}h=d;while(true){if(!(h>>24)>>0)>>0;g=true;h=h+(1)>>0;}return[f,g,h];};AK.ptr.prototype.unknownType=function(c){var $ptr,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=c;d=this;if(!c.IsValid()){(d.$ptr_buf||(d.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).Write(R);return;}(d.$ptr_buf||(d.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).WriteByte(63);e=c.Type().String();$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=(d.$ptr_buf||(d.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).WriteString(e);$s=2;case 2:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}f;(d.$ptr_buf||(d.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).WriteByte(63);$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AK.ptr.prototype.unknownType};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AK.prototype.unknownType=function(c){return this.$val.unknownType(c);};AK.ptr.prototype.badVerb=function(c){var $ptr,c,d,e,f,g,h,i,j,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=this;d.erroring=true;d.add(37);d.add(33);d.add(c);d.add(40);if(!($interfaceIsEqual(d.arg,$ifaceNil))){$s=2;continue;}if(d.value.IsValid()){$s=3;continue;}$s=4;continue;case 2:e=G.TypeOf(d.arg).String();$s=6;case 6:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=(d.$ptr_buf||(d.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).WriteString(e);$s=7;case 7:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}f;d.add(61);g=d.printArg(d.arg,118,0);$s=8;case 8:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}g;$s=5;continue;case 3:h=d.value.Type().String();$s=9;case 9:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}i=(d.$ptr_buf||(d.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).WriteString(h);$s=10;case 10:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}i;d.add(61);j=d.printValue(d.value,118,0);$s=11;case 11:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}j;$s=5;continue;case 4:(d.$ptr_buf||(d.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).Write(R);case 5:case 1:d.add(41);d.erroring=false;$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AK.ptr.prototype.badVerb};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.$s=$s;$f.$r=$r;return $f;};AK.prototype.badVerb=function(c){return this.$val.badVerb(c);};AK.ptr.prototype.fmtBool=function(c,d){var $ptr,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=d;if((f===(116))||(f===(118))){$s=2;continue;}$s=3;continue;case 2:e.fmt.fmt_boolean(c);$s=4;continue;case 3:$r=e.badVerb(d);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 4:case 1:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AK.ptr.prototype.fmtBool};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AK.prototype.fmtBool=function(c,d){return this.$val.fmtBool(c,d);};AK.ptr.prototype.fmtC=function(c){var $ptr,c,d,e,f,g;d=this;e=((c.$low+((c.$high>>31)*4294967296))>>0);if(!((f=new $Int64(0,e),(f.$high===c.$high&&f.$low===c.$low)))){e=65533;}g=C.EncodeRune($subslice(new CG(d.runeBuf),0,4),e);d.fmt.pad($subslice(new CG(d.runeBuf),0,g));};AK.prototype.fmtC=function(c){return this.$val.fmtC(c);};AK.ptr.prototype.fmtInt64=function(c,d){var $ptr,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=d;if(f===(98)){$s=2;continue;}if(f===(99)){$s=3;continue;}if((f===(100))||(f===(118))){$s=4;continue;}if(f===(111)){$s=5;continue;}if(f===(113)){$s=6;continue;}if(f===(120)){$s=7;continue;}if(f===(85)){$s=8;continue;}if(f===(88)){$s=9;continue;}$s=10;continue;case 2:e.fmt.integer(c,new $Uint64(0,2),true,"0123456789abcdef");$s=11;continue;case 3:e.fmtC(c);$s=11;continue;case 4:e.fmt.integer(c,new $Uint64(0,10),true,"0123456789abcdef");$s=11;continue;case 5:e.fmt.integer(c,new $Uint64(0,8),true,"0123456789abcdef");$s=11;continue;case 6:if((0=l.$length)?$throwRuntimeError("index out of range"):l.$array[l.$offset+m]);if(n>0){if(g.fmt.fmtFlags.sharpV){(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).Write(Q);}else{(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(32);}}p=g.printArg(new $Uint8(o),118,f+1>>0);$s=20;case 20:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}p;m++;$s=18;continue;case 19:if(g.fmt.fmtFlags.sharpV){(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(125);}else{(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(93);}return;case 2:q=d;if(q===(115)){$s=22;continue;}if(q===(120)){$s=23;continue;}if(q===(88)){$s=24;continue;}if(q===(113)){$s=25;continue;}$s=26;continue;case 22:g.fmt.fmt_s($bytesToString(c));$s=27;continue;case 23:g.fmt.fmt_bx(c,"0123456789abcdef");$s=27;continue;case 24:g.fmt.fmt_bx(c,"0123456789ABCDEF");$s=27;continue;case 25:g.fmt.fmt_q($bytesToString(c));$s=27;continue;case 26:$r=g.badVerb(d);$s=28;case 28:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 27:case 21:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AK.ptr.prototype.fmtBytes};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.$s=$s;$f.$r=$r;return $f;};AK.prototype.fmtBytes=function(c,d,e,f){return this.$val.fmtBytes(c,d,e,f);};AK.ptr.prototype.fmtPointer=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=c;e=this;f=true;g=d;if((g===(112))||(g===(118))){$s=2;continue;}if((g===(98))||(g===(100))||(g===(111))||(g===(120))||(g===(88))){$s=3;continue;}$s=4;continue;case 2:$s=5;continue;case 3:f=false;$s=5;continue;case 4:$r=e.badVerb(d);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return;case 5:case 1:h=0;i=c.Kind();if((i===(18))||(i===(19))||(i===(21))||(i===(22))||(i===(23))||(i===(26))){$s=8;continue;}$s=9;continue;case 8:h=c.Pointer();$s=10;continue;case 9:$r=e.badVerb(d);$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return;case 10:case 7:if(e.fmt.fmtFlags.sharpV){$s=12;continue;}if((d===118)&&(h===0)){$s=13;continue;}$s=14;continue;case 12:e.add(40);j=c.Type().String();$s=16;case 16:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}k=(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).WriteString(j);$s=17;case 17:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}k;e.add(41);e.add(40);if(h===0){(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(T);}else{e.fmt0x64(new $Uint64(0,h.constructor===Number?h:1),true);}e.add(41);$s=15;continue;case 13:(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(R);$s=15;continue;case 14:if(f){$s=18;continue;}$s=19;continue;case 18:e.fmt0x64(new $Uint64(0,h.constructor===Number?h:1),!e.fmt.fmtFlags.sharp);$s=20;continue;case 19:$r=e.fmtUint64(new $Uint64(0,h.constructor===Number?h:1),d);$s=21;case 21:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 20:case 15:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AK.ptr.prototype.fmtPointer};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.$s=$s;$f.$r=$r;return $f;};AK.prototype.fmtPointer=function(c,d){return this.$val.fmtPointer(c,d);};AK.ptr.prototype.catchPanic=function(c,d){var $ptr,c,d,e,f,g,h,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=$recover();if(!($interfaceIsEqual(f,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:g=G.ValueOf(c);$s=3;case 3:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=g;if((h.Kind()===22)&&h.IsNil()){(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(R);return;}if(e.panicking){$panic(f);}e.fmt.clearflags();(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(V);e.add(d);(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(Y);e.panicking=true;i=e.printArg(f,118,0);$s=4;case 4:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}i;e.panicking=false;(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).WriteByte(41);case 2:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AK.ptr.prototype.catchPanic};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};AK.prototype.catchPanic=function(c,d){return this.$val.catchPanic(c,d);};AK.ptr.prototype.clearSpecialFlags=function(){var $ptr,c,d,e;c=false;d=false;e=this;c=e.fmt.fmtFlags.plusV;if(c){e.fmt.fmtFlags.plus=true;e.fmt.fmtFlags.plusV=false;}d=e.fmt.fmtFlags.sharpV;if(d){e.fmt.fmtFlags.sharp=true;e.fmt.fmtFlags.sharpV=false;}return[c,d];};AK.prototype.clearSpecialFlags=function(){return this.$val.clearSpecialFlags();};AK.ptr.prototype.restoreSpecialFlags=function(c,d){var $ptr,c,d,e;e=this;if(c){e.fmt.fmtFlags.plus=false;e.fmt.fmtFlags.plusV=true;}if(d){e.fmt.fmtFlags.sharp=false;e.fmt.fmtFlags.sharpV=true;}};AK.prototype.restoreSpecialFlags=function(c,d){return this.$val.restoreSpecialFlags(c,d);};AK.ptr.prototype.handleMethods=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,$s,$deferred,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;$s=$f.$s;$deferred=$f.$deferred;$r=$f.$r;}var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$deferred.index=$curGoroutine.deferStack.length;$curGoroutine.deferStack.push($deferred);e=false;f=this;if(f.erroring){return e;}g=$assertType(f.arg,AG,true);h=g[0];i=g[1];if(i){$s=1;continue;}$s=2;continue;case 1:e=true;j=f.clearSpecialFlags();$deferred.push([$methodVal(f,"restoreSpecialFlags"),[j[0],j[1]]]);$deferred.push([$methodVal(f,"catchPanic"),[f.arg,c]]);$r=h.Format(f,c);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return e;case 2:if(f.fmt.fmtFlags.sharpV){$s=4;continue;}$s=5;continue;case 4:k=$assertType(f.arg,AI,true);l=k[0];m=k[1];if(m){$s=7;continue;}$s=8;continue;case 7:e=true;$deferred.push([$methodVal(f,"catchPanic"),[f.arg,c]]);n=l.GoString();$s=9;case 9:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}$r=f.fmt.fmt_s(n);$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return e;case 8:$s=6;continue;case 5:o=c;if((o===(118))||(o===(115))||(o===(120))||(o===(88))||(o===(113))){$s=12;continue;}$s=13;continue;case 12:p=f.arg;if($assertType(p,$error,true)[1]){$s=14;continue;}if($assertType(p,AH,true)[1]){$s=15;continue;}$s=16;continue;case 14:q=p;e=true;$deferred.push([$methodVal(f,"catchPanic"),[f.arg,c]]);s=q.Error();$s=17;case 17:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}t=f.printArg(new $String(s),c,d);$s=18;case 18:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}t;return e;case 15:r=p;e=true;$deferred.push([$methodVal(f,"catchPanic"),[f.arg,c]]);u=r.String();$s=19;case 19:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}v=f.printArg(new $String(u),c,d);$s=20;case 20:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}v;return e;case 16:case 13:case 11:case 6:e=false;return e;}return;}}catch(err){$err=err;$s=-1;}finally{$callDeferred($deferred,$err);if(!$curGoroutine.asleep){return e;}if($curGoroutine.asleep){if($f===undefined){$f={$blk:AK.ptr.prototype.handleMethods};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.$s=$s;$f.$deferred=$deferred;$f.$r=$r;return $f;}}};AK.prototype.handleMethods=function(c,d){return this.$val.handleMethods(c,d);};AK.ptr.prototype.printArg=function(c,d,e){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=false;g=this;g.arg=c;g.value=new G.Value.ptr(CI.nil,0,0);if($interfaceIsEqual(c,$ifaceNil)){$s=1;continue;}$s=2;continue;case 1:if((d===84)||(d===118)){$s=3;continue;}$s=4;continue;case 3:g.fmt.pad(R);$s=5;continue;case 4:$r=g.badVerb(d);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 5:f=false;return f;case 2:h=d;if(h===(84)){$s=8;continue;}if(h===(112)){$s=9;continue;}$s=10;continue;case 8:i=G.TypeOf(c).String();$s=11;case 11:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}j=g.printArg(new $String(i),115,0);$s=12;case 12:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}j;f=false;return f;case 9:k=G.ValueOf(c);$s=13;case 13:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}$r=g.fmtPointer(k,d);$s=14;case 14:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}f=false;return f;case 10:case 7:l=c;if($assertType(l,$Bool,true)[1]){$s=15;continue;}if($assertType(l,$Float32,true)[1]){$s=16;continue;}if($assertType(l,$Float64,true)[1]){$s=17;continue;}if($assertType(l,$Complex64,true)[1]){$s=18;continue;}if($assertType(l,$Complex128,true)[1]){$s=19;continue;}if($assertType(l,$Int,true)[1]){$s=20;continue;}if($assertType(l,$Int8,true)[1]){$s=21;continue;}if($assertType(l,$Int16,true)[1]){$s=22;continue;}if($assertType(l,$Int32,true)[1]){$s=23;continue;}if($assertType(l,$Int64,true)[1]){$s=24;continue;}if($assertType(l,$Uint,true)[1]){$s=25;continue;}if($assertType(l,$Uint8,true)[1]){$s=26;continue;}if($assertType(l,$Uint16,true)[1]){$s=27;continue;}if($assertType(l,$Uint32,true)[1]){$s=28;continue;}if($assertType(l,$Uint64,true)[1]){$s=29;continue;}if($assertType(l,$Uintptr,true)[1]){$s=30;continue;}if($assertType(l,$String,true)[1]){$s=31;continue;}if($assertType(l,CG,true)[1]){$s=32;continue;}if($assertType(l,G.Value,true)[1]){$s=33;continue;}$s=34;continue;case 15:m=l.$val;$r=g.fmtBool(m,d);$s=36;case 36:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 16:n=l.$val;$r=g.fmtFloat32(n,d);$s=37;case 37:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 17:o=l.$val;$r=g.fmtFloat64(o,d);$s=38;case 38:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 18:p=l.$val;$r=g.fmtComplex64(p,d);$s=39;case 39:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 19:q=l.$val;$r=g.fmtComplex128(q,d);$s=40;case 40:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 20:r=l.$val;$r=g.fmtInt64(new $Int64(0,r),d);$s=41;case 41:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 21:s=l.$val;$r=g.fmtInt64(new $Int64(0,s),d);$s=42;case 42:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 22:t=l.$val;$r=g.fmtInt64(new $Int64(0,t),d);$s=43;case 43:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 23:u=l.$val;$r=g.fmtInt64(new $Int64(0,u),d);$s=44;case 44:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 24:v=l.$val;$r=g.fmtInt64(v,d);$s=45;case 45:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 25:w=l.$val;$r=g.fmtUint64(new $Uint64(0,w),d);$s=46;case 46:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 26:x=l.$val;$r=g.fmtUint64(new $Uint64(0,x),d);$s=47;case 47:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 27:y=l.$val;$r=g.fmtUint64(new $Uint64(0,y),d);$s=48;case 48:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 28:z=l.$val;$r=g.fmtUint64(new $Uint64(0,z),d);$s=49;case 49:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 29:aa=l.$val;$r=g.fmtUint64(aa,d);$s=50;case 50:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 30:ab=l.$val;$r=g.fmtUint64(new $Uint64(0,ab.constructor===Number?ab:1),d);$s=51;case 51:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=35;continue;case 31:ac=l.$val;$r=g.fmtString(ac,d);$s=52;case 52:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}f=(d===115)||(d===118);$s=35;continue;case 32:ad=l.$val;$r=g.fmtBytes(ad,d,$ifaceNil,e);$s=53;case 53:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}f=d===115;$s=35;continue;case 33:ae=l.$val;ag=g.printReflectValue(ae,d,e);$s=54;case 54:if($c){$c=false;ag=ag.$blk();}if(ag&&ag.$blk!==undefined){break s;}f=ag;$s=55;case 55:return f;case 34:af=l;ah=g.handleMethods(d,e);$s=56;case 56:if($c){$c=false;ah=ah.$blk();}if(ah&&ah.$blk!==undefined){break s;}ai=ah;if(ai){f=false;return f;}aj=G.ValueOf(c);$s=57;case 57:if($c){$c=false;aj=aj.$blk();}if(aj&&aj.$blk!==undefined){break s;}ak=g.printReflectValue(aj,d,e);$s=58;case 58:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}f=ak;$s=59;case 59:return f;case 35:g.arg=$ifaceNil;return f;}return;}if($f===undefined){$f={$blk:AK.ptr.prototype.printArg};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};AK.prototype.printArg=function(c,d,e){return this.$val.printArg(c,d,e);};AK.ptr.prototype.printValue=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=false;c=c;g=this;if(!c.IsValid()){$s=1;continue;}$s=2;continue;case 1:if((d===84)||(d===118)){$s=3;continue;}$s=4;continue;case 3:(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).Write(R);$s=5;continue;case 4:$r=g.badVerb(d);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 5:f=false;return f;case 2:h=d;if(h===(84)){$s=8;continue;}if(h===(112)){$s=9;continue;}$s=10;continue;case 8:i=c.Type().String();$s=11;case 11:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}j=g.printArg(new $String(i),115,0);$s=12;case 12:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}j;f=false;return f;case 9:$r=g.fmtPointer(c,d);$s=13;case 13:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}f=false;return f;case 10:case 7:g.arg=$ifaceNil;if(c.CanInterface()){$s=14;continue;}$s=15;continue;case 14:k=c.Interface();$s=16;case 16:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}g.arg=k;case 15:l=g.handleMethods(d,e);$s=17;case 17:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}m=l;if(m){f=false;return f;}n=g.printReflectValue(c,d,e);$s=18;case 18:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}f=n;$s=19;case 19:return f;}return;}if($f===undefined){$f={$blk:AK.ptr.prototype.printValue};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.$s=$s;$f.$r=$r;return $f;};AK.prototype.printValue=function(c,d,e){return this.$val.printValue(c,d,e);};AK.ptr.prototype.printReflectValue=function(c,d,e){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;ax=$f.ax;ay=$f.ay;az=$f.az;ba=$f.ba;bb=$f.bb;bc=$f.bc;bd=$f.bd;be=$f.be;bf=$f.bf;bg=$f.bg;bh=$f.bh;bi=$f.bi;bj=$f.bj;bk=$f.bk;bl=$f.bl;bm=$f.bm;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=false;c=c;g=this;h=g.value;g.value=c;i=c;j=i.Kind();if(j===(0)){$s=2;continue;}if(j===(1)){$s=3;continue;}if((j===(2))||(j===(3))||(j===(4))||(j===(5))||(j===(6))){$s=4;continue;}if((j===(7))||(j===(8))||(j===(9))||(j===(10))||(j===(11))||(j===(12))){$s=5;continue;}if((j===(13))||(j===(14))){$s=6;continue;}if((j===(15))||(j===(16))){$s=7;continue;}if(j===(24)){$s=8;continue;}if(j===(21)){$s=9;continue;}if(j===(25)){$s=10;continue;}if(j===(20)){$s=11;continue;}if((j===(17))||(j===(23))){$s=12;continue;}if(j===(22)){$s=13;continue;}if((j===(18))||(j===(19))||(j===(26))){$s=14;continue;}$s=15;continue;case 2:(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteString("");$s=16;continue;case 3:$r=g.fmtBool(i.Bool(),d);$s=17;case 17:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=16;continue;case 4:$r=g.fmtInt64(i.Int(),d);$s=18;case 18:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=16;continue;case 5:$r=g.fmtUint64(i.Uint(),d);$s=19;case 19:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=16;continue;case 6:k=i.Type().Size();$s=23;case 23:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}if(k===4){$s=20;continue;}$s=21;continue;case 20:$r=g.fmtFloat32($fround(i.Float()),d);$s=24;case 24:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=22;continue;case 21:$r=g.fmtFloat64(i.Float(),d);$s=25;case 25:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 22:$s=16;continue;case 7:l=i.Type().Size();$s=29;case 29:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}if(l===8){$s=26;continue;}$s=27;continue;case 26:$r=g.fmtComplex64((m=i.Complex(),new $Complex64(m.$real,m.$imag)),d);$s=30;case 30:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=28;continue;case 27:$r=g.fmtComplex128(i.Complex(),d);$s=31;case 31:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 28:$s=16;continue;case 8:n=i.String();$s=32;case 32:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}$r=g.fmtString(n,d);$s=33;case 33:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=16;continue;case 9:if(g.fmt.fmtFlags.sharpV){$s=34;continue;}$s=35;continue;case 34:o=i.Type().String();$s=37;case 37:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}p=(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteString(o);$s=38;case 38:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}p;if(i.IsNil()){(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteString("(nil)");$s=1;continue;}(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(123);$s=36;continue;case 35:(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).Write(U);case 36:q=i.MapKeys();$s=39;case 39:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=q;s=r;t=0;case 40:if(!(t=s.$length)?$throwRuntimeError("index out of range"):s.$array[s.$offset+t]);if(u>0){if(g.fmt.fmtFlags.sharpV){(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).Write(Q);}else{(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(32);}}w=g.printValue(v,d,e+1>>0);$s=42;case 42:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}w;(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(58);x=i.MapIndex(v);$s=43;case 43:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}y=g.printValue(x,d,e+1>>0);$s=44;case 44:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}y;t++;$s=40;continue;case 41:if(g.fmt.fmtFlags.sharpV){(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(125);}else{(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(93);}$s=16;continue;case 10:if(g.fmt.fmtFlags.sharpV){$s=45;continue;}$s=46;continue;case 45:z=c.Type().String();$s=47;case 47:if($c){$c=false;z=z.$blk();}if(z&&z.$blk!==undefined){break s;}aa=(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteString(z);$s=48;case 48:if($c){$c=false;aa=aa.$blk();}if(aa&&aa.$blk!==undefined){break s;}aa;case 46:g.add(123);ab=i;ac=ab.Type();ad=0;case 49:if(!(ad0){if(g.fmt.fmtFlags.sharpV){(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).Write(Q);}else{(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(32);}}if(g.fmt.fmtFlags.plusV||g.fmt.fmtFlags.sharpV){$s=51;continue;}$s=52;continue;case 51:ae=ac.Field(ad);$s=53;case 53:if($c){$c=false;ae=ae.$blk();}if(ae&&ae.$blk!==undefined){break s;}af=$clone(ae,G.StructField);if(!(af.Name==="")){(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteString(af.Name);(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(58);}case 52:ag=AX(ab,ad);$s=54;case 54:if($c){$c=false;ag=ag.$blk();}if(ag&&ag.$blk!==undefined){break s;}ah=g.printValue(ag,d,e+1>>0);$s=55;case 55:if($c){$c=false;ah=ah.$blk();}if(ah&&ah.$blk!==undefined){break s;}ah;ad=ad+(1)>>0;$s=49;continue;case 50:(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(125);$s=16;continue;case 11:ai=i.Elem();$s=56;case 56:if($c){$c=false;ai=ai.$blk();}if(ai&&ai.$blk!==undefined){break s;}aj=ai;if(!aj.IsValid()){$s=57;continue;}$s=58;continue;case 57:if(g.fmt.fmtFlags.sharpV){$s=60;continue;}$s=61;continue;case 60:ak=i.Type().String();$s=63;case 63:if($c){$c=false;ak=ak.$blk();}if(ak&&ak.$blk!==undefined){break s;}al=(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteString(ak);$s=64;case 64:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}al;(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).Write(S);$s=62;continue;case 61:(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).Write(R);case 62:$s=59;continue;case 58:am=g.printValue(aj,d,e+1>>0);$s=65;case 65:if($c){$c=false;am=am.$blk();}if(am&&am.$blk!==undefined){break s;}f=am;case 59:$s=16;continue;case 12:an=i.Type();ap=an.Elem();$s=69;case 69:if($c){$c=false;ap=ap.$blk();}if(ap&&ap.$blk!==undefined){break s;}aq=ap.Kind();$s=70;case 70:if($c){$c=false;aq=aq.$blk();}if(aq&&aq.$blk!==undefined){break s;}if(!(aq===8)){ao=false;$s=68;continue s;}ar=an.Elem();$s=71;case 71:if($c){$c=false;ar=ar.$blk();}if(ar&&ar.$blk!==undefined){break s;}ao=$interfaceIsEqual(ar,BC)||(d===115)||(d===113)||(d===120);case 68:if(ao){$s=66;continue;}$s=67;continue;case 66:as=CG.nil;if(i.Kind()===23){$s=72;continue;}if(i.CanAddr()){$s=73;continue;}$s=74;continue;case 72:at=i.Bytes();$s=76;case 76:if($c){$c=false;at=at.$blk();}if(at&&at.$blk!==undefined){break s;}as=at;$s=75;continue;case 73:au=i.Slice(0,i.Len());$s=77;case 77:if($c){$c=false;au=au.$blk();}if(au&&au.$blk!==undefined){break s;}av=au.Bytes();$s=78;case 78:if($c){$c=false;av=av.$blk();}if(av&&av.$blk!==undefined){break s;}as=av;$s=75;continue;case 74:as=$makeSlice(CG,i.Len());aw=as;ax=0;case 79:if(!(ax=as.$length)?$throwRuntimeError("index out of range"):as.$array[as.$offset+ay]=(ba.$low<<24>>>24));ax++;$s=79;continue;case 80:case 75:$r=g.fmtBytes(as,d,an,e);$s=83;case 83:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}f=d===115;$s=1;continue;case 67:if(g.fmt.fmtFlags.sharpV){$s=84;continue;}$s=85;continue;case 84:bb=c.Type().String();$s=87;case 87:if($c){$c=false;bb=bb.$blk();}if(bb&&bb.$blk!==undefined){break s;}bc=(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteString(bb);$s=88;case 88:if($c){$c=false;bc=bc.$blk();}if(bc&&bc.$blk!==undefined){break s;}bc;if((i.Kind()===23)&&i.IsNil()){(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteString("(nil)");$s=1;continue;}(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(123);$s=86;continue;case 85:(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(91);case 86:bd=0;case 89:if(!(bd0){if(g.fmt.fmtFlags.sharpV){(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).Write(Q);}else{(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(32);}}be=i.Index(bd);$s=91;case 91:if($c){$c=false;be=be.$blk();}if(be&&be.$blk!==undefined){break s;}bf=g.printValue(be,d,e+1>>0);$s=92;case 92:if($c){$c=false;bf=bf.$blk();}if(bf&&bf.$blk!==undefined){break s;}bf;bd=bd+(1)>>0;$s=89;continue;case 90:if(g.fmt.fmtFlags.sharpV){(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(125);}else{(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(93);}$s=16;continue;case 13:bg=i.Pointer();if(!((bg===0))&&(e===0)){$s=93;continue;}$s=94;continue;case 93:bh=i.Elem();$s=96;case 96:if($c){$c=false;bh=bh.$blk();}if(bh&&bh.$blk!==undefined){break s;}bi=bh;bj=bi.Kind();if((bj===(17))||(bj===(23))){$s=97;continue;}if(bj===(25)){$s=98;continue;}if(bj===(21)){$s=99;continue;}$s=100;continue;case 97:(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(38);bk=g.printValue(bi,d,e+1>>0);$s=101;case 101:if($c){$c=false;bk=bk.$blk();}if(bk&&bk.$blk!==undefined){break s;}bk;$s=1;continue s;$s=100;continue;case 98:(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(38);bl=g.printValue(bi,d,e+1>>0);$s=102;case 102:if($c){$c=false;bl=bl.$blk();}if(bl&&bl.$blk!==undefined){break s;}bl;$s=1;continue s;$s=100;continue;case 99:(g.$ptr_buf||(g.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},g))).WriteByte(38);bm=g.printValue(bi,d,e+1>>0);$s=103;case 103:if($c){$c=false;bm=bm.$blk();}if(bm&&bm.$blk!==undefined){break s;}bm;$s=1;continue s;case 100:case 95:case 94:$r=g.fmtPointer(c,d);$s=104;case 104:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=16;continue;case 14:$r=g.fmtPointer(c,d);$s=105;case 105:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=16;continue;case 15:$r=g.unknownType(i);$s=106;case 106:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 16:case 1:g.value=h;f=f;return f;}return;}if($f===undefined){$f={$blk:AK.ptr.prototype.printReflectValue};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.ax=ax;$f.ay=ay;$f.az=az;$f.ba=ba;$f.bb=bb;$f.bc=bc;$f.bd=bd;$f.be=be;$f.bf=bf;$f.bg=bg;$f.bh=bh;$f.bi=bi;$f.bj=bj;$f.bk=bk;$f.bl=bl;$f.bm=bm;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};AK.prototype.printReflectValue=function(c,d,e){return this.$val.printReflectValue(c,d,e);};BD=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=0;f=false;g=0;g=d;if(d=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+d]),$Int,true);e=h[0];f=h[1];if(!f){$s=3;continue;}$s=4;continue;case 3:i=G.ValueOf(((d<0||d>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+d]));$s=6;case 6:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}j=i;k=j.Kind();if((k===(2))||(k===(3))||(k===(4))||(k===(5))||(k===(6))){l=j.Int();if((m=new $Int64(0,((l.$low+((l.$high>>31)*4294967296))>>0)),(m.$high===l.$high&&m.$low===l.$low))){e=((l.$low+((l.$high>>31)*4294967296))>>0);f=true;}}else if((k===(7))||(k===(8))||(k===(9))||(k===(10))||(k===(11))||(k===(12))){n=j.Uint();if((o=new $Int64(n.$high,n.$low),(o.$high>0||(o.$high===0&&o.$low>=0)))&&(p=new $Uint64(0,(n.$low>>0)),(p.$high===n.$high&&p.$low===n.$low))){e=(n.$low>>0);f=true;}}case 5:case 4:g=d+1>>0;if(AY(e)){e=0;f=false;}case 2:return[e,f,g];}return;}if($f===undefined){$f={$blk:BD};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.$s=$s;$f.$r=$r;return $f;};BE=function(c){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;d=0;e=0;f=false;if(c.length<3){g=0;h=1;i=false;d=g;e=h;f=i;return[d,e,f];}j=1;while(true){if(!(j>0;q=false;d=o;e=p;f=q;return[d,e,f];}r=l-1>>0;s=j+1>>0;t=true;d=r;e=s;f=t;return[d,e,f];}j=j+(1)>>0;}u=0;v=1;w=false;d=u;e=v;f=w;return[d,e,f];};AK.ptr.prototype.argNumber=function(c,d,e,f){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;g=0;h=0;i=false;j=this;if(d.length<=e||!((d.charCodeAt(e)===91))){k=c;l=e;m=false;g=k;h=l;i=m;return[g,h,i];}j.reordered=true;n=BE(d.substring(e));o=n[0];p=n[1];q=n[2];if(q&&0<=o&&o>0;t=true;g=r;h=s;i=t;return[g,h,i];}j.goodArgNum=false;u=c;v=e+p>>0;w=q;g=u;h=v;i=w;return[g,h,i];};AK.prototype.argNumber=function(c,d,e,f){return this.$val.argNumber(c,d,e,f);};AK.ptr.prototype.doPrintf=function(c,d){var $ptr,aa,ab,ac,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=c.length;g=0;h=false;e.reordered=false;i=0;case 1:if(!(i>0;}if(i>j){(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).WriteString(c.substring(j,i));}if(i>=f){$s=2;continue;}i=i+(1)>>0;e.fmt.clearflags();F:while(true){if(!(i>0;}l=e.argNumber(g,c,i,d.$length);g=l[0];i=l[1];h=l[2];if(i>0;n=BD(d,g);$s=6;case 6:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}m=n;e.fmt.wid=m[0];e.fmt.fmtFlags.widPresent=m[1];g=m[2];if(!e.fmt.fmtFlags.widPresent){(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(AC);}if(e.fmt.wid<0){e.fmt.wid=-e.fmt.wid;e.fmt.fmtFlags.minus=true;}h=false;$s=5;continue;case 4:o=AZ(c,i,f);e.fmt.wid=o[0];e.fmt.fmtFlags.widPresent=o[1];i=o[2];if(h&&e.fmt.fmtFlags.widPresent){e.goodArgNum=false;}case 5:if((i+1>>0)>0;if(h){e.goodArgNum=false;}p=e.argNumber(g,c,i,d.$length);g=p[0];i=p[1];h=p[2];if(i>0;r=BD(d,g);$s=12;case 12:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}q=r;e.fmt.prec=q[0];e.fmt.fmtFlags.precPresent=q[1];g=q[2];if(e.fmt.prec<0){e.fmt.prec=0;e.fmt.fmtFlags.precPresent=false;}if(!e.fmt.fmtFlags.precPresent){(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(AD);}h=false;$s=11;continue;case 10:s=AZ(c,i,f);e.fmt.prec=s[0];e.fmt.fmtFlags.precPresent=s[1];i=s[2];if(!e.fmt.fmtFlags.precPresent){e.fmt.prec=0;e.fmt.fmtFlags.precPresent=true;}case 11:case 8:if(!h){t=e.argNumber(g,c,i,d.$length);g=t[0];i=t[1];h=t[2];}if(i>=f){$s=13;continue;}$s=14;continue;case 13:(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(AE);$s=1;continue;case 14:u=C.DecodeRuneInString(c.substring(i));v=u[0];w=u[1];i=i+(w)>>0;if(v===37){$s=15;continue;}$s=16;continue;case 15:(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).WriteByte(37);$s=1;continue;case 16:if(!e.goodArgNum){$s=17;continue;}if(g>=d.$length){$s=18;continue;}$s=19;continue;case 17:(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(V);e.add(v);(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(X);$s=1;continue;$s=19;continue;case 18:(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(V);e.add(v);(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).Write(W);$s=1;continue;case 19:x=((g<0||g>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+g]);g=g+(1)>>0;if(v===118){if(e.fmt.fmtFlags.sharp){e.fmt.fmtFlags.sharp=false;e.fmt.fmtFlags.sharpV=true;}if(e.fmt.fmtFlags.plus){e.fmt.fmtFlags.plus=false;e.fmt.fmtFlags.plusV=true;}}y=e.printArg(x,v,0);$s=20;case 20:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}y;$s=1;continue;case 2:if(!e.reordered&&g=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+g]);if(!($interfaceIsEqual(z,$ifaceNil))){$s=25;continue;}$s=26;continue;case 25:aa=G.TypeOf(z).String();$s=27;case 27:if($c){$c=false;aa=aa.$blk();}if(aa&&aa.$blk!==undefined){break s;}ab=(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).WriteString(aa);$s=28;case 28:if($c){$c=false;ab=ab.$blk();}if(ab&&ab.$blk!==undefined){break s;}ab;(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).WriteByte(61);case 26:ac=e.printArg(z,118,0);$s=29;case 29:if($c){$c=false;ac=ac.$blk();}if(ac&&ac.$blk!==undefined){break s;}ac;if((g+1>>0)>0;$s=23;continue;case 24:(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).WriteByte(41);case 22:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AK.ptr.prototype.doPrintf};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};AK.prototype.doPrintf=function(c,d){return this.$val.doPrintf(c,d);};AK.ptr.prototype.doPrint=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,l,m,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=this;g=false;h=0;case 1:if(!(h=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+h]);if(h>0){$s=3;continue;}$s=4;continue;case 3:if(!(!($interfaceIsEqual(i,$ifaceNil)))){j=false;$s=5;continue s;}k=G.TypeOf(i).Kind();$s=6;case 6:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}j=k===24;case 5:l=j;if(d||!l&&!g){(f.$ptr_buf||(f.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},f))).WriteByte(32);}case 4:m=f.printArg(i,118,0);$s=7;case 7:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}g=m;h=h+(1)>>0;$s=1;continue;case 2:if(e){(f.$ptr_buf||(f.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},f))).WriteByte(10);}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AK.ptr.prototype.doPrint};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.$s=$s;$f.$r=$r;return $f;};AK.prototype.doPrint=function(c,d,e){return this.$val.doPrint(c,d,e);};BT.ptr.prototype.Read=function(c){var $ptr,c,d,e,f,g,h;d=0;e=$ifaceNil;f=this;g=0;h=D.New("ScanState's Read should not be called. Use ReadRune");d=g;e=h;return[d,e];};BT.prototype.Read=function(c){return this.$val.Read(c);};BT.ptr.prototype.ReadRune=function(){var $ptr,c,d,e,f,g,h,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=0;d=0;e=$ifaceNil;f=this;if(f.peekRune>=0){f.count=f.count+(1)>>0;c=f.peekRune;d=C.RuneLen(c);f.prevRune=c;f.peekRune=-1;return[c,d,e];}if(f.atEOF||f.ssave.nlIsEnd&&(f.prevRune===10)||f.count>=f.ssave.argLimit){e=E.EOF;return[c,d,e];}h=f.rr.ReadRune();$s=1;case 1:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}g=h;c=g[0];d=g[1];e=g[2];if($interfaceIsEqual(e,$ifaceNil)){f.count=f.count+(1)>>0;f.prevRune=c;}else if($interfaceIsEqual(e,E.EOF)){f.atEOF=true;}return[c,d,e];}return;}if($f===undefined){$f={$blk:BT.ptr.prototype.ReadRune};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.$s=$s;$f.$r=$r;return $f;};BT.prototype.ReadRune=function(){return this.$val.ReadRune();};BT.ptr.prototype.Width=function(){var $ptr,c,d,e,f,g,h,i;c=0;d=false;e=this;if(e.ssave.maxWid===1073741824){f=0;g=false;c=f;d=g;return[c,d];}h=e.ssave.maxWid;i=true;c=h;d=i;return[c,d];};BT.prototype.Width=function(){return this.$val.Width();};BT.ptr.prototype.getRune=function(){var $ptr,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=0;d=this;f=d.ReadRune();$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}e=f;c=e[0];g=e[2];if(!($interfaceIsEqual(g,$ifaceNil))){if($interfaceIsEqual(g,E.EOF)){c=-1;return c;}d.error(g);}return c;}return;}if($f===undefined){$f={$blk:BT.ptr.prototype.getRune};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};BT.prototype.getRune=function(){return this.$val.getRune();};BT.ptr.prototype.UnreadRune=function(){var $ptr,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=this;d=$assertType(c.rr,BF,true);e=d[0];f=d[1];if(f){$s=1;continue;}$s=2;continue;case 1:g=e.UnreadRune();$s=4;case 4:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}g;$s=3;continue;case 2:c.peekRune=c.prevRune;case 3:c.prevRune=-1;c.count=c.count-(1)>>0;return $ifaceNil;}return;}if($f===undefined){$f={$blk:BT.ptr.prototype.UnreadRune};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};BT.prototype.UnreadRune=function(){return this.$val.UnreadRune();};BT.ptr.prototype.error=function(c){var $ptr,c,d,e;d=this;$panic((e=new BS.ptr(c),new e.constructor.elem(e)));};BT.prototype.error=function(c){return this.$val.error(c);};BT.ptr.prototype.errorString=function(c){var $ptr,c,d,e;d=this;$panic((e=new BS.ptr(D.New(c)),new e.constructor.elem(e)));};BT.prototype.errorString=function(c){return this.$val.errorString(c);};BT.ptr.prototype.Token=function(c,d){var $ptr,c,d,e,f,g,h,$s,$deferred,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;$s=$f.$s;$deferred=$f.$deferred;$r=$f.$r;}var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$deferred.index=$curGoroutine.deferStack.length;$curGoroutine.deferStack.push($deferred);e=[e];f=CG.nil;e[0]=$ifaceNil;g=this;$deferred.push([(function(e){return function(){var $ptr,h,i,j,k;h=$recover();if(!($interfaceIsEqual(h,$ifaceNil))){i=$assertType(h,BS,true);j=$clone(i[0],BS);k=i[1];if(k){e[0]=j.err;}else{$panic(h);}}};})(e),[]]);if(d===$throwNilPointerError){d=BX;}g.buf=$subslice(g.buf,0,0);h=g.token(c,d);$s=1;case 1:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}f=h;return[f,e[0]];}return;}}catch(err){$err=err;$s=-1;}finally{$callDeferred($deferred,$err);if(!$curGoroutine.asleep){return[f,e[0]];}if($curGoroutine.asleep){if($f===undefined){$f={$blk:BT.ptr.prototype.Token};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.$s=$s;$f.$deferred=$deferred;$f.$r=$r;return $f;}}};BT.prototype.Token=function(c,d){return this.$val.Token(c,d);};BW=function(c){var $ptr,c,d,e,f,g;if(c>=65536){return false;}d=(c<<16>>>16);e=BV;f=0;while(true){if(!(f=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+f]),CM);if(d1024){return;}d.buf=$subslice(d.buf,0,0);d.rr=$ifaceNil;BZ.Put(d);};BT.prototype.free=function(c){return this.$val.free(c);};BT.ptr.prototype.skipSpace=function(c){var $ptr,c,d,e,f,g,h,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=this;case 1:e=d.getRune();$s=3;case 3:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=e;if(f===-1){return;}if(!(f===13)){g=false;$s=6;continue s;}h=d.peek("\n");$s=7;case 7:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}g=h;case 6:if(g){$s=4;continue;}$s=5;continue;case 4:$s=1;continue;case 5:if(f===10){$s=8;continue;}$s=9;continue;case 8:if(c){$s=2;continue;}if(d.ssave.nlIsSpace){$s=1;continue;}d.errorString("unexpected newline");return;case 9:if(!BW(f)){$s=10;continue;}$s=11;continue;case 10:i=d.UnreadRune();$s=12;case 12:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}i;$s=2;continue;case 11:$s=1;continue;case 2:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BT.ptr.prototype.skipSpace};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};BT.prototype.skipSpace=function(c){return this.$val.skipSpace(c);};BT.ptr.prototype.token=function(c,d){var $ptr,c,d,e,f,g,h,i,j,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;if(c){$s=1;continue;}$s=2;continue;case 1:$r=e.skipSpace(false);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:case 4:f=e.getRune();$s=6;case 6:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=f;if(g===-1){$s=5;continue;}h=d(g);$s=9;case 9:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}if(!h){$s=7;continue;}$s=8;continue;case 7:i=e.UnreadRune();$s=10;case 10:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}i;$s=5;continue;case 8:(e.$ptr_buf||(e.$ptr_buf=new CL(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},e))).WriteRune(g);$s=4;continue;case 5:return(j=e.buf,$subslice(new CG(j.$array),j.$offset,j.$offset+j.$length));}return;}if($f===undefined){$f={$blk:BT.ptr.prototype.token};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.$s=$s;$f.$r=$r;return $f;};BT.prototype.token=function(c,d){return this.$val.token(c,d);};CD=function(c,d){var $ptr,c,d,e,f,g,h,i;e=c;f=0;while(true){if(!(f=0;}return;}if($f===undefined){$f={$blk:BT.ptr.prototype.peek};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};BT.prototype.peek=function(c){return this.$val.peek(c);};DL.methods=[{prop:"clearflags",name:"clearflags",pkg:"fmt",typ:$funcType([],[],false)},{prop:"init",name:"init",pkg:"fmt",typ:$funcType([CL],[],false)},{prop:"computePadding",name:"computePadding",pkg:"fmt",typ:$funcType([$Int],[CG,$Int,$Int],false)},{prop:"writePadding",name:"writePadding",pkg:"fmt",typ:$funcType([$Int,CG],[],false)},{prop:"pad",name:"pad",pkg:"fmt",typ:$funcType([CG],[],false)},{prop:"padString",name:"padString",pkg:"fmt",typ:$funcType([$String],[],false)},{prop:"fmt_boolean",name:"fmt_boolean",pkg:"fmt",typ:$funcType([$Bool],[],false)},{prop:"integer",name:"integer",pkg:"fmt",typ:$funcType([$Int64,$Uint64,$Bool,$String],[],false)},{prop:"truncate",name:"truncate",pkg:"fmt",typ:$funcType([$String],[$String],false)},{prop:"fmt_s",name:"fmt_s",pkg:"fmt",typ:$funcType([$String],[],false)},{prop:"fmt_sbx",name:"fmt_sbx",pkg:"fmt",typ:$funcType([$String,CG,$String],[],false)},{prop:"fmt_sx",name:"fmt_sx",pkg:"fmt",typ:$funcType([$String,$String],[],false)},{prop:"fmt_bx",name:"fmt_bx",pkg:"fmt",typ:$funcType([CG,$String],[],false)},{prop:"fmt_q",name:"fmt_q",pkg:"fmt",typ:$funcType([$String],[],false)},{prop:"fmt_qc",name:"fmt_qc",pkg:"fmt",typ:$funcType([$Int64],[],false)},{prop:"formatFloat",name:"formatFloat",pkg:"fmt",typ:$funcType([$Float64,$Uint8,$Int,$Int],[],false)},{prop:"fmt_e64",name:"fmt_e64",pkg:"fmt",typ:$funcType([$Float64],[],false)},{prop:"fmt_E64",name:"fmt_E64",pkg:"fmt",typ:$funcType([$Float64],[],false)},{prop:"fmt_f64",name:"fmt_f64",pkg:"fmt",typ:$funcType([$Float64],[],false)},{prop:"fmt_g64",name:"fmt_g64",pkg:"fmt",typ:$funcType([$Float64],[],false)},{prop:"fmt_G64",name:"fmt_G64",pkg:"fmt",typ:$funcType([$Float64],[],false)},{prop:"fmt_fb64",name:"fmt_fb64",pkg:"fmt",typ:$funcType([$Float64],[],false)},{prop:"fmt_e32",name:"fmt_e32",pkg:"fmt",typ:$funcType([$Float32],[],false)},{prop:"fmt_E32",name:"fmt_E32",pkg:"fmt",typ:$funcType([$Float32],[],false)},{prop:"fmt_f32",name:"fmt_f32",pkg:"fmt",typ:$funcType([$Float32],[],false)},{prop:"fmt_g32",name:"fmt_g32",pkg:"fmt",typ:$funcType([$Float32],[],false)},{prop:"fmt_G32",name:"fmt_G32",pkg:"fmt",typ:$funcType([$Float32],[],false)},{prop:"fmt_fb32",name:"fmt_fb32",pkg:"fmt",typ:$funcType([$Float32],[],false)},{prop:"fmt_c64",name:"fmt_c64",pkg:"fmt",typ:$funcType([$Complex64,$Int32],[],false)},{prop:"fmt_c128",name:"fmt_c128",pkg:"fmt",typ:$funcType([$Complex128,$Int32],[],false)},{prop:"fmt_complex",name:"fmt_complex",pkg:"fmt",typ:$funcType([$Float64,$Float64,$Int,$Int32],[],false)}];CL.methods=[{prop:"Write",name:"Write",pkg:"",typ:$funcType([CG],[$Int,$error],false)},{prop:"WriteString",name:"WriteString",pkg:"",typ:$funcType([$String],[$Int,$error],false)},{prop:"WriteByte",name:"WriteByte",pkg:"",typ:$funcType([$Uint8],[$error],false)},{prop:"WriteRune",name:"WriteRune",pkg:"",typ:$funcType([$Int32],[$error],false)}];CO.methods=[{prop:"free",name:"free",pkg:"fmt",typ:$funcType([],[],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int,$Bool],false)},{prop:"Precision",name:"Precision",pkg:"",typ:$funcType([],[$Int,$Bool],false)},{prop:"Flag",name:"Flag",pkg:"",typ:$funcType([$Int],[$Bool],false)},{prop:"add",name:"add",pkg:"fmt",typ:$funcType([$Int32],[],false)},{prop:"Write",name:"Write",pkg:"",typ:$funcType([CG],[$Int,$error],false)},{prop:"unknownType",name:"unknownType",pkg:"fmt",typ:$funcType([G.Value],[],false)},{prop:"badVerb",name:"badVerb",pkg:"fmt",typ:$funcType([$Int32],[],false)},{prop:"fmtBool",name:"fmtBool",pkg:"fmt",typ:$funcType([$Bool,$Int32],[],false)},{prop:"fmtC",name:"fmtC",pkg:"fmt",typ:$funcType([$Int64],[],false)},{prop:"fmtInt64",name:"fmtInt64",pkg:"fmt",typ:$funcType([$Int64,$Int32],[],false)},{prop:"fmt0x64",name:"fmt0x64",pkg:"fmt",typ:$funcType([$Uint64,$Bool],[],false)},{prop:"fmtUnicode",name:"fmtUnicode",pkg:"fmt",typ:$funcType([$Int64],[],false)},{prop:"fmtUint64",name:"fmtUint64",pkg:"fmt",typ:$funcType([$Uint64,$Int32],[],false)},{prop:"fmtFloat32",name:"fmtFloat32",pkg:"fmt",typ:$funcType([$Float32,$Int32],[],false)},{prop:"fmtFloat64",name:"fmtFloat64",pkg:"fmt",typ:$funcType([$Float64,$Int32],[],false)},{prop:"fmtComplex64",name:"fmtComplex64",pkg:"fmt",typ:$funcType([$Complex64,$Int32],[],false)},{prop:"fmtComplex128",name:"fmtComplex128",pkg:"fmt",typ:$funcType([$Complex128,$Int32],[],false)},{prop:"fmtString",name:"fmtString",pkg:"fmt",typ:$funcType([$String,$Int32],[],false)},{prop:"fmtBytes",name:"fmtBytes",pkg:"fmt",typ:$funcType([CG,$Int32,G.Type,$Int],[],false)},{prop:"fmtPointer",name:"fmtPointer",pkg:"fmt",typ:$funcType([G.Value,$Int32],[],false)},{prop:"catchPanic",name:"catchPanic",pkg:"fmt",typ:$funcType([$emptyInterface,$Int32],[],false)},{prop:"clearSpecialFlags",name:"clearSpecialFlags",pkg:"fmt",typ:$funcType([],[$Bool,$Bool],false)},{prop:"restoreSpecialFlags",name:"restoreSpecialFlags",pkg:"fmt",typ:$funcType([$Bool,$Bool],[],false)},{prop:"handleMethods",name:"handleMethods",pkg:"fmt",typ:$funcType([$Int32,$Int],[$Bool],false)},{prop:"printArg",name:"printArg",pkg:"fmt",typ:$funcType([$emptyInterface,$Int32,$Int],[$Bool],false)},{prop:"printValue",name:"printValue",pkg:"fmt",typ:$funcType([G.Value,$Int32,$Int],[$Bool],false)},{prop:"printReflectValue",name:"printReflectValue",pkg:"fmt",typ:$funcType([G.Value,$Int32,$Int],[$Bool],false)},{prop:"argNumber",name:"argNumber",pkg:"fmt",typ:$funcType([$Int,$String,$Int,$Int],[$Int,$Int,$Bool],false)},{prop:"doPrintf",name:"doPrintf",pkg:"fmt",typ:$funcType([$String,CH],[],false)},{prop:"doPrint",name:"doPrint",pkg:"fmt",typ:$funcType([CH,$Bool,$Bool],[],false)}];CR.methods=[{prop:"Read",name:"Read",pkg:"",typ:$funcType([CG],[$Int,$error],false)},{prop:"ReadRune",name:"ReadRune",pkg:"",typ:$funcType([],[$Int32,$Int,$error],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int,$Bool],false)},{prop:"getRune",name:"getRune",pkg:"fmt",typ:$funcType([],[$Int32],false)},{prop:"mustReadRune",name:"mustReadRune",pkg:"fmt",typ:$funcType([],[$Int32],false)},{prop:"UnreadRune",name:"UnreadRune",pkg:"",typ:$funcType([],[$error],false)},{prop:"error",name:"error",pkg:"fmt",typ:$funcType([$error],[],false)},{prop:"errorString",name:"errorString",pkg:"fmt",typ:$funcType([$String],[],false)},{prop:"Token",name:"Token",pkg:"",typ:$funcType([$Bool,DM],[CG,$error],false)},{prop:"SkipSpace",name:"SkipSpace",pkg:"",typ:$funcType([],[],false)},{prop:"free",name:"free",pkg:"fmt",typ:$funcType([BU],[],false)},{prop:"skipSpace",name:"skipSpace",pkg:"fmt",typ:$funcType([$Bool],[],false)},{prop:"token",name:"token",pkg:"fmt",typ:$funcType([$Bool,DM],[CG],false)},{prop:"consume",name:"consume",pkg:"fmt",typ:$funcType([$String,$Bool],[$Bool],false)},{prop:"peek",name:"peek",pkg:"fmt",typ:$funcType([$String],[$Bool],false)},{prop:"notEOF",name:"notEOF",pkg:"fmt",typ:$funcType([],[],false)},{prop:"accept",name:"accept",pkg:"fmt",typ:$funcType([$String],[$Bool],false)},{prop:"okVerb",name:"okVerb",pkg:"fmt",typ:$funcType([$Int32,$String,$String],[$Bool],false)},{prop:"scanBool",name:"scanBool",pkg:"fmt",typ:$funcType([$Int32],[$Bool],false)},{prop:"getBase",name:"getBase",pkg:"fmt",typ:$funcType([$Int32],[$Int,$String],false)},{prop:"scanNumber",name:"scanNumber",pkg:"fmt",typ:$funcType([$String,$Bool],[$String],false)},{prop:"scanRune",name:"scanRune",pkg:"fmt",typ:$funcType([$Int],[$Int64],false)},{prop:"scanBasePrefix",name:"scanBasePrefix",pkg:"fmt",typ:$funcType([],[$Int,$String,$Bool],false)},{prop:"scanInt",name:"scanInt",pkg:"fmt",typ:$funcType([$Int32,$Int],[$Int64],false)},{prop:"scanUint",name:"scanUint",pkg:"fmt",typ:$funcType([$Int32,$Int],[$Uint64],false)},{prop:"floatToken",name:"floatToken",pkg:"fmt",typ:$funcType([],[$String],false)},{prop:"complexTokens",name:"complexTokens",pkg:"fmt",typ:$funcType([],[$String,$String],false)},{prop:"convertFloat",name:"convertFloat",pkg:"fmt",typ:$funcType([$String,$Int],[$Float64],false)},{prop:"scanComplex",name:"scanComplex",pkg:"fmt",typ:$funcType([$Int32,$Int],[$Complex128],false)},{prop:"convertString",name:"convertString",pkg:"fmt",typ:$funcType([$Int32],[$String],false)},{prop:"quotedString",name:"quotedString",pkg:"fmt",typ:$funcType([],[$String],false)},{prop:"hexByte",name:"hexByte",pkg:"fmt",typ:$funcType([],[$Uint8,$Bool],false)},{prop:"hexString",name:"hexString",pkg:"fmt",typ:$funcType([],[$String],false)},{prop:"scanOne",name:"scanOne",pkg:"fmt",typ:$funcType([$Int32,$emptyInterface],[],false)},{prop:"doScan",name:"doScan",pkg:"fmt",typ:$funcType([CH],[$Int,$error],false)},{prop:"advance",name:"advance",pkg:"fmt",typ:$funcType([$String],[$Int],false)},{prop:"doScanf",name:"doScanf",pkg:"fmt",typ:$funcType([$String,CH],[$Int,$error],false)}];L.init([{prop:"widPresent",name:"widPresent",pkg:"fmt",typ:$Bool,tag:""},{prop:"precPresent",name:"precPresent",pkg:"fmt",typ:$Bool,tag:""},{prop:"minus",name:"minus",pkg:"fmt",typ:$Bool,tag:""},{prop:"plus",name:"plus",pkg:"fmt",typ:$Bool,tag:""},{prop:"sharp",name:"sharp",pkg:"fmt",typ:$Bool,tag:""},{prop:"space",name:"space",pkg:"fmt",typ:$Bool,tag:""},{prop:"unicode",name:"unicode",pkg:"fmt",typ:$Bool,tag:""},{prop:"uniQuote",name:"uniQuote",pkg:"fmt",typ:$Bool,tag:""},{prop:"zero",name:"zero",pkg:"fmt",typ:$Bool,tag:""},{prop:"plusV",name:"plusV",pkg:"fmt",typ:$Bool,tag:""},{prop:"sharpV",name:"sharpV",pkg:"fmt",typ:$Bool,tag:""}]);M.init([{prop:"intbuf",name:"intbuf",pkg:"fmt",typ:CK,tag:""},{prop:"buf",name:"buf",pkg:"fmt",typ:CL,tag:""},{prop:"wid",name:"wid",pkg:"fmt",typ:$Int,tag:""},{prop:"prec",name:"prec",pkg:"fmt",typ:$Int,tag:""},{prop:"fmtFlags",name:"",pkg:"fmt",typ:L,tag:""}]);AF.init([{prop:"Flag",name:"Flag",pkg:"",typ:$funcType([$Int],[$Bool],false)},{prop:"Precision",name:"Precision",pkg:"",typ:$funcType([],[$Int,$Bool],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int,$Bool],false)},{prop:"Write",name:"Write",pkg:"",typ:$funcType([CG],[$Int,$error],false)}]);AG.init([{prop:"Format",name:"Format",pkg:"",typ:$funcType([AF,$Int32],[],false)}]);AH.init([{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}]);AI.init([{prop:"GoString",name:"GoString",pkg:"",typ:$funcType([],[$String],false)}]);AJ.init($Uint8);AK.init([{prop:"n",name:"n",pkg:"fmt",typ:$Int,tag:""},{prop:"panicking",name:"panicking",pkg:"fmt",typ:$Bool,tag:""},{prop:"erroring",name:"erroring",pkg:"fmt",typ:$Bool,tag:""},{prop:"buf",name:"buf",pkg:"fmt",typ:AJ,tag:""},{prop:"arg",name:"arg",pkg:"fmt",typ:$emptyInterface,tag:""},{prop:"value",name:"value",pkg:"fmt",typ:G.Value,tag:""},{prop:"reordered",name:"reordered",pkg:"fmt",typ:$Bool,tag:""},{prop:"goodArgNum",name:"goodArgNum",pkg:"fmt",typ:$Bool,tag:""},{prop:"runeBuf",name:"runeBuf",pkg:"fmt",typ:CJ,tag:""},{prop:"fmt",name:"fmt",pkg:"fmt",typ:M,tag:""}]);BF.init([{prop:"UnreadRune",name:"UnreadRune",pkg:"",typ:$funcType([],[$error],false)}]);BG.init([{prop:"Read",name:"Read",pkg:"",typ:$funcType([CG],[$Int,$error],false)},{prop:"ReadRune",name:"ReadRune",pkg:"",typ:$funcType([],[$Int32,$Int,$error],false)},{prop:"SkipSpace",name:"SkipSpace",pkg:"",typ:$funcType([],[],false)},{prop:"Token",name:"Token",pkg:"",typ:$funcType([$Bool,DM],[CG,$error],false)},{prop:"UnreadRune",name:"UnreadRune",pkg:"",typ:$funcType([],[$error],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int,$Bool],false)}]);BS.init([{prop:"err",name:"err",pkg:"fmt",typ:$error,tag:""}]);BT.init([{prop:"rr",name:"rr",pkg:"fmt",typ:E.RuneReader,tag:""},{prop:"buf",name:"buf",pkg:"fmt",typ:AJ,tag:""},{prop:"peekRune",name:"peekRune",pkg:"fmt",typ:$Int32,tag:""},{prop:"prevRune",name:"prevRune",pkg:"fmt",typ:$Int32,tag:""},{prop:"count",name:"count",pkg:"fmt",typ:$Int,tag:""},{prop:"atEOF",name:"atEOF",pkg:"fmt",typ:$Bool,tag:""},{prop:"ssave",name:"",pkg:"fmt",typ:BU,tag:""}]);BU.init([{prop:"validSave",name:"validSave",pkg:"fmt",typ:$Bool,tag:""},{prop:"nlIsEnd",name:"nlIsEnd",pkg:"fmt",typ:$Bool,tag:""},{prop:"nlIsSpace",name:"nlIsSpace",pkg:"fmt",typ:$Bool,tag:""},{prop:"argLimit",name:"argLimit",pkg:"fmt",typ:$Int,tag:""},{prop:"limit",name:"limit",pkg:"fmt",typ:$Int,tag:""},{prop:"maxWid",name:"maxWid",pkg:"fmt",typ:$Int,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=D.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=F.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=G.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=H.$init();$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}I=$makeSlice(CG,65);J=$makeSlice(CG,65);N=new CG($stringToBytes("true"));O=new CG($stringToBytes("false"));Q=new CG($stringToBytes(", "));R=new CG($stringToBytes(""));S=new CG($stringToBytes("(nil)"));T=new CG($stringToBytes("nil"));U=new CG($stringToBytes("map["));V=new CG($stringToBytes("%!"));W=new CG($stringToBytes("(MISSING)"));X=new CG($stringToBytes("(BADINDEX)"));Y=new CG($stringToBytes("(PANIC="));Z=new CG($stringToBytes("%!(EXTRA "));AA=new CG($stringToBytes("i)"));AB=new CG($stringToBytes("[]byte{"));AC=new CG($stringToBytes("%!(BADWIDTH)"));AD=new CG($stringToBytes("%!(BADPREC)"));AE=new CG($stringToBytes("%!(NOVERB)"));AL=new H.Pool.ptr(0,0,CH.nil,(function(){var $ptr;return new AK.ptr(0,false,false,AJ.nil,$ifaceNil,new G.Value.ptr(CI.nil,0,0),false,false,CJ.zero(),new M.ptr(CK.zero(),CL.nil,0,0,new L.ptr(false,false,false,false,false,false,false,false,false,false,false)));}));a=G.TypeOf(new $Int(0)).Bits();$s=9;case 9:if($c){$c=false;a=a.$blk();}if(a&&a.$blk!==undefined){break s;}BA=a;b=G.TypeOf(new $Uintptr(0)).Bits();$s=10;case 10:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}BB=b;BC=G.TypeOf(new $Uint8(0));BV=new CN([$toNativeArray($kindUint16,[9,13]),$toNativeArray($kindUint16,[32,32]),$toNativeArray($kindUint16,[133,133]),$toNativeArray($kindUint16,[160,160]),$toNativeArray($kindUint16,[5760,5760]),$toNativeArray($kindUint16,[8192,8202]),$toNativeArray($kindUint16,[8232,8233]),$toNativeArray($kindUint16,[8239,8239]),$toNativeArray($kindUint16,[8287,8287]),$toNativeArray($kindUint16,[12288,12288])]);BZ=new H.Pool.ptr(0,0,CH.nil,(function(){var $ptr;return new BT.ptr($ifaceNil,AJ.nil,0,0,0,false,new BU.ptr(false,false,false,0,0,0));}));CB=D.New("syntax error scanning complex number");CC=D.New("syntax error scanning boolean");K();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["math/rand"]=(function(){var $pkg={},$init,B,A,J,L,AC,AE,AI,AJ,AK,AM,AN,AO,C,D,E,G,H,I,N,AD,F,K,M,AF;B=$packages["github.com/gopherjs/gopherjs/nosync"];A=$packages["math"];J=$pkg.Source=$newType(8,$kindInterface,"rand.Source","Source","math/rand",null);L=$pkg.Rand=$newType(0,$kindStruct,"rand.Rand","Rand","math/rand",function(src_){this.$val=this;if(arguments.length===0){this.src=$ifaceNil;return;}this.src=src_;});AC=$pkg.lockedSource=$newType(0,$kindStruct,"rand.lockedSource","lockedSource","math/rand",function(lk_,src_){this.$val=this;if(arguments.length===0){this.lk=new B.Mutex.ptr(false);this.src=$ifaceNil;return;}this.lk=lk_;this.src=src_;});AE=$pkg.rngSource=$newType(0,$kindStruct,"rand.rngSource","rngSource","math/rand",function(tap_,feed_,vec_){this.$val=this;if(arguments.length===0){this.tap=0;this.feed=0;this.vec=AI.zero();return;}this.tap=tap_;this.feed=feed_;this.vec=vec_;});AI=$arrayType($Int64,607);AJ=$sliceType($Int);AK=$ptrType(L);AM=$sliceType($Uint8);AN=$ptrType(AC);AO=$ptrType(AE);L.ptr.prototype.ExpFloat64=function(){var $ptr,a,b,c,d,e,f,g,h,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=this;case 1:b=a.Uint32();$s=3;case 3:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}c=b;d=(c&255)>>>0;e=c*((d<0||d>=D.length)?$throwRuntimeError("index out of range"):D[d]);if(c<((d<0||d>=C.length)?$throwRuntimeError("index out of range"):C[d])){return e;}if(d===0){$s=4;continue;}$s=5;continue;case 4:f=a.Float64();$s=6;case 6:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=A.Log(f);$s=7;case 7:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}$s=8;case 8:return 7.69711747013105-g;case 5:h=a.Float64();$s=11;case 11:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}if($fround(((d<0||d>=E.length)?$throwRuntimeError("index out of range"):E[d])+$fround($fround(h)*($fround((i=d-1>>>0,((i<0||i>=E.length)?$throwRuntimeError("index out of range"):E[i]))-((d<0||d>=E.length)?$throwRuntimeError("index out of range"):E[d])))))<$fround(A.Exp(-e))){$s=9;continue;}$s=10;continue;case 9:return e;case 10:$s=1;continue;case 2:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:L.ptr.prototype.ExpFloat64};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.ExpFloat64=function(){return this.$val.ExpFloat64();};F=function(a){var $ptr,a;if(a<0){return(-a>>>0);}return(a>>>0);};L.ptr.prototype.NormFloat64=function(){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=this;case 1:b=a.Uint32();$s=3;case 3:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}c=(b>>0);d=c&127;e=c*((d<0||d>=H.length)?$throwRuntimeError("index out of range"):H[d]);if(F(c)<((d<0||d>=G.length)?$throwRuntimeError("index out of range"):G[d])){return e;}if(d===0){$s=4;continue;}$s=5;continue;case 4:case 6:f=a.Float64();$s=8;case 8:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=A.Log(f);$s=9;case 9:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}e=-g*0.29047645161474317;h=a.Float64();$s=10;case 10:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}i=A.Log(h);$s=11;case 11:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}j=-i;if(j+j>=e*e){$s=7;continue;}$s=6;continue;case 7:if(c>0){return 3.442619855899+e;}return-3.442619855899-e;case 5:k=a.Float64();$s=14;case 14:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}if($fround(((d<0||d>=I.length)?$throwRuntimeError("index out of range"):I[d])+$fround($fround(k)*($fround((l=d-1>>0,((l<0||l>=I.length)?$throwRuntimeError("index out of range"):I[l]))-((d<0||d>=I.length)?$throwRuntimeError("index out of range"):I[d])))))<$fround(A.Exp(-0.5*e*e))){$s=12;continue;}$s=13;continue;case 12:return e;case 13:$s=1;continue;case 2:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:L.ptr.prototype.NormFloat64};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.NormFloat64=function(){return this.$val.NormFloat64();};K=function(a){var $ptr,a,b;b=new AE.ptr(0,0,AI.zero());b.Seed(a);return b;};$pkg.NewSource=K;M=function(a){var $ptr,a;return new L.ptr(a);};$pkg.New=M;L.ptr.prototype.Seed=function(a){var $ptr,a,b,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;$r=b.src.Seed(a);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Seed};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Seed=function(a){return this.$val.Seed(a);};L.ptr.prototype.Int63=function(){var $ptr,a,b,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=this;b=a.src.Int63();$s=1;case 1:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}$s=2;case 2:return b;}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Int63};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Int63=function(){return this.$val.Int63();};L.ptr.prototype.Uint32=function(){var $ptr,a,b,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=this;b=a.Int63();$s=1;case 1:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}$s=2;case 2:return($shiftRightInt64(b,31).$low>>>0);}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Uint32};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Uint32=function(){return this.$val.Uint32();};L.ptr.prototype.Int31=function(){var $ptr,a,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=this;c=a.Int63();$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=2;case 2:return((b=$shiftRightInt64(c,32),b.$low+((b.$high>>31)*4294967296))>>0);}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Int31};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Int31=function(){return this.$val.Int31();};L.ptr.prototype.Int=function(){var $ptr,a,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=this;b=a.Int63();$s=1;case 1:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}c=(b.$low>>>0);return(((c<<1>>>0)>>>1>>>0)>>0);}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Int};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Int=function(){return this.$val.Int();};L.ptr.prototype.Int63n=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;if((a.$high<0||(a.$high===0&&a.$low<=0))){$panic(new $String("invalid argument to Int63n"));}if((c=(d=new $Int64(a.$high-0,a.$low-1),new $Int64(a.$high&d.$high,(a.$low&d.$low)>>>0)),(c.$high===0&&c.$low===0))){$s=1;continue;}$s=2;continue;case 1:f=b.Int63();$s=3;case 3:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}$s=4;case 4:return(e=f,g=new $Int64(a.$high-0,a.$low-1),new $Int64(e.$high&g.$high,(e.$low&g.$low)>>>0));case 2:j=(h=(i=$div64(new $Uint64(2147483648,0),new $Uint64(a.$high,a.$low),true),new $Uint64(2147483647-i.$high,4294967295-i.$low)),new $Int64(h.$high,h.$low));k=b.Int63();$s=5;case 5:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}l=k;case 6:if(!((l.$high>j.$high||(l.$high===j.$high&&l.$low>j.$low)))){$s=7;continue;}m=b.Int63();$s=8;case 8:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}l=m;$s=6;continue;case 7:return $div64(l,a,true);}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Int63n};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Int63n=function(a){return this.$val.Int63n(a);};L.ptr.prototype.Int31n=function(a){var $ptr,a,b,c,d,e,f,g,h,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;if(a<=0){$panic(new $String("invalid argument to Int31n"));}if((a&((a-1>>0)))===0){$s=1;continue;}$s=2;continue;case 1:c=b.Int31();$s=3;case 3:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=4;case 4:return c&((a-1>>0));case 2:e=((2147483647-(d=2147483648%(a>>>0),d===d?d:$throwRuntimeError("integer divide by zero"))>>>0)>>0);f=b.Int31();$s=5;case 5:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=f;case 6:if(!(g>e)){$s=7;continue;}h=b.Int31();$s=8;case 8:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}g=h;$s=6;continue;case 7:return(i=g%a,i===i?i:$throwRuntimeError("integer divide by zero"));}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Int31n};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Int31n=function(a){return this.$val.Int31n(a);};L.ptr.prototype.Intn=function(a){var $ptr,a,b,c,d,e,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;if(a<=0){$panic(new $String("invalid argument to Intn"));}if(a<=2147483647){$s=1;continue;}$s=2;continue;case 1:c=b.Int31n((a>>0));$s=3;case 3:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=4;case 4:return(c>>0);case 2:e=b.Int63n(new $Int64(0,a));$s=5;case 5:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}$s=6;case 6:return((d=e,d.$low+((d.$high>>31)*4294967296))>>0);}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Intn};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Intn=function(a){return this.$val.Intn(a);};L.ptr.prototype.Float64=function(){var $ptr,a,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=this;case 1:b=a.Int63();$s=2;case 2:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}c=$flatten64(b)/9.223372036854776e+18;if(c===1){$s=3;continue;}$s=4;continue;case 3:$s=1;continue;case 4:return c;}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Float64};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Float64=function(){return this.$val.Float64();};L.ptr.prototype.Float32=function(){var $ptr,a,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=this;case 1:b=a.Float64();$s=2;case 2:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}c=$fround(b);if(c===1){$s=3;continue;}$s=4;continue;case 3:$s=1;continue;case 4:return c;}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Float32};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Float32=function(){return this.$val.Float32();};L.ptr.prototype.Perm=function(a){var $ptr,a,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;c=$makeSlice(AJ,a);d=0;case 1:if(!(d>0);$s=3;case 3:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=e;((d<0||d>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+d]=((f<0||f>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+f]));((f<0||f>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+f]=d);d=d+(1)>>0;$s=1;continue;case 2:return c;}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Perm};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Perm=function(a){return this.$val.Perm(a);};L.ptr.prototype.Read=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=0;c=$ifaceNil;d=this;e=0;case 1:if(!(e>0)>0,((i<0||i>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+i]=(g.$low<<24>>>24)));g=$shiftRightInt64(g,(8));h=h+(1)>>0;}e=e+(7)>>0;$s=1;continue;case 2:j=a.$length;k=$ifaceNil;b=j;c=k;return[b,c];}return;}if($f===undefined){$f={$blk:L.ptr.prototype.Read};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.$s=$s;$f.$r=$r;return $f;};L.prototype.Read=function(a){return this.$val.Read(a);};AC.ptr.prototype.Int63=function(){var $ptr,a,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=new $Int64(0,0);b=this;b.lk.Lock();c=b.src.Int63();$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}a=c;b.lk.Unlock();return a;}return;}if($f===undefined){$f={$blk:AC.ptr.prototype.Int63};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};AC.prototype.Int63=function(){return this.$val.Int63();};AC.ptr.prototype.Seed=function(a){var $ptr,a,b,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;b.lk.Lock();$r=b.src.Seed(a);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}b.lk.Unlock();$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AC.ptr.prototype.Seed};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.$s=$s;$f.$r=$r;return $f;};AC.prototype.Seed=function(a){return this.$val.Seed(a);};AF=function(a){var $ptr,a,b,c,d,e;c=(b=a/44488,(b===b&&b!==1/0&&b!==-1/0)?b>>0:$throwRuntimeError("integer divide by zero"));e=(d=a%44488,d===d?d:$throwRuntimeError("integer divide by zero"));a=($imul(48271,e))-($imul(3399,c))>>0;if(a<0){a=a+(2147483647)>>0;}return a;};AE.ptr.prototype.Seed=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j;b=this;b.tap=0;b.feed=334;a=$div64(a,new $Int64(0,2147483647),true);if((a.$high<0||(a.$high===0&&a.$low<0))){a=(c=new $Int64(0,2147483647),new $Int64(a.$high+c.$high,a.$low+c.$low));}if((a.$high===0&&a.$low===0)){a=new $Int64(0,89482311);}d=((a.$low+((a.$high>>31)*4294967296))>>0);e=-20;while(true){if(!(e<607)){break;}d=AF(d);if(e>=0){f=new $Int64(0,0);f=$shiftLeft64(new $Int64(0,d),40);d=AF(d);f=(g=$shiftLeft64(new $Int64(0,d),20),new $Int64(f.$high^g.$high,(f.$low^g.$low)>>>0));d=AF(d);f=(h=new $Int64(0,d),new $Int64(f.$high^h.$high,(f.$low^h.$low)>>>0));f=(i=((e<0||e>=AD.length)?$throwRuntimeError("index out of range"):AD[e]),new $Int64(f.$high^i.$high,(f.$low^i.$low)>>>0));(j=b.vec,((e<0||e>=j.length)?$throwRuntimeError("index out of range"):j[e]=new $Int64(f.$high&2147483647,(f.$low&4294967295)>>>0)));}e=e+(1)>>0;}};AE.prototype.Seed=function(a){return this.$val.Seed(a);};AE.ptr.prototype.Int63=function(){var $ptr,a,b,c,d,e,f,g,h,i,j,k;a=this;a.tap=a.tap-(1)>>0;if(a.tap<0){a.tap=a.tap+(607)>>0;}a.feed=a.feed-(1)>>0;if(a.feed<0){a.feed=a.feed+(607)>>0;}i=(b=(c=(d=a.vec,e=a.feed,((e<0||e>=d.length)?$throwRuntimeError("index out of range"):d[e])),f=(g=a.vec,h=a.tap,((h<0||h>=g.length)?$throwRuntimeError("index out of range"):g[h])),new $Int64(c.$high+f.$high,c.$low+f.$low)),new $Int64(b.$high&2147483647,(b.$low&4294967295)>>>0));(j=a.vec,k=a.feed,((k<0||k>=j.length)?$throwRuntimeError("index out of range"):j[k]=i));return i;};AE.prototype.Int63=function(){return this.$val.Int63();};AK.methods=[{prop:"ExpFloat64",name:"ExpFloat64",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"NormFloat64",name:"NormFloat64",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Seed",name:"Seed",pkg:"",typ:$funcType([$Int64],[],false)},{prop:"Int63",name:"Int63",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"Uint32",name:"Uint32",pkg:"",typ:$funcType([],[$Uint32],false)},{prop:"Int31",name:"Int31",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"Int",name:"Int",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Int63n",name:"Int63n",pkg:"",typ:$funcType([$Int64],[$Int64],false)},{prop:"Int31n",name:"Int31n",pkg:"",typ:$funcType([$Int32],[$Int32],false)},{prop:"Intn",name:"Intn",pkg:"",typ:$funcType([$Int],[$Int],false)},{prop:"Float64",name:"Float64",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Float32",name:"Float32",pkg:"",typ:$funcType([],[$Float32],false)},{prop:"Perm",name:"Perm",pkg:"",typ:$funcType([$Int],[AJ],false)},{prop:"Read",name:"Read",pkg:"",typ:$funcType([AM],[$Int,$error],false)}];AN.methods=[{prop:"Int63",name:"Int63",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"Seed",name:"Seed",pkg:"",typ:$funcType([$Int64],[],false)}];AO.methods=[{prop:"Seed",name:"Seed",pkg:"",typ:$funcType([$Int64],[],false)},{prop:"Int63",name:"Int63",pkg:"",typ:$funcType([],[$Int64],false)}];J.init([{prop:"Int63",name:"Int63",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"Seed",name:"Seed",pkg:"",typ:$funcType([$Int64],[],false)}]);L.init([{prop:"src",name:"src",pkg:"math/rand",typ:J,tag:""}]);AC.init([{prop:"lk",name:"lk",pkg:"math/rand",typ:B.Mutex,tag:""},{prop:"src",name:"src",pkg:"math/rand",typ:J,tag:""}]);AE.init([{prop:"tap",name:"tap",pkg:"math/rand",typ:$Int,tag:""},{prop:"feed",name:"feed",pkg:"math/rand",typ:$Int,tag:""},{prop:"vec",name:"vec",pkg:"math/rand",typ:AI,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=B.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}C=$toNativeArray($kindUint32,[3801129273,0,2615860924,3279400049,3571300752,3733536696,3836274812,3906990442,3958562475,3997804264,4028649213,4053523342,4074002619,4091154507,4105727352,4118261130,4129155133,4138710916,4147160435,4154685009,4161428406,4167506077,4173011791,4178022498,4182601930,4186803325,4190671498,4194244443,4197554582,4200629752,4203493986,4206168142,4208670408,4211016720,4213221098,4215295924,4217252177,4219099625,4220846988,4222502074,4224071896,4225562770,4226980400,4228329951,4229616109,4230843138,4232014925,4233135020,4234206673,4235232866,4236216336,4237159604,4238064994,4238934652,4239770563,4240574564,4241348362,4242093539,4242811568,4243503822,4244171579,4244816032,4245438297,4246039419,4246620374,4247182079,4247725394,4248251127,4248760037,4249252839,4249730206,4250192773,4250641138,4251075867,4251497493,4251906522,4252303431,4252688672,4253062674,4253425844,4253778565,4254121205,4254454110,4254777611,4255092022,4255397640,4255694750,4255983622,4256264513,4256537670,4256803325,4257061702,4257313014,4257557464,4257795244,4258026541,4258251531,4258470383,4258683258,4258890309,4259091685,4259287526,4259477966,4259663135,4259843154,4260018142,4260188212,4260353470,4260514019,4260669958,4260821380,4260968374,4261111028,4261249421,4261383632,4261513736,4261639802,4261761900,4261880092,4261994441,4262105003,4262211835,4262314988,4262414513,4262510454,4262602857,4262691764,4262777212,4262859239,4262937878,4263013162,4263085118,4263153776,4263219158,4263281289,4263340187,4263395872,4263448358,4263497660,4263543789,4263586755,4263626565,4263663224,4263696735,4263727099,4263754314,4263778377,4263799282,4263817020,4263831582,4263842955,4263851124,4263856071,4263857776,4263856218,4263851370,4263843206,4263831695,4263816804,4263798497,4263776735,4263751476,4263722676,4263690284,4263654251,4263614520,4263571032,4263523724,4263472530,4263417377,4263358192,4263294892,4263227394,4263155608,4263079437,4262998781,4262913534,4262823581,4262728804,4262629075,4262524261,4262414220,4262298801,4262177846,4262051187,4261918645,4261780032,4261635148,4261483780,4261325704,4261160681,4260988457,4260808763,4260621313,4260425802,4260221905,4260009277,4259787550,4259556329,4259315195,4259063697,4258801357,4258527656,4258242044,4257943926,4257632664,4257307571,4256967906,4256612870,4256241598,4255853155,4255446525,4255020608,4254574202,4254106002,4253614578,4253098370,4252555662,4251984571,4251383021,4250748722,4250079132,4249371435,4248622490,4247828790,4246986404,4246090910,4245137315,4244119963,4243032411,4241867296,4240616155,4239269214,4237815118,4236240596,4234530035,4232664930,4230623176,4228378137,4225897409,4223141146,4220059768,4216590757,4212654085,4208145538,4202926710,4196809522,4189531420,4180713890,4169789475,4155865042,4137444620,4111806704,4073393724,4008685917,3873074895]);D=$toNativeArray($kindFloat32,[2.0249555365836613e-09,1.4866739783681027e-11,2.4409616689036184e-11,3.1968806074589295e-11,3.844677007314168e-11,4.42282044321729e-11,4.951644302919611e-11,5.443358958023836e-11,5.905943789574764e-11,6.34494193296753e-11,6.764381416113352e-11,7.167294535648239e-11,7.556032188826833e-11,7.932458162551725e-11,8.298078890689453e-11,8.654132271912474e-11,9.001651507523079e-11,9.341507428706208e-11,9.674443190998971e-11,1.0001099254308699e-10,1.0322031424037093e-10,1.0637725422757427e-10,1.0948611461891744e-10,1.1255067711157807e-10,1.1557434870246297e-10,1.1856014781042035e-10,1.2151082917633005e-10,1.2442885610752796e-10,1.2731647680563896e-10,1.3017574518325858e-10,1.330085347417409e-10,1.3581656632677408e-10,1.386014220061682e-10,1.413645728254309e-10,1.4410737880776736e-10,1.4683107507629245e-10,1.4953686899854546e-10,1.522258291641876e-10,1.5489899640730442e-10,1.575573282952547e-10,1.6020171300645814e-10,1.628330109637588e-10,1.6545202707884954e-10,1.68059510752272e-10,1.7065616975120435e-10,1.73242697965037e-10,1.758197337720091e-10,1.783878739169964e-10,1.8094774290045024e-10,1.834998542005195e-10,1.8604476292871652e-10,1.8858298256319017e-10,1.9111498494872592e-10,1.9364125580789704e-10,1.9616222535212557e-10,1.9867835154840918e-10,2.011900368525943e-10,2.0369768372052732e-10,2.062016807302669e-10,2.0870240258208383e-10,2.1120022397624894e-10,2.136955057352452e-10,2.1618855317040442e-10,2.1867974098199738e-10,2.2116936060356807e-10,2.2365774510202385e-10,2.2614519978869652e-10,2.2863201609713002e-10,2.3111849933865614e-10,2.3360494094681883e-10,2.3609159072179864e-10,2.3857874009713953e-10,2.4106666662859766e-10,2.4355562011635357e-10,2.460458781161634e-10,2.485376904282077e-10,2.5103127909709144e-10,2.5352694943414633e-10,2.560248957284017e-10,2.585253955356137e-10,2.610286709003873e-10,2.6353494386732734e-10,2.6604446423661443e-10,2.6855745405285347e-10,2.71074163116225e-10,2.7359478571575835e-10,2.7611959940720965e-10,2.786487707240326e-10,2.8118254946640775e-10,2.8372118543451563e-10,2.8626484516180994e-10,2.8881380620404684e-10,2.9136826285025563e-10,2.9392840938946563e-10,2.96494523377433e-10,2.990667713476114e-10,3.016454031001814e-10,3.042306406797479e-10,3.068226783753403e-10,3.09421765987139e-10,3.12028125559749e-10,3.1464195138219964e-10,3.17263521010247e-10,3.1989300097734485e-10,3.225306410836737e-10,3.2517669112941405e-10,3.2783134540359526e-10,3.3049485370639786e-10,3.3316743808242677e-10,3.3584937608743815e-10,3.385408342548857e-10,3.4124211789610115e-10,3.4395342130011386e-10,3.4667499426710435e-10,3.494071143528288e-10,3.521500313574677e-10,3.54903967325626e-10,3.576691720574843e-10,3.6044595086437425e-10,3.632345535464765e-10,3.660352021483959e-10,3.688482297370399e-10,3.716738583570134e-10,3.7451239331964814e-10,3.773641121807003e-10,3.802292924959261e-10,3.831082673322328e-10,3.8600128648980103e-10,3.8890865527996255e-10,3.9183070676962473e-10,3.9476774627011935e-10,3.977200790927782e-10,4.006880383045086e-10,4.0367195697221803e-10,4.066721681628138e-10,4.0968900494320337e-10,4.127228558914453e-10,4.15774054074447e-10,4.188429603146915e-10,4.2192993543466173e-10,4.25035395767992e-10,4.2815970213716525e-10,4.313032986313914e-10,4.3446651831757777e-10,4.376498607960855e-10,4.408536868893975e-10,4.4407846844229937e-10,4.4732464954400086e-10,4.5059267428371186e-10,4.538830145062178e-10,4.5719619756745544e-10,4.605326675566346e-10,4.638929240741163e-10,4.672775499869886e-10,4.706869893844612e-10,4.74121908400349e-10,4.775827511238617e-10,4.810701836888143e-10,4.845848167178701e-10,4.881271498113904e-10,4.916979601254923e-10,4.952977472605369e-10,4.989272883726414e-10,5.025872495956207e-10,5.062783525744408e-10,5.100013189540675e-10,5.13756870379467e-10,5.175458395179078e-10,5.21369003525507e-10,5.252272505806843e-10,5.29121357839557e-10,5.330522134805449e-10,5.3702081670437e-10,5.41028055689452e-10,5.450749851476644e-10,5.491624932574268e-10,5.532918012640664e-10,5.574638528571541e-10,5.616799247931681e-10,5.659410717839819e-10,5.702485705860738e-10,5.746036979559221e-10,5.790077306500052e-10,5.83462111958255e-10,5.879682296594524e-10,5.925275825546805e-10,5.971417249561739e-10,6.01812211176167e-10,6.065408175714992e-10,6.113292094767075e-10,6.16179329782085e-10,6.21092954844471e-10,6.260721940876124e-10,6.311191569352559e-10,6.362359528111483e-10,6.414249686947926e-10,6.466885360545405e-10,6.520292639144998e-10,6.574497612987784e-10,6.629528592760892e-10,6.685415554485985e-10,6.742187919073217e-10,6.799880103436351e-10,6.858525969377638e-10,6.918161599145378e-10,6.978825850545434e-10,7.040559801829716e-10,7.103406751696184e-10,7.167412219288849e-10,7.232625609532306e-10,7.2990985477972e-10,7.366885990123251e-10,7.436047333442275e-10,7.506645305355164e-10,7.57874762946642e-10,7.652426470272644e-10,7.727759543385559e-10,7.804830115532013e-10,7.883728114777e-10,7.964550685635174e-10,8.047402189070851e-10,8.132396422944055e-10,8.219657177122031e-10,8.309318788590758e-10,8.401527806789488e-10,8.496445214056791e-10,8.594246980742071e-10,8.695127395874636e-10,8.799300732498239e-10,8.90700457834015e-10,9.01850316648023e-10,9.134091816243028e-10,9.254100818978372e-10,9.37890431984556e-10,9.508922538259412e-10,9.64463842123564e-10,9.78660263939446e-10,9.935448019859905e-10,1.0091912860943353e-09,1.0256859805934937e-09,1.0431305819125214e-09,1.0616465484503124e-09,1.0813799855569073e-09,1.1025096391392708e-09,1.1252564435793033e-09,1.149898620766976e-09,1.176793218427008e-09,1.2064089727203964e-09,1.2393785997488749e-09,1.2765849488616254e-09,1.319313880365769e-09,1.36954347862428e-09,1.4305497897382224e-09,1.5083649884672923e-09,1.6160853766322703e-09,1.7921247819074893e-09]);E=$toNativeArray($kindFloat32,[1,0.9381436705589294,0.900469958782196,0.8717043399810791,0.847785472869873,0.8269932866096497,0.8084216713905334,0.7915276288986206,0.7759568691253662,0.7614634037017822,0.7478685975074768,0.7350381016731262,0.7228676676750183,0.7112747430801392,0.7001926302909851,0.6895664930343628,0.6793505549430847,0.669506311416626,0.6600008606910706,0.6508058309555054,0.6418967247009277,0.633251965045929,0.62485271692276,0.6166821718215942,0.608725368976593,0.6009689569473267,0.5934008955955505,0.5860103368759155,0.5787873864173889,0.5717230439186096,0.5648092031478882,0.5580382943153381,0.5514034032821655,0.5448982119560242,0.5385168790817261,0.5322538614273071,0.526104211807251,0.5200631618499756,0.5141264200210571,0.5082897543907166,0.5025495290756226,0.4969019889831543,0.4913438558578491,0.4858720004558563,0.48048335313796997,0.4751752018928528,0.4699448347091675,0.4647897481918335,0.4597076177597046,0.4546961486339569,0.4497532546520233,0.44487687945365906,0.4400651156902313,0.4353161156177521,0.4306281507015228,0.42599955201148987,0.42142874002456665,0.4169141948223114,0.4124544560909271,0.40804818272590637,0.4036940038204193,0.39939069747924805,0.3951369822025299,0.39093172550201416,0.38677382469177246,0.38266217708587646,0.378595769405365,0.37457355856895447,0.37059465050697327,0.366658091545105,0.362762987613678,0.358908474445343,0.35509374737739563,0.35131800174713135,0.3475804924964905,0.34388044476509094,0.34021714329719543,0.33658990263938904,0.3329980671405792,0.3294409513473511,0.32591795921325684,0.32242849469184875,0.3189719021320343,0.3155476748943329,0.31215524673461914,0.3087940812110901,0.30546361207962036,0.30216339230537415,0.29889291524887085,0.29565170407295227,0.2924392819404602,0.2892552316188812,0.28609907627105713,0.2829704284667969,0.27986884117126465,0.2767939269542694,0.2737452983856201,0.2707225978374481,0.26772540807724,0.26475343108177185,0.2618062496185303,0.258883535861969,0.2559850215911865,0.25311028957366943,0.25025907158851624,0.24743106961250305,0.2446259707212448,0.24184346199035645,0.23908329010009766,0.23634515702724457,0.2336287796497345,0.23093391954898834,0.22826029360294342,0.22560766339302063,0.22297576069831848,0.22036437690258026,0.21777324378490448,0.21520215272903442,0.212650865316391,0.21011915802955627,0.20760682225227356,0.20511364936828613,0.20263944566249847,0.20018397271633148,0.19774706661701202,0.1953285187482834,0.19292815029621124,0.19054576754570007,0.18818120658397675,0.18583425879478455,0.18350479006767273,0.18119260668754578,0.17889754474163055,0.17661945521831512,0.17435817420482635,0.1721135377883911,0.16988539695739746,0.16767361760139465,0.16547803580760956,0.16329853236675262,0.16113494336605072,0.1589871346950531,0.15685498714447021,0.15473836660385132,0.15263713896274567,0.1505511850118637,0.1484803706407547,0.14642459154129028,0.1443837285041809,0.14235764741897583,0.1403462439775467,0.13834942877292633,0.136367067694664,0.13439907133579254,0.1324453204870224,0.1305057406425476,0.12858019769191742,0.12666863203048706,0.12477091699838638,0.12288697808980942,0.1210167184472084,0.11916005611419678,0.11731690168380737,0.11548716574907303,0.11367076635360718,0.11186762899160385,0.11007767915725708,0.1083008274435997,0.10653700679540634,0.10478614270687103,0.1030481606721878,0.10132300108671188,0.0996105819940567,0.09791085124015808,0.09622374176979065,0.09454918652772903,0.09288713335990906,0.09123751521110535,0.08960027992725372,0.08797537535429001,0.08636274188756943,0.0847623273730278,0.08317409455776215,0.08159798383712769,0.08003395050764084,0.07848194986581802,0.07694194465875626,0.07541389018297195,0.07389774918556213,0.07239348441362381,0.070901058614254,0.06942043453454971,0.06795158982276917,0.06649449467658997,0.06504911929368973,0.06361543387174606,0.06219341605901718,0.06078304722905159,0.0593843050301075,0.05799717456102371,0.05662164092063904,0.05525768920779228,0.05390531197190285,0.05256449431180954,0.05123523622751236,0.04991753399372101,0.04861138388514519,0.047316793352365494,0.04603376239538193,0.044762298464775085,0.04350241273641586,0.04225412383675575,0.04101744294166565,0.039792392402887344,0.03857899457216263,0.03737728297710419,0.03618728369474411,0.03500903770327568,0.03384258225560188,0.0326879620552063,0.031545232981443405,0.030414443463087082,0.0292956605553627,0.028188949450850487,0.027094384655356407,0.02601204626262188,0.024942025542259216,0.023884421214461327,0.022839335724711418,0.021806888282299042,0.020787203684449196,0.019780423492193222,0.018786700442433357,0.017806200310587883,0.016839107498526573,0.015885621309280396,0.014945968054234982,0.01402039173990488,0.013109165243804455,0.012212592177093029,0.011331013403832912,0.010464809834957123,0.009614413604140282,0.008780314587056637,0.007963077165186405,0.007163353264331818,0.0063819061033427715,0.005619642324745655,0.004877655766904354,0.004157294984906912,0.003460264764726162,0.0027887988835573196,0.0021459676790982485,0.001536299823783338,0.0009672692976891994,0.0004541343660093844]);G=$toNativeArray($kindUint32,[1991057938,0,1611602771,1826899878,1918584482,1969227037,2001281515,2023368125,2039498179,2051788381,2061460127,2069267110,2075699398,2081089314,2085670119,2089610331,2093034710,2096037586,2098691595,2101053571,2103168620,2105072996,2106796166,2108362327,2109791536,2111100552,2112303493,2113412330,2114437283,2115387130,2116269447,2117090813,2117856962,2118572919,2119243101,2119871411,2120461303,2121015852,2121537798,2122029592,2122493434,2122931299,2123344971,2123736059,2124106020,2124456175,2124787725,2125101763,2125399283,2125681194,2125948325,2126201433,2126441213,2126668298,2126883268,2127086657,2127278949,2127460589,2127631985,2127793506,2127945490,2128088244,2128222044,2128347141,2128463758,2128572095,2128672327,2128764606,2128849065,2128925811,2128994934,2129056501,2129110560,2129157136,2129196237,2129227847,2129251929,2129268426,2129277255,2129278312,2129271467,2129256561,2129233410,2129201800,2129161480,2129112170,2129053545,2128985244,2128906855,2128817916,2128717911,2128606255,2128482298,2128345305,2128194452,2128028813,2127847342,2127648860,2127432031,2127195339,2126937058,2126655214,2126347546,2126011445,2125643893,2125241376,2124799783,2124314271,2123779094,2123187386,2122530867,2121799464,2120980787,2120059418,2119015917,2117825402,2116455471,2114863093,2112989789,2110753906,2108037662,2104664315,2100355223,2094642347,2086670106,2074676188,2054300022,2010539237]);H=$toNativeArray($kindFloat32,[1.7290404663583558e-09,1.2680928529462676e-10,1.689751810696194e-10,1.9862687883343e-10,2.223243117382978e-10,2.4244936613904144e-10,2.601613091623989e-10,2.761198769629658e-10,2.9073962681813725e-10,3.042996965518796e-10,3.169979556627567e-10,3.289802041894774e-10,3.4035738116777736e-10,3.5121602848242617e-10,3.61625090983253e-10,3.7164057942185025e-10,3.813085680537398e-10,3.906675816178762e-10,3.997501218933053e-10,4.0858399996679395e-10,4.1719308563337165e-10,4.255982233303257e-10,4.3381759295968436e-10,4.4186720948857783e-10,4.497613115272969e-10,4.57512583373898e-10,4.6513240481438345e-10,4.726310454117311e-10,4.800177477726209e-10,4.873009773476156e-10,4.944885056978876e-10,5.015873272284921e-10,5.086040477664255e-10,5.155446070048697e-10,5.224146670812502e-10,5.292193350214802e-10,5.359634958068682e-10,5.426517013518151e-10,5.492881705038144e-10,5.558769555769061e-10,5.624218868405251e-10,5.689264614971989e-10,5.75394121238304e-10,5.818281967329142e-10,5.882316855831959e-10,5.946076964136182e-10,6.009590047817426e-10,6.072883862451306e-10,6.135985053390414e-10,6.19892026598734e-10,6.261713370037114e-10,6.324390455780815e-10,6.386973727678935e-10,6.449488165749528e-10,6.511955974453087e-10,6.574400468473129e-10,6.636843297158634e-10,6.699307220081607e-10,6.761814441702541e-10,6.824387166481927e-10,6.887046488657234e-10,6.949815167800466e-10,7.012714853260604e-10,7.075767749498141e-10,7.13899661608508e-10,7.202424212593428e-10,7.266072743483676e-10,7.329966078550854e-10,7.394128087589991e-10,7.458582640396116e-10,7.523354716987285e-10,7.588469852493063e-10,7.653954137154528e-10,7.719834771435785e-10,7.786139510912449e-10,7.852897221383159e-10,7.920137878869582e-10,7.987892014504894e-10,8.056192379868321e-10,8.125072836762115e-10,8.194568912323064e-10,8.264716688799467e-10,8.3355555791087e-10,8.407127216614185e-10,8.479473234679347e-10,8.552640262671218e-10,8.626675485068347e-10,8.701631637464402e-10,8.777562010564566e-10,8.854524335966119e-10,8.932581896381464e-10,9.011799639857543e-10,9.092249730890956e-10,9.174008219758889e-10,9.25715837318819e-10,9.341788453909317e-10,9.42799727177146e-10,9.515889187738935e-10,9.605578554783278e-10,9.697193048552322e-10,9.790869226478094e-10,9.886760299337993e-10,9.985036131254788e-10,1.008588212947359e-09,1.0189509236369076e-09,1.0296150598776421e-09,1.040606933955246e-09,1.0519566329136865e-09,1.0636980185552147e-09,1.0758701707302976e-09,1.0885182755160372e-09,1.101694735439196e-09,1.115461056855338e-09,1.1298901814171813e-09,1.1450695946990663e-09,1.1611052119775422e-09,1.178127595480305e-09,1.1962995039027646e-09,1.2158286599728285e-09,1.2369856250415978e-09,1.2601323318151003e-09,1.2857697129220469e-09,1.3146201904845611e-09,1.3477839955200466e-09,1.3870635751089821e-09,1.43574030442295e-09,1.5008658760251592e-09,1.6030947680434338e-09]);I=$toNativeArray($kindFloat32,[1,0.963599681854248,0.9362826943397522,0.9130436182022095,0.8922816514968872,0.8732430338859558,0.8555005788803101,0.8387836217880249,0.8229072093963623,0.8077383041381836,0.7931770086288452,0.7791460752487183,0.7655841708183289,0.7524415850639343,0.7396772503852844,0.7272568941116333,0.7151514887809753,0.7033361196517944,0.6917891502380371,0.6804918646812439,0.6694276928901672,0.6585819721221924,0.6479418277740479,0.6374954581260681,0.6272324919700623,0.6171433925628662,0.6072195172309875,0.5974531769752502,0.5878370404243469,0.5783646702766418,0.5690299868583679,0.5598273873329163,0.550751805305481,0.5417983531951904,0.5329626798629761,0.5242405533790588,0.5156282186508179,0.5071220397949219,0.49871864914894104,0.4904148280620575,0.48220765590667725,0.47409430146217346,0.466072142124176,0.45813870429992676,0.45029163360595703,0.44252872467041016,0.4348478317260742,0.42724698781967163,0.41972434520721436,0.41227802634239197,0.40490642189979553,0.39760786294937134,0.3903807997703552,0.3832238018512726,0.3761354684829712,0.3691144585609436,0.36215949058532715,0.3552693724632263,0.3484429717063904,0.3416791558265686,0.33497685194015503,0.32833510637283325,0.3217529058456421,0.3152293860912323,0.30876362323760986,0.3023548424243927,0.2960021495819092,0.2897048592567444,0.28346219658851624,0.2772735059261322,0.271138072013855,0.2650552988052368,0.25902456045150757,0.25304529070854187,0.24711695313453674,0.24123899638652802,0.23541094362735748,0.22963231801986694,0.22390270233154297,0.21822164952754974,0.21258877217769623,0.20700371265411377,0.20146611332893372,0.1959756463766098,0.19053204357624054,0.18513499200344086,0.17978426814079285,0.1744796335697174,0.16922089457511902,0.16400785744190216,0.1588403731584549,0.15371830761432648,0.14864157140254974,0.14361007511615753,0.13862377405166626,0.13368265330791473,0.12878671288490295,0.12393598258495331,0.11913054436445236,0.11437050998210907,0.10965602099895477,0.1049872562289238,0.10036443918943405,0.09578784555196762,0.09125780314207077,0.08677466958761215,0.08233889937400818,0.07795098423957825,0.07361150532960892,0.06932111829519272,0.06508058309555054,0.06089077144861221,0.05675266310572624,0.05266740173101425,0.048636294901371,0.044660862535238266,0.040742866694927216,0.03688438981771469,0.03308788686990738,0.029356317594647408,0.025693291798233986,0.02210330404341221,0.018592102453112602,0.015167297795414925,0.011839478276669979,0.0086244847625494,0.005548994988203049,0.0026696291752159595]);AD=$toNativeArray($kindInt64,[new $Int64(1173834291,3952672746),new $Int64(1081821761,3130416987),new $Int64(324977939,3414273807),new $Int64(1241840476,2806224363),new $Int64(669549340,1997590414),new $Int64(2103305448,2402795971),new $Int64(1663160183,1140819369),new $Int64(1120601685,1788868961),new $Int64(1848035537,1089001426),new $Int64(1235702047,873593504),new $Int64(1911387977,581324885),new $Int64(492609478,1609182556),new $Int64(1069394745,1241596776),new $Int64(1895445337,1771189259),new $Int64(772864846,3467012610),new $Int64(2006957225,2344407434),new $Int64(402115761,782467244),new $Int64(26335124,3404933915),new $Int64(1063924276,618867887),new $Int64(1178782866,520164395),new $Int64(555910815,1341358184),new $Int64(632398609,665794848),new $Int64(1527227641,3183648150),new $Int64(1781176124,696329606),new $Int64(1789146075,4151988961),new $Int64(60039534,998951326),new $Int64(1535158725,1364957564),new $Int64(63173359,4090230633),new $Int64(649454641,4009697548),new $Int64(248009524,2569622517),new $Int64(778703922,3742421481),new $Int64(1038377625,1506914633),new $Int64(1738099768,1983412561),new $Int64(236311649,1436266083),new $Int64(1035966148,3922894967),new $Int64(810508934,1792680179),new $Int64(563141142,1188796351),new $Int64(1349617468,405968250),new $Int64(1044074554,433754187),new $Int64(870549669,4073162024),new $Int64(1053232044,433121399),new $Int64(2451824,4162580594),new $Int64(2010221076,4132415622),new $Int64(611252600,3033822028),new $Int64(2016407895,824682382),new $Int64(2366218,3583765414),new $Int64(1522878809,535386927),new $Int64(1637219058,2286693689),new $Int64(1453075389,2968466525),new $Int64(193683513,1351410206),new $Int64(1863677552,1412813499),new $Int64(492736522,4126267639),new $Int64(512765208,2105529399),new $Int64(2132966268,2413882233),new $Int64(947457634,32226200),new $Int64(1149341356,2032329073),new $Int64(106485445,1356518208),new $Int64(79673492,3430061722),new $Int64(663048513,3820169661),new $Int64(481498454,2981816134),new $Int64(1017155588,4184371017),new $Int64(206574701,2119206761),new $Int64(1295374591,2472200560),new $Int64(1587026100,2853524696),new $Int64(1307803389,1681119904),new $Int64(1972496813,95608918),new $Int64(392686347,3690479145),new $Int64(941912722,1397922290),new $Int64(988169623,1516129515),new $Int64(1827305493,1547420459),new $Int64(1311333971,1470949486),new $Int64(194013850,1336785672),new $Int64(2102397034,4131677129),new $Int64(755205548,4246329084),new $Int64(1004983461,3788585631),new $Int64(2081005363,3080389532),new $Int64(1501045284,2215402037),new $Int64(391002300,1171593935),new $Int64(1408774047,1423855166),new $Int64(1628305930,2276716302),new $Int64(1779030508,2068027241),new $Int64(1369359303,3427553297),new $Int64(189241615,3289637845),new $Int64(1057480830,3486407650),new $Int64(634572984,3071877822),new $Int64(1159653919,3363620705),new $Int64(1213226718,4159821533),new $Int64(2070861710,1894661),new $Int64(1472989750,1156868282),new $Int64(348271067,776219088),new $Int64(1646054810,2425634259),new $Int64(1716021749,680510161),new $Int64(1573220192,1310101429),new $Int64(1095885995,2964454134),new $Int64(1821788136,3467098407),new $Int64(1990672920,2109628894),new $Int64(7834944,1232604732),new $Int64(309412934,3261916179),new $Int64(1699175360,434597899),new $Int64(235436061,1624796439),new $Int64(521080809,3589632480),new $Int64(1198416575,864579159),new $Int64(208735487,1380889830),new $Int64(619206309,2654509477),new $Int64(1419738251,1468209306),new $Int64(403198876,100794388),new $Int64(956062190,2991674471),new $Int64(1938816907,2224662036),new $Int64(1973824487,977097250),new $Int64(1351320195,726419512),new $Int64(1964023751,1747974366),new $Int64(1394388465,1556430604),new $Int64(1097991433,1080776742),new $Int64(1761636690,280794874),new $Int64(117767733,919835643),new $Int64(1180474222,3434019658),new $Int64(196069168,2461941785),new $Int64(133215641,3615001066),new $Int64(417204809,3103414427),new $Int64(790056561,3380809712),new $Int64(879802240,2724693469),new $Int64(547796833,598827710),new $Int64(300924196,3452273442),new $Int64(2071705424,649274915),new $Int64(1346182319,2585724112),new $Int64(636549385,3165579553),new $Int64(1185578221,2635894283),new $Int64(2094573470,2053289721),new $Int64(985976581,3169337108),new $Int64(1170569632,144717764),new $Int64(1079216270,1383666384),new $Int64(2022678706,681540375),new $Int64(1375448925,537050586),new $Int64(182715304,315246468),new $Int64(226402871,849323088),new $Int64(1262421183,45543944),new $Int64(1201038398,2319052083),new $Int64(2106775454,3613090841),new $Int64(560472520,2992171180),new $Int64(1765620479,2068244785),new $Int64(917538188,4239862634),new $Int64(777927839,3892253031),new $Int64(720683925,958186149),new $Int64(1724185863,1877702262),new $Int64(1357886971,837674867),new $Int64(1837048883,1507589294),new $Int64(1905518400,873336795),new $Int64(267722611,2764496274),new $Int64(341003118,4196182374),new $Int64(1080717893,550964545),new $Int64(818747069,420611474),new $Int64(222653272,204265180),new $Int64(1549974541,1787046383),new $Int64(1215581865,3102292318),new $Int64(418321538,1552199393),new $Int64(1243493047,980542004),new $Int64(267284263,3293718720),new $Int64(1179528763,3771917473),new $Int64(599484404,2195808264),new $Int64(252818753,3894702887),new $Int64(780007692,2099949527),new $Int64(1424094358,338442522),new $Int64(490737398,637158004),new $Int64(419862118,281976339),new $Int64(574970164,3619802330),new $Int64(1715552825,3084554784),new $Int64(882872465,4129772886),new $Int64(43084605,1680378557),new $Int64(525521057,3339087776),new $Int64(1680500332,4220317857),new $Int64(211654685,2959322499),new $Int64(1675600481,1488354890),new $Int64(1312620086,3958162143),new $Int64(920972075,2773705983),new $Int64(1876039582,225908689),new $Int64(963748535,908216283),new $Int64(1541787429,3574646075),new $Int64(319760557,1936937569),new $Int64(1519770881,75492235),new $Int64(816689472,1935193178),new $Int64(2142521206,2018250883),new $Int64(455141620,3943126022),new $Int64(1546084160,3066544345),new $Int64(1932392669,2793082663),new $Int64(908474287,3297036421),new $Int64(1640597065,2206987825),new $Int64(1594236910,807894872),new $Int64(366158341,766252117),new $Int64(2060649606,3833114345),new $Int64(845619743,1255067973),new $Int64(1201145605,741697208),new $Int64(671241040,2810093753),new $Int64(1109032642,4229340371),new $Int64(1462188720,1361684224),new $Int64(988084219,1906263026),new $Int64(475781207,3904421704),new $Int64(1523946520,1769075545),new $Int64(1062308525,2621599764),new $Int64(1279509432,3431891480),new $Int64(404732502,1871896503),new $Int64(128756421,1412808876),new $Int64(1605404688,952876175),new $Int64(1917039957,1824438899),new $Int64(1662295856,1005035476),new $Int64(1990909507,527508597),new $Int64(1288873303,3066806859),new $Int64(565995893,3244940914),new $Int64(1257737460,209092916),new $Int64(1899814242,1242699167),new $Int64(1433653252,456723774),new $Int64(1776978905,1001252870),new $Int64(1468772157,2026725874),new $Int64(857254202,2137562569),new $Int64(765939740,3183366709),new $Int64(1533887628,2612072960),new $Int64(56977098,1727148468),new $Int64(949899753,3803658212),new $Int64(1883670356,479946959),new $Int64(685713571,1562982345),new $Int64(201241205,1766109365),new $Int64(700596547,3257093788),new $Int64(1962768719,2365720207),new $Int64(93384808,3742754173),new $Int64(1689098413,2878193673),new $Int64(1096135042,2174002182),new $Int64(1313222695,3573511231),new $Int64(1392911121,1760299077),new $Int64(771856457,2260779833),new $Int64(1281464374,1452805722),new $Int64(917811730,2940011802),new $Int64(1890251082,1886183802),new $Int64(893897673,2514369088),new $Int64(1644345561,3924317791),new $Int64(172616216,500935732),new $Int64(1403501753,676580929),new $Int64(581571365,1184984890),new $Int64(1455515235,1271474274),new $Int64(318728910,3163791473),new $Int64(2051027584,2842487377),new $Int64(1511537551,2170968612),new $Int64(573262976,3535856740),new $Int64(94256461,1488599718),new $Int64(966951817,3408913763),new $Int64(60951736,2501050084),new $Int64(1272353200,1639124157),new $Int64(138001144,4088176393),new $Int64(1574896563,3989947576),new $Int64(1982239940,3414355209),new $Int64(1355154361,2275136352),new $Int64(89709303,2151835223),new $Int64(1216338715,1654534827),new $Int64(1467562197,377892833),new $Int64(1664767638,660204544),new $Int64(85706799,390828249),new $Int64(725310955,3402783878),new $Int64(678849488,3717936603),new $Int64(1113532086,2211058823),new $Int64(1564224320,2692150867),new $Int64(1952770442,1928910388),new $Int64(788716862,3931011137),new $Int64(1083670504,1112701047),new $Int64(2079333076,2452299106),new $Int64(1251318826,2337204777),new $Int64(1774877857,273889282),new $Int64(1798719843,1462008793),new $Int64(2138834788,1554494002),new $Int64(952516517,182675323),new $Int64(548928884,1882802136),new $Int64(589279648,3700220025),new $Int64(381039426,3083431543),new $Int64(1295624457,3622207527),new $Int64(338126939,432729309),new $Int64(480013522,2391914317),new $Int64(297925497,235747924),new $Int64(2120733629,3088823825),new $Int64(1402403853,2314658321),new $Int64(1165929723,2957634338),new $Int64(501323675,4117056981),new $Int64(1564699815,1482500298),new $Int64(1406657158,840489337),new $Int64(799522364,3483178565),new $Int64(532129761,2074004656),new $Int64(724246478,3643392642),new $Int64(1482330167,1583624461),new $Int64(1261660694,287473085),new $Int64(1667835381,3136843981),new $Int64(1138806821,1266970974),new $Int64(135185781,1998688839),new $Int64(392094735,1492900209),new $Int64(1031326774,1538112737),new $Int64(76914806,2207265429),new $Int64(260686035,963263315),new $Int64(1671145500,2295892134),new $Int64(1068469660,2002560897),new $Int64(1791233343,1369254035),new $Int64(33436120,3353312708),new $Int64(57507843,947771099),new $Int64(201728503,1747061399),new $Int64(1507240140,2047354631),new $Int64(720000810,4165367136),new $Int64(479265078,3388864963),new $Int64(1195302398,286492130),new $Int64(2045622690,2795735007),new $Int64(1431753082,3703961339),new $Int64(1999047161,1797825479),new $Int64(1429039600,1116589674),new $Int64(482063550,2593309206),new $Int64(1329049334,3404995677),new $Int64(1396904208,3453462936),new $Int64(1014767077,3016498634),new $Int64(75698599,1650371545),new $Int64(1592007860,212344364),new $Int64(1127766888,3843932156),new $Int64(1399463792,3573129983),new $Int64(1256901817,665897820),new $Int64(1071492673,1675628772),new $Int64(243225682,2831752928),new $Int64(2120298836,1486294219),new $Int64(193076235,268782709),new $Int64(1145360145,4186179080),new $Int64(624342951,1613720397),new $Int64(857179861,2703686015),new $Int64(1235864944,2205342611),new $Int64(1474779655,1411666394),new $Int64(619028749,677744900),new $Int64(270855115,4172867247),new $Int64(135494707,2163418403),new $Int64(849547544,2841526879),new $Int64(1029966689,1082141470),new $Int64(377371856,4046134367),new $Int64(51415528,2142943655),new $Int64(1897659315,3124627521),new $Int64(998228909,219992939),new $Int64(1068692697,1756846531),new $Int64(1283749206,1225118210),new $Int64(1621625642,1647770243),new $Int64(111523943,444807907),new $Int64(2036369448,3952076173),new $Int64(53201823,1461839639),new $Int64(315761893,3699250910),new $Int64(702974850,1373688981),new $Int64(734022261,147523747),new $Int64(100152742,1211276581),new $Int64(1294440951,2548832680),new $Int64(1144696256,1995631888),new $Int64(154500578,2011457303),new $Int64(796460974,3057425772),new $Int64(667839456,81484597),new $Int64(465502760,3646681560),new $Int64(775020923,635548515),new $Int64(602489502,2508044581),new $Int64(353263531,1014917157),new $Int64(719992433,3214891315),new $Int64(852684611,959582252),new $Int64(226415134,3347040449),new $Int64(1784615552,4102971975),new $Int64(397887437,4078022210),new $Int64(1610679822,2851767182),new $Int64(749162636,1540160644),new $Int64(598384772,1057290595),new $Int64(2034890660,3907769253),new $Int64(579300318,4248952684),new $Int64(1092907599,132554364),new $Int64(1061621234,1029351092),new $Int64(697840928,2583007416),new $Int64(298619124,1486185789),new $Int64(55905697,2871589073),new $Int64(2017643612,723203291),new $Int64(146250550,2494333952),new $Int64(1064490251,2230939180),new $Int64(342915576,3943232912),new $Int64(1768732449,2181367922),new $Int64(1418222537,2889274791),new $Int64(1824032949,2046728161),new $Int64(1653899792,1376052477),new $Int64(1022327048,381236993),new $Int64(1034385958,3188942166),new $Int64(2073003539,350070824),new $Int64(144881592,61758415),new $Int64(1405659422,3492950336),new $Int64(117440928,3093818430),new $Int64(1693893113,2962480613),new $Int64(235432940,3154871160),new $Int64(511005079,3228564679),new $Int64(610731502,888276216),new $Int64(1200780674,3574998604),new $Int64(870415268,1967526716),new $Int64(591335707,1554691298),new $Int64(574459414,339944798),new $Int64(1223764147,1154515356),new $Int64(1825645307,967516237),new $Int64(1546195135,596588202),new $Int64(279882768,3764362170),new $Int64(492091056,266611402),new $Int64(1754227768,2047856075),new $Int64(1146757215,21444105),new $Int64(1198058894,3065563181),new $Int64(1915064845,1140663212),new $Int64(633187674,2323741028),new $Int64(2126290159,3103873707),new $Int64(1008658319,2766828349),new $Int64(1661896145,1970872996),new $Int64(1628585413,3766615585),new $Int64(1552335120,2036813414),new $Int64(152606527,3105536507),new $Int64(13954645,3396176938),new $Int64(1426081645,1377154485),new $Int64(2085644467,3807014186),new $Int64(543009040,3710110597),new $Int64(396058129,916420443),new $Int64(734556788,2103831255),new $Int64(381322154,717331943),new $Int64(572884752,3550505941),new $Int64(45939673,378749927),new $Int64(149867929,611017331),new $Int64(592130075,758907650),new $Int64(1012992349,154266815),new $Int64(1107028706,1407468696),new $Int64(469292398,970098704),new $Int64(1862426162,1971660656),new $Int64(998365243,3332747885),new $Int64(1947089649,1935189867),new $Int64(1510248801,203520055),new $Int64(842317902,3916463034),new $Int64(1758884993,3474113316),new $Int64(1036101639,316544223),new $Int64(373738757,1650844677),new $Int64(1240292229,4267565603),new $Int64(1077208624,2501167616),new $Int64(626831785,3929401789),new $Int64(56122796,337170252),new $Int64(1186981558,2061966842),new $Int64(1843292800,2508461464),new $Int64(206012532,2791377107),new $Int64(1240791848,1227227588),new $Int64(1813978778,1709681848),new $Int64(1153692192,3768820575),new $Int64(1145186199,2887126398),new $Int64(700372314,296561685),new $Int64(700300844,3729960077),new $Int64(575172304,372833036),new $Int64(2078875613,2409779288),new $Int64(1829161290,555274064),new $Int64(1041887929,4239804901),new $Int64(1839403216,3723486978),new $Int64(498390553,2145871984),new $Int64(564717933,3565480803),new $Int64(578829821,2197313814),new $Int64(974785092,3613674566),new $Int64(438638731,3042093666),new $Int64(2050927384,3324034321),new $Int64(869420878,3708873369),new $Int64(946682149,1698090092),new $Int64(1618900382,4213940712),new $Int64(304003901,2087477361),new $Int64(381315848,2407950639),new $Int64(851258090,3942568569),new $Int64(923583198,4088074412),new $Int64(723260036,2964773675),new $Int64(1473561819,1539178386),new $Int64(1062961552,2694849566),new $Int64(460977733,2120273838),new $Int64(542912908,2484608657),new $Int64(880846449,2956190677),new $Int64(1970902366,4223313749),new $Int64(662161910,3502682327),new $Int64(705634754,4133891139),new $Int64(1116124348,1166449596),new $Int64(1038247601,3362705993),new $Int64(93734798,3892921029),new $Int64(1876124043,786869787),new $Int64(1057490746,1046342263),new $Int64(242763728,493777327),new $Int64(1293910447,3304827646),new $Int64(616460742,125356352),new $Int64(499300063,74094113),new $Int64(1351896723,2500816079),new $Int64(1657235204,514015239),new $Int64(1377565129,543520454),new $Int64(107706923,3614531153),new $Int64(2056746300,2356753985),new $Int64(1390062617,2018141668),new $Int64(131272971,2087974891),new $Int64(644556607,3166972343),new $Int64(372256200,1517638666),new $Int64(1212207984,173466846),new $Int64(1451709187,4241513471),new $Int64(733932806,2783126920),new $Int64(1972004134,4167264826),new $Int64(29260506,3907395640),new $Int64(1236582087,1539634186),new $Int64(1551526350,178241987),new $Int64(2034206012,182168164),new $Int64(1044953189,2386154934),new $Int64(1379126408,4077374341),new $Int64(32803926,1732699140),new $Int64(1726425903,1041306002),new $Int64(1860414813,2068001749),new $Int64(1005320202,3208962910),new $Int64(844054010,697710380),new $Int64(638124245,2228431183),new $Int64(1337169671,3554678728),new $Int64(1396494601,173470263),new $Int64(2061597383,3848297795),new $Int64(1220546671,246236185),new $Int64(163293187,2066374846),new $Int64(1771673660,312890749),new $Int64(703378057,3573310289),new $Int64(1548631747,143166754),new $Int64(613554316,2081511079),new $Int64(1197802104,486038032),new $Int64(240999859,2982218564),new $Int64(364901986,1000939191),new $Int64(1902782651,2750454885),new $Int64(1475638791,3375313137),new $Int64(503615608,881302957),new $Int64(638698903,2514186393),new $Int64(443860803,360024739),new $Int64(1399671872,292500025),new $Int64(1381210821,2276300752),new $Int64(521803381,4069087683),new $Int64(208500981,1637778212),new $Int64(720490469,1676670893),new $Int64(1067262482,3855174429),new $Int64(2114075974,2067248671),new $Int64(2058057389,2884561259),new $Int64(1341742553,2456511185),new $Int64(983726246,561175414),new $Int64(427994085,432588903),new $Int64(885133709,4059399550),new $Int64(2054387382,1075014784),new $Int64(413651020,2728058415),new $Int64(1839142064,1299703678),new $Int64(1262333188,2347583393),new $Int64(1285481956,2468164145),new $Int64(989129637,1140014346),new $Int64(2033889184,1936972070),new $Int64(409904655,3870530098),new $Int64(1662989391,1717789158),new $Int64(1914486492,1153452491),new $Int64(1157059232,3948827651),new $Int64(790338018,2101413152),new $Int64(1495744672,3854091229),new $Int64(83644069,4215565463),new $Int64(762206335,1202710438),new $Int64(1582574611,2072216740),new $Int64(705690639,2066751068),new $Int64(33900336,173902580),new $Int64(1405499842,142459001),new $Int64(172391592,1889151926),new $Int64(1648540523,3034199774),new $Int64(1618587731,516490102),new $Int64(93114264,3692577783),new $Int64(68662295,2953948865),new $Int64(1826544975,4041040923),new $Int64(204965672,592046130),new $Int64(1441840008,384297211),new $Int64(95834184,265863924),new $Int64(2101717619,1333136237),new $Int64(1499611781,1406273556),new $Int64(1074670496,426305476),new $Int64(125704633,2750898176),new $Int64(488068495,1633944332),new $Int64(2037723464,3236349343),new $Int64(444060402,4013676611),new $Int64(1718532237,2265047407),new $Int64(1433593806,875071080),new $Int64(1804436145,1418843655),new $Int64(2009228711,451657300),new $Int64(1229446621,1866374663),new $Int64(1653472867,1551455622),new $Int64(577191481,3560962459),new $Int64(1669204077,3347903778),new $Int64(1849156454,2675874918),new $Int64(316128071,2762991672),new $Int64(530492383,3689068477),new $Int64(844089962,4071997905),new $Int64(1508155730,1381702441),new $Int64(2089931018,2373284878),new $Int64(1283216186,2143983064),new $Int64(308739063,1938207195),new $Int64(1754949306,1188152253),new $Int64(1272345009,615870490),new $Int64(742653194,2662252621),new $Int64(1477718295,3839976789),new $Int64(56149435,306752547),new $Int64(720795581,2162363077),new $Int64(2090431015,2767224719),new $Int64(675859549,2628837712),new $Int64(1678405918,2967771969),new $Int64(1694285728,499792248),new $Int64(403352367,4285253508),new $Int64(962357072,2856511070),new $Int64(679471692,2526409716),new $Int64(353777175,1240875658),new $Int64(1232590226,2577342868),new $Int64(1146185433,4136853496),new $Int64(670368674,2403540137),new $Int64(1372824515,1371410668),new $Int64(1970921600,371758825),new $Int64(1706420536,1528834084),new $Int64(2075795018,1504757260),new $Int64(685663576,699052551),new $Int64(1641940109,3347789870),new $Int64(1951619734,3430604759),new $Int64(2119672219,1935601723),new $Int64(966789690,834676166)]);N=M(new AC.ptr(new B.Mutex.ptr(false),K(new $Int64(0,1))));}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["math/big"]=(function(){var $pkg={},$init,E,J,H,A,I,C,B,G,F,D,X,BN,BV,BW,CQ,DC,DD,DE,DF,DH,DI,DK,DL,DM,DN,DP,BO,BX,BY,CD,CJ,CK,CP,CR,K,L,M,N,O,P,Q,R,S,T,U,V,Y,Z,AA,AB,AC,AE,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,BR,BS,BT,BU,CA,CB,CC,CE,CF,CG,CH,CI,CL,CM,CN,CO,CS;E=$packages["bytes"];J=$packages["encoding/binary"];H=$packages["errors"];A=$packages["fmt"];I=$packages["github.com/gopherjs/gopherjs/nosync"];C=$packages["io"];B=$packages["math"];G=$packages["math/rand"];F=$packages["strconv"];D=$packages["strings"];X=$pkg.Word=$newType(4,$kindUintptr,"big.Word","Word","math/big",null);BN=$pkg.Int=$newType(0,$kindStruct,"big.Int","Int","math/big",function(neg_,abs_){this.$val=this;if(arguments.length===0){this.neg=false;this.abs=BW.nil;return;}this.neg=neg_;this.abs=abs_;});BV=$pkg.byteReader=$newType(0,$kindStruct,"big.byteReader","byteReader","math/big",function(ScanState_){this.$val=this;if(arguments.length===0){this.ScanState=$ifaceNil;return;}this.ScanState=ScanState_;});BW=$pkg.nat=$newType(12,$kindSlice,"big.nat","nat","math/big",null);CQ=$pkg.divisor=$newType(0,$kindStruct,"big.divisor","divisor","math/big",function(bbb_,nbits_,ndigits_){this.$val=this;if(arguments.length===0){this.bbb=BW.nil;this.nbits=0;this.ndigits=0;return;}this.bbb=bbb_;this.nbits=nbits_;this.ndigits=ndigits_;});DC=$arrayType(CQ,64);DD=$structType([{prop:"Mutex",name:"",pkg:"",typ:I.Mutex,tag:""},{prop:"table",name:"table",pkg:"math/big",typ:DC,tag:""}]);DE=$sliceType($Uint8);DF=$sliceType($emptyInterface);DH=$sliceType(X);DI=$ptrType(BN);DK=$ptrType(X);DL=$arrayType(BW,16);DM=$ptrType(BW);DN=$sliceType(CQ);DP=$ptrType(G.Rand);K=function(m,n){var $ptr,m,n,o,p,q;o=0;p=0;q=AA(m,n);o=q[0];p=q[1];return[o,p];};L=function(m,n,o){var $ptr,m,n,o,p,q,r;p=0;q=0;r=AG(m,n,o);p=r[0];q=r[1];return[p,q];};M=function(m,n,o){var $ptr,m,n,o,p;p=0;p=AH(m,n,o);return p;};N=function(m,n,o){var $ptr,m,n,o,p;p=0;p=AI(m,n,o);return p;};O=function(m,n,o){var $ptr,m,n,o,p;p=0;p=AJ(m,n,o);return p;};P=function(m,n,o){var $ptr,m,n,o,p;p=0;p=AK(m,n,o);return p;};Q=function(m,n,o){var $ptr,m,n,o,p;p=0;p=AL(m,n,o);return p;};R=function(m,n,o){var $ptr,m,n,o,p;p=0;p=AM(m,n,o);return p;};S=function(m,n,o,p){var $ptr,m,n,o,p,q;q=0;q=AN(m,n,o,p);return q;};T=function(m,n,o){var $ptr,m,n,o,p;p=0;p=AO(m,n,o);return p;};U=function(m,n,o,p){var $ptr,m,n,o,p,q;q=0;q=AP(m,n,o,p);return q;};V=function(m){var $ptr,m,n;n=0;n=AC(m);return n;};Y=function(m,n,o){var $ptr,m,n,o,p,q,r;p=0;q=0;r=n+o>>>0;q=m+r>>>0;if(q>>0;q=m-r>>>0;if(q>m||r>>0;r=m>>>16>>>0;s=(n&65535)>>>0;t=n>>>16>>>0;u=$imul(q,s)>>>0;v=($imul(r,s)>>>0)+(u>>>16>>>0)>>>0;w=(v&65535)>>>0;x=v>>>16>>>0;w=w+(($imul(q,t)>>>0))>>>0;o=(($imul(r,t)>>>0)+x>>>0)+(w>>>16>>>0)>>>0;p=$imul(m,n)>>>0;return[o,p];};AB=function(m,n,o){var $ptr,m,n,o,p,q,r,s;p=0;q=0;r=AA(m,n);p=r[0];s=r[1];q=s+o>>>0;if(q>>0;}return[p,q];};AC=function(m){var $ptr,m,n,o,p,q,r;n=0;while(true){if(!(m>=32768)){break;}n=n+(16)>>0;m=(o=(16),o<32?(m>>>o):0)>>>0;}if(m>=128){m=(p=(8),p<32?(m>>>p):0)>>>0;n=n+(8)>>0;}if(m>=8){m=(q=(4),q<32?(m>>>q):0)>>>0;n=n+(4)>>0;}if(m>=2){m=(r=(2),r<32?(m>>>r):0)>>>0;n=n+(2)>>0;}if(m>=1){n=n+(1)>>0;}return n;};AE=function(m){var $ptr,m;return((32-V(m)>>0)>>>0);};AG=function(m,n,o){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,m,n,o,p,q,r,s,t,u,v,w,x,y,z;p=0;q=0;if(m>=o){r=4294967295;s=4294967295;p=r;q=s;return[p,q];}t=AE(o);o=(u=(t),u<32?(o<>>0;v=o>>>16>>>0;w=(o&65535)>>>0;z=(((x=t,x<32?(m<>>0)|((y=((32-t>>>0)),y<32?(n>>>y):0)>>>0))>>>0;ab=(aa=t,aa<32?(n<>>0;ac=ab>>>16>>>0;ad=(ab&65535)>>>0;af=(ae=z/v,(ae===ae&&ae!==1/0&&ae!==-1/0)?ae>>>0:$throwRuntimeError("integer divide by zero"));ag=z-($imul(af,v)>>>0)>>>0;while(true){if(!(af>=65536||($imul(af,w)>>>0)>(($imul(65536,ag)>>>0)+ac>>>0))){break;}af=af-(1)>>>0;ag=ag+(v)>>>0;if(ag>=65536){break;}}ah=(($imul(z,65536)>>>0)+ac>>>0)-($imul(af,o)>>>0)>>>0;aj=(ai=ah/v,(ai===ai&&ai!==1/0&&ai!==-1/0)?ai>>>0:$throwRuntimeError("integer divide by zero"));ag=ah-($imul(aj,v)>>>0)>>>0;while(true){if(!(aj>=65536||($imul(aj,w)>>>0)>(($imul(65536,ag)>>>0)+ad>>>0))){break;}aj=aj-(1)>>>0;ag=ag+(v)>>>0;if(ag>=65536){break;}}ak=($imul(af,65536)>>>0)+aj>>>0;al=(am=t,am<32?((((($imul(ah,65536)>>>0)+ad>>>0)-($imul(aj,o)>>>0)>>>0))>>>am):0)>>>0;p=ak;q=al;return[p,q];};AH=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u,v,w,x,y,z;p=0;if(false){q=m;r=0;while(true){if(!(r=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+s]),((s<0||s>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+s]),p);p=t[0];((s<0||s>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+s]=t[1]);r++;}return p;}u=$subslice(n,0,m.$length);v=0;while(true){if(!(v=u.$length)?$throwRuntimeError("index out of range"):u.$array[u.$offset+v]);y=((w<0||w>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+w]);z=(x+y>>>0)+p>>>0;((w<0||w>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+w]=z);p=(((((x&y)>>>0)|(((((x|y)>>>0))&~z)>>>0))>>>0))>>>31>>>0;v++;}return p;};AI=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u,v,w,x,y,z;p=0;if(false){q=m;r=0;while(true){if(!(r=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+s]),((s<0||s>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+s]),p);p=t[0];((s<0||s>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+s]=t[1]);r++;}return p;}u=$subslice(n,0,m.$length);v=0;while(true){if(!(v=u.$length)?$throwRuntimeError("index out of range"):u.$array[u.$offset+v]);y=((w<0||w>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+w]);z=(x-y>>>0)-p>>>0;((w<0||w>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+w]=z);p=(((((y&~x)>>>0)|(((((y|(~x>>>0))>>>0))&z)>>>0))>>>0))>>>31>>>0;v++;}return p;};AJ=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u,v,w,x,y;p=0;if(false){p=o;q=m;r=0;while(true){if(!(r=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+s]),p,0);p=t[0];((s<0||s>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+s]=t[1]);r++;}return p;}p=o;u=$subslice(n,0,m.$length);v=0;while(true){if(!(v=u.$length)?$throwRuntimeError("index out of range"):u.$array[u.$offset+v]);y=x+p>>>0;((w<0||w>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+w]=y);p=((x&~y)>>>0)>>>31>>>0;v++;}return p;};AK=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u,v,w,x,y;p=0;if(false){p=o;q=m;r=0;while(true){if(!(r=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+s]),p,0);p=t[0];((s<0||s>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+s]=t[1]);r++;}return p;}p=o;u=$subslice(n,0,m.$length);v=0;while(true){if(!(v=u.$length)?$throwRuntimeError("index out of range"):u.$array[u.$offset+v]);y=x-p>>>0;((w<0||w>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+w]=y);p=(((y&~x)>>>0))>>>31>>>0;v++;}return p;};AL=function(m,n,o){var $ptr,aa,m,n,o,p,q,r,s,t,u,v,w,x,y,z;p=0;q=m.$length;if(q>0){r=32-o>>>0;t=(s=q-1>>0,((s<0||s>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+s]));p=(u=r,u<32?(t>>>u):0)>>>0;v=q-1>>0;while(true){if(!(v>0)){break;}w=t;t=(x=v-1>>0,((x<0||x>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+x]));((v<0||v>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+v]=((((y=o,y<32?(w<>>0)|((z=r,z<32?(t>>>z):0)>>>0))>>>0));v=v-(1)>>0;}(0>=m.$length?$throwRuntimeError("index out of range"):m.$array[m.$offset+0]=((aa=o,aa<32?(t<>>0));}return p;};AM=function(m,n,o){var $ptr,aa,m,n,o,p,q,r,s,t,u,v,w,x,y,z;p=0;q=m.$length;if(q>0){r=32-o>>>0;s=(0>=n.$length?$throwRuntimeError("index out of range"):n.$array[n.$offset+0]);p=(t=r,t<32?(s<>>0;u=0;while(true){if(!(u<(q-1>>0))){break;}v=s;s=(w=u+1>>0,((w<0||w>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+w]));((u<0||u>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+u]=((((x=o,x<32?(v>>>x):0)>>>0)|((y=r,y<32?(s<>>0))>>>0));u=u+(1)>>0;}(aa=q-1>>0,((aa<0||aa>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+aa]=((z=o,z<32?(s>>>z):0)>>>0)));}return p;};AN=function(m,n,o,p){var $ptr,m,n,o,p,q,r,s,t,u;q=0;q=p;r=m;s=0;while(true){if(!(s=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+t]),o,q);q=u[0];((t<0||t>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+t]=u[1]);s++;}return q;};AO=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u,v,w;p=0;q=m;r=0;while(true){if(!(r=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+s]),o,((s<0||s>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+s]));u=t[0];v=t[1];w=Y(v,p,0);p=w[0];((s<0||s>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+s]=w[1]);p=p+(u)>>>0;r++;}return p;};AP=function(m,n,o,p){var $ptr,m,n,o,p,q,r,s;q=0;q=n;r=m.$length-1>>0;while(true){if(!(r>=0)){break;}s=AG(q,((r<0||r>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+r]),p);((r<0||r>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+r]=s[0]);q=s[1];r=r-(1)>>0;}return q;};BN.ptr.prototype.Sign=function(){var $ptr,m;m=this;if(m.abs.$length===0){return 0;}if(m.neg){return-1;}return 1;};BN.prototype.Sign=function(){return this.$val.Sign();};BN.ptr.prototype.SetInt64=function(m){var $ptr,m,n,o;n=this;o=false;if((m.$high<0||(m.$high===0&&m.$low<0))){o=true;m=new $Int64(-m.$high,-m.$low);}n.abs=n.abs.setUint64(new $Uint64(m.$high,m.$low));n.neg=o;return n;};BN.prototype.SetInt64=function(m){return this.$val.SetInt64(m);};BN.ptr.prototype.SetUint64=function(m){var $ptr,m,n;n=this;n.abs=n.abs.setUint64(m);n.neg=false;return n;};BN.prototype.SetUint64=function(m){return this.$val.SetUint64(m);};BN.ptr.prototype.Set=function(m){var $ptr,m,n;n=this;if(!(n===m)){n.abs=n.abs.set(m.abs);n.neg=m.neg;}return n;};BN.prototype.Set=function(m){return this.$val.Set(m);};BN.ptr.prototype.Bits=function(){var $ptr,m,n;m=this;return(n=m.abs,$subslice(new DH(n.$array),n.$offset,n.$offset+n.$length));};BN.prototype.Bits=function(){return this.$val.Bits();};BN.ptr.prototype.SetBits=function(m){var $ptr,m,n;n=this;n.abs=$subslice(new BW(m.$array),m.$offset,m.$offset+m.$length).norm();n.neg=false;return n;};BN.prototype.SetBits=function(m){return this.$val.SetBits(m);};BN.ptr.prototype.Abs=function(m){var $ptr,m,n;n=this;n.Set(m);n.neg=false;return n;};BN.prototype.Abs=function(m){return this.$val.Abs(m);};BN.ptr.prototype.Neg=function(m){var $ptr,m,n;n=this;n.Set(m);n.neg=n.abs.$length>0&&!n.neg;return n;};BN.prototype.Neg=function(m){return this.$val.Neg(m);};BN.ptr.prototype.Add=function(m,n){var $ptr,m,n,o,p;o=this;p=m.neg;if(m.neg===n.neg){o.abs=o.abs.add(m.abs,n.abs);}else{if(m.abs.cmp(n.abs)>=0){o.abs=o.abs.sub(m.abs,n.abs);}else{p=!p;o.abs=o.abs.sub(n.abs,m.abs);}}o.neg=o.abs.$length>0&&p;return o;};BN.prototype.Add=function(m,n){return this.$val.Add(m,n);};BN.ptr.prototype.Sub=function(m,n){var $ptr,m,n,o,p;o=this;p=m.neg;if(!(m.neg===n.neg)){o.abs=o.abs.add(m.abs,n.abs);}else{if(m.abs.cmp(n.abs)>=0){o.abs=o.abs.sub(m.abs,n.abs);}else{p=!p;o.abs=o.abs.sub(n.abs,m.abs);}}o.neg=o.abs.$length>0&&p;return o;};BN.prototype.Sub=function(m,n){return this.$val.Sub(m,n);};BN.ptr.prototype.Mul=function(m,n){var $ptr,m,n,o;o=this;o.abs=o.abs.mul(m.abs,n.abs);o.neg=o.abs.$length>0&&!(m.neg===n.neg);return o;};BN.prototype.Mul=function(m,n){return this.$val.Mul(m,n);};BN.ptr.prototype.MulRange=function(m,n){var $ptr,m,n,o,p,q,r,s,t;o=this;if((m.$high>n.$high||(m.$high===n.$high&&m.$low>n.$low))){return o.SetInt64(new $Int64(0,1));}else if((m.$high<0||(m.$high===0&&m.$low<=0))&&(n.$high>0||(n.$high===0&&n.$low>=0))){return o.SetInt64(new $Int64(0,0));}p=false;if((m.$high<0||(m.$high===0&&m.$low<0))){p=(q=(r=new $Int64(n.$high-m.$high,n.$low-m.$low),new $Int64(r.$high&0,(r.$low&1)>>>0)),(q.$high===0&&q.$low===0));s=new $Int64(-n.$high,-n.$low);t=new $Int64(-m.$high,-m.$low);m=s;n=t;}o.abs=o.abs.mulRange(new $Uint64(m.$high,m.$low),new $Uint64(n.$high,n.$low));o.neg=p;return o;};BN.prototype.MulRange=function(m,n){return this.$val.MulRange(m,n);};BN.ptr.prototype.Binomial=function(m,n){var $ptr,m,n,o,p,q,r,s,t,u;o=this;if((p=$div64(m,new $Int64(0,2),false),(p.$high0&&!(m.neg===n.neg);return o;};BN.prototype.Quo=function(m,n){return this.$val.Quo(m,n);};BN.ptr.prototype.Rem=function(m,n){var $ptr,m,n,o,p;o=this;p=BW.nil.div(o.abs,m.abs,n.abs);o.abs=p[1];o.neg=o.abs.$length>0&&m.neg;return o;};BN.prototype.Rem=function(m,n){return this.$val.Rem(m,n);};BN.ptr.prototype.QuoRem=function(m,n,o){var $ptr,m,n,o,p,q,r,s;p=this;q=p.abs.div(o.abs,m.abs,n.abs);p.abs=q[0];o.abs=q[1];r=p.abs.$length>0&&!(m.neg===n.neg);s=o.abs.$length>0&&m.neg;p.neg=r;o.neg=s;return[p,o];};BN.prototype.QuoRem=function(m,n,o){return this.$val.QuoRem(m,n,o);};BN.ptr.prototype.Div=function(m,n){var $ptr,m,n,o,p,q;o=this;p=n.neg;q=new BN.ptr(false,BW.nil);o.QuoRem(m,n,q);if(q.neg){if(p){o.Add(o,BO);}else{o.Sub(o,BO);}}return o;};BN.prototype.Div=function(m,n){return this.$val.Div(m,n);};BN.ptr.prototype.Mod=function(m,n){var $ptr,m,n,o,p,q;o=this;p=n;if(o===n||CF(o.abs,n.abs)){p=new BN.ptr(false,BW.nil).Set(n);}q=new BN.ptr(false,BW.nil);q.QuoRem(m,n,o);if(o.neg){if(p.neg){o.Sub(o,p);}else{o.Add(o,p);}}return o;};BN.prototype.Mod=function(m,n){return this.$val.Mod(m,n);};BN.ptr.prototype.DivMod=function(m,n,o){var $ptr,m,n,o,p,q;p=this;q=n;if(p===n||CF(p.abs,n.abs)){q=new BN.ptr(false,BW.nil).Set(n);}p.QuoRem(m,n,o);if(o.neg){if(q.neg){p.Add(p,BO);o.Sub(o,q);}else{p.Sub(p,BO);o.Add(o,q);}}return[p,o];};BN.prototype.DivMod=function(m,n,o){return this.$val.DivMod(m,n,o);};BN.ptr.prototype.Cmp=function(m){var $ptr,m,n,o;n=0;o=this;if(o.neg===m.neg){n=o.abs.cmp(m.abs);if(o.neg){n=-n;}}else if(o.neg){n=-1;}else{n=1;}return n;};BN.prototype.Cmp=function(m){return this.$val.Cmp(m);};BR=function(m){var $ptr,m,n,o,p,q;if(m.$length===0){return new $Uint64(0,0);}o=(n=(0>=m.$length?$throwRuntimeError("index out of range"):m.$array[m.$offset+0]),new $Uint64(0,n.constructor===Number?n:1));if(true&&m.$length>1){o=(p=$shiftLeft64((q=(1>=m.$length?$throwRuntimeError("index out of range"):m.$array[m.$offset+1]),new $Uint64(0,q.constructor===Number?q:1)),32),new $Uint64(o.$high|p.$high,(o.$low|p.$low)>>>0));}return o;};BN.ptr.prototype.Int64=function(){var $ptr,m,n,o;m=this;o=(n=BR(m.abs),new $Int64(n.$high,n.$low));if(m.neg){o=new $Int64(-o.$high,-o.$low);}return o;};BN.prototype.Int64=function(){return this.$val.Int64();};BN.ptr.prototype.Uint64=function(){var $ptr,m;m=this;return BR(m.abs);};BN.prototype.Uint64=function(){return this.$val.Uint64();};BN.ptr.prototype.SetString=function(m,n){var $ptr,m,n,o,p,q,r,s,t,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:o=this;p=D.NewReader(m);r=o.scan(p,n);$s=1;case 1:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}q=r;s=q[2];if(!($interfaceIsEqual(s,$ifaceNil))){return[DI.nil,false];}t=p.ReadByte();s=t[1];if(!($interfaceIsEqual(s,C.EOF))){return[DI.nil,false];}return[o,true];}return;}if($f===undefined){$f={$blk:BN.ptr.prototype.SetString};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.$s=$s;$f.$r=$r;return $f;};BN.prototype.SetString=function(m,n){return this.$val.SetString(m,n);};BN.ptr.prototype.SetBytes=function(m){var $ptr,m,n;n=this;n.abs=n.abs.setBytes(m);n.neg=false;return n;};BN.prototype.SetBytes=function(m){return this.$val.SetBytes(m);};BN.ptr.prototype.Bytes=function(){var $ptr,m,n;m=this;n=$makeSlice(DE,($imul(m.abs.$length,4)));return $subslice(n,m.abs.bytes(n));};BN.prototype.Bytes=function(){return this.$val.Bytes();};BN.ptr.prototype.BitLen=function(){var $ptr,m;m=this;return m.abs.bitLen();};BN.prototype.BitLen=function(){return this.$val.BitLen();};BN.ptr.prototype.Exp=function(m,n,o){var $ptr,m,n,o,p,q,r;p=this;q=BW.nil;if(!n.neg){q=n.abs;}r=BW.nil;if(!(o===DI.nil)){r=o.abs;}p.abs=p.abs.expNN(m.abs,q,r);p.neg=p.abs.$length>0&&m.neg&&q.$length>0&&((((0>=q.$length?$throwRuntimeError("index out of range"):q.$array[q.$offset+0])&1)>>>0)===1);if(p.neg&&r.$length>0){p.abs=p.abs.sub(r,p.abs);p.neg=false;}return p;};BN.prototype.Exp=function(m,n,o){return this.$val.Exp(m,n,o);};BN.ptr.prototype.GCD=function(m,n,o,p){var $ptr,aa,ab,ac,m,n,o,p,q,r,s,t,u,v,w,x,y,z;q=this;if(o.Sign()<=0||p.Sign()<=0){q.SetInt64(new $Int64(0,0));if(!(m===DI.nil)){m.SetInt64(new $Int64(0,0));}if(!(n===DI.nil)){n.SetInt64(new $Int64(0,0));}return q;}if(m===DI.nil&&n===DI.nil){return q.binaryGCD(o,p);}r=new BN.ptr(false,BW.nil).Set(o);s=new BN.ptr(false,BW.nil).Set(p);t=new BN.ptr(false,BW.nil);u=new BN.ptr(false,BW.nil).SetInt64(new $Int64(0,1));v=new BN.ptr(false,BW.nil).SetInt64(new $Int64(0,1));w=new BN.ptr(false,BW.nil);x=new BN.ptr(false,BW.nil);y=new BN.ptr(false,BW.nil);while(true){if(!(s.abs.$length>0)){break;}z=new BN.ptr(false,BW.nil);aa=x.QuoRem(r,s,z);x=aa[0];z=aa[1];ab=s;ac=z;r=ab;s=ac;y.Set(t);t.Mul(t,x);t.neg=!t.neg;t.Add(t,v);v.Set(y);y.Set(u);u.Mul(u,x);u.neg=!u.neg;u.Add(u,w);w.Set(y);}if(!(m===DI.nil)){BN.copy(m,v);}if(!(n===DI.nil)){BN.copy(n,w);}BN.copy(q,r);return q;};BN.prototype.GCD=function(m,n,o,p){return this.$val.GCD(m,n,o,p);};BN.ptr.prototype.binaryGCD=function(m,n){var $ptr,m,n,o,p,q,r,s,t,u,v,w,x,y;o=this;p=o;q=new BN.ptr(false,BW.nil);if(m.abs.$length>n.abs.$length){q.Rem(m,n);p.Set(n);}else if(m.abs.$length=u.$length?$throwRuntimeError("index out of range"):u.$array[u.$offset+0]))&1)>>>0)===0))){t.Neg(q);}else{t.Set(p);}while(true){if(!(t.abs.$length>0)){break;}t.Rsh(t,t.abs.trailingZeroBits());if(t.neg){v=t;w=q;q=v;t=w;q.neg=q.abs.$length>0&&!q.neg;}else{x=t;y=p;p=x;t=y;}t.Sub(p,q);}return o.Lsh(p,r);};BN.prototype.binaryGCD=function(m,n){return this.$val.binaryGCD(m,n);};BN.ptr.prototype.ProbablyPrime=function(m){var $ptr,m,n,o,p,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=this;if(m<=0){$panic(new $String("non-positive n for ProbablyPrime"));}if(!(!n.neg)){o=false;$s=1;continue s;}p=n.abs.probablyPrime(m);$s=2;case 2:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}o=p;case 1:$s=3;case 3:return o;}return;}if($f===undefined){$f={$blk:BN.ptr.prototype.ProbablyPrime};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.$s=$s;$f.$r=$r;return $f;};BN.prototype.ProbablyPrime=function(m){return this.$val.ProbablyPrime(m);};BN.ptr.prototype.Rand=function(m,n){var $ptr,m,n,o,p,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:o=this;o.neg=false;if(n.neg||(n.abs.$length===0)){o.abs=BW.nil;return o;}p=o.abs.random(m,n.abs,n.abs.bitLen());$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}o.abs=p;return o;}return;}if($f===undefined){$f={$blk:BN.ptr.prototype.Rand};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.$s=$s;$f.$r=$r;return $f;};BN.prototype.Rand=function(m,n){return this.$val.Rand(m,n);};BN.ptr.prototype.ModInverse=function(m,n){var $ptr,m,n,o,p;o=this;p=new BN.ptr(false,BW.nil);p.GCD(o,DI.nil,m,n);if(o.neg){o.Add(o,n);}return o;};BN.prototype.ModInverse=function(m,n){return this.$val.ModInverse(m,n);};BS=function(m,n){var $ptr,aa,ab,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:o=[o];p=[p];q=[q];if((n.abs.$length===0)||((((r=n.abs,(0>=r.$length?$throwRuntimeError("index out of range"):r.$array[r.$offset+0]))&1)>>>0)===0)){$s=1;continue;}$s=2;continue;case 1:s=A.Sprintf("big: invalid 2nd argument to Int.Jacobi: need odd integer but got %s",new DF([n]));$s=3;case 3:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}$panic(new $String(s));case 2:t=new BN.ptr(false,BW.nil);u=new BN.ptr(false,BW.nil);v=new BN.ptr(false,BW.nil);q[0]=$clone(t,BN);o[0]=$clone(u,BN);p[0]=$clone(v,BN);q[0].Set(m);o[0].Set(n);w=1;if(o[0].neg){if(q[0].neg){w=-1;}o[0].neg=false;}while(true){if(o[0].Cmp(BO)===0){return w;}if(q[0].abs.$length===0){return 0;}q[0].Mod(q[0],o[0]);if(q[0].abs.$length===0){return 0;}x=q[0].abs.trailingZeroBits();if(!((((x&1)>>>0)===0))){z=((y=o[0].abs,(0>=y.$length?$throwRuntimeError("index out of range"):y.$array[y.$offset+0]))&7)>>>0;if((z===3)||(z===5)){w=-w;}}p[0].Rsh(q[0],x);if(((((aa=o[0].abs,(0>=aa.$length?$throwRuntimeError("index out of range"):aa.$array[aa.$offset+0]))&3)>>>0)===3)&&((((ab=p[0].abs,(0>=ab.$length?$throwRuntimeError("index out of range"):ab.$array[ab.$offset+0]))&3)>>>0)===3)){w=-w;}q[0].Set(o[0]);o[0].Set(p[0]);}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BS};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Jacobi=BS;BN.ptr.prototype.modSqrt3Mod4Prime=function(m,n){var $ptr,m,n,o;o=this;o.Set(n);o.Add(o,BO);o.Rsh(o,2);o.Exp(m,o,n);return o;};BN.prototype.modSqrt3Mod4Prime=function(m,n){return this.$val.modSqrt3Mod4Prime(m,n);};BN.ptr.prototype.modSqrtTonelliShanks=function(m,n){var $ptr,aa,ab,ac,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:o=[o];p=[p];q=[q];r=[r];s=[s];t=[t];u=this;q[0]=new BN.ptr(false,BW.nil);q[0].Sub(n,BO);v=q[0].abs.trailingZeroBits();q[0].Rsh(q[0],v);r[0]=new BN.ptr(false,BW.nil);r[0].SetInt64(new $Int64(0,2));case 1:w=BS(r[0],n);$s=3;case 3:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}if(!(!((w===-1)))){$s=2;continue;}r[0].Add(r[0],BO);$s=1;continue;case 2:x=new BN.ptr(false,BW.nil);y=new BN.ptr(false,BW.nil);z=new BN.ptr(false,BW.nil);aa=new BN.ptr(false,BW.nil);s[0]=$clone(x,BN);t[0]=$clone(y,BN);p[0]=$clone(z,BN);o[0]=$clone(aa,BN);s[0].Add(q[0],BO);s[0].Rsh(s[0],1);s[0].Exp(m,s[0],n);t[0].Exp(m,q[0],n);p[0].Exp(r[0],q[0],n);ab=v;while(true){ac=0;o[0].Set(t[0]);while(true){if(!(!((o[0].Cmp(BO)===0)))){break;}o[0].Mul(o[0],o[0]).Mod(o[0],n);ac=ac+(1)>>>0;}if(ac===0){return u.Set(s[0]);}o[0].SetInt64(new $Int64(0,0)).SetBit(o[0],(((ab-ac>>>0)-1>>>0)>>0),1).Exp(p[0],o[0],n);p[0].Mul(o[0],o[0]).Mod(p[0],n);s[0].Mul(s[0],o[0]).Mod(s[0],n);t[0].Mul(t[0],p[0]).Mod(t[0],n);ab=ac;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BN.ptr.prototype.modSqrtTonelliShanks};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};BN.prototype.modSqrtTonelliShanks=function(m,n){return this.$val.modSqrtTonelliShanks(m,n);};BN.ptr.prototype.ModSqrt=function(m,n){var $ptr,m,n,o,p,q,r,s,t,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:o=this;p=BS(m,n);$s=2;case 2:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;if(q===(-1)){return DI.nil;}else if(q===(0)){return o.SetInt64(new $Int64(0,0));}else if(q===(1)){$s=1;continue;}case 1:if(m.neg||m.Cmp(n)>=0){m=new BN.ptr(false,BW.nil).Mod(m,n);}if(n.abs.$length>0&&((r=(s=n.abs,(0>=s.$length?$throwRuntimeError("index out of range"):s.$array[s.$offset+0]))%4,r===r?r:$throwRuntimeError("integer divide by zero"))===3)){return o.modSqrt3Mod4Prime(m,n);}t=o.modSqrtTonelliShanks(m,n);$s=3;case 3:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}$s=4;case 4:return t;}return;}if($f===undefined){$f={$blk:BN.ptr.prototype.ModSqrt};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.$s=$s;$f.$r=$r;return $f;};BN.prototype.ModSqrt=function(m,n){return this.$val.ModSqrt(m,n);};BN.ptr.prototype.Lsh=function(m,n){var $ptr,m,n,o;o=this;o.abs=o.abs.shl(m.abs,n);o.neg=m.neg;return o;};BN.prototype.Lsh=function(m,n){return this.$val.Lsh(m,n);};BN.ptr.prototype.Rsh=function(m,n){var $ptr,m,n,o,p;o=this;if(m.neg){p=o.abs.sub(m.abs,BX);p=p.shr(p,n);o.abs=p.add(p,BX);o.neg=true;return o;}o.abs=o.abs.shr(m.abs,n);o.neg=false;return o;};BN.prototype.Rsh=function(m,n){return this.$val.Rsh(m,n);};BN.ptr.prototype.Bit=function(m){var $ptr,m,n,o,p;n=this;if(m===0){if(n.abs.$length>0){return((((o=n.abs,(0>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0]))&1)>>>0)>>>0);}return 0;}if(m<0){$panic(new $String("negative bit index"));}if(n.neg){p=BW.nil.sub(n.abs,BX);return(p.bit((m>>>0))^1)>>>0;}return n.abs.bit((m>>>0));};BN.prototype.Bit=function(m){return this.$val.Bit(m);};BN.ptr.prototype.SetBit=function(m,n,o){var $ptr,m,n,o,p,q;p=this;if(n<0){$panic(new $String("negative bit index"));}if(m.neg){q=p.abs.sub(m.abs,BX);q=q.setBit(q,(n>>>0),(o^1)>>>0);p.abs=q.add(q,BX);p.neg=p.abs.$length>0;return p;}p.abs=p.abs.setBit(m.abs,(n>>>0),o);p.neg=false;return p;};BN.prototype.SetBit=function(m,n,o){return this.$val.SetBit(m,n,o);};BN.ptr.prototype.And=function(m,n){var $ptr,m,n,o,p,q,r,s,t;o=this;if(m.neg===n.neg){if(m.neg){p=BW.nil.sub(m.abs,BX);q=BW.nil.sub(n.abs,BX);o.abs=o.abs.add(o.abs.or(p,q),BX);o.neg=true;return o;}o.abs=o.abs.and(m.abs,n.abs);o.neg=false;return o;}if(m.neg){r=n;s=m;m=r;n=s;}t=BW.nil.sub(n.abs,BX);o.abs=o.abs.andNot(m.abs,t);o.neg=false;return o;};BN.prototype.And=function(m,n){return this.$val.And(m,n);};BN.ptr.prototype.AndNot=function(m,n){var $ptr,m,n,o,p,q,r,s;o=this;if(m.neg===n.neg){if(m.neg){p=BW.nil.sub(m.abs,BX);q=BW.nil.sub(n.abs,BX);o.abs=o.abs.andNot(q,p);o.neg=false;return o;}o.abs=o.abs.andNot(m.abs,n.abs);o.neg=false;return o;}if(m.neg){r=BW.nil.sub(m.abs,BX);o.abs=o.abs.add(o.abs.or(r,n.abs),BX);o.neg=true;return o;}s=BW.nil.sub(n.abs,BX);o.abs=o.abs.and(m.abs,s);o.neg=false;return o;};BN.prototype.AndNot=function(m,n){return this.$val.AndNot(m,n);};BN.ptr.prototype.Or=function(m,n){var $ptr,m,n,o,p,q,r,s,t;o=this;if(m.neg===n.neg){if(m.neg){p=BW.nil.sub(m.abs,BX);q=BW.nil.sub(n.abs,BX);o.abs=o.abs.add(o.abs.and(p,q),BX);o.neg=true;return o;}o.abs=o.abs.or(m.abs,n.abs);o.neg=false;return o;}if(m.neg){r=n;s=m;m=r;n=s;}t=BW.nil.sub(n.abs,BX);o.abs=o.abs.add(o.abs.andNot(t,m.abs),BX);o.neg=true;return o;};BN.prototype.Or=function(m,n){return this.$val.Or(m,n);};BN.ptr.prototype.Xor=function(m,n){var $ptr,m,n,o,p,q,r,s,t;o=this;if(m.neg===n.neg){if(m.neg){p=BW.nil.sub(m.abs,BX);q=BW.nil.sub(n.abs,BX);o.abs=o.abs.xor(p,q);o.neg=false;return o;}o.abs=o.abs.xor(m.abs,n.abs);o.neg=false;return o;}if(m.neg){r=n;s=m;m=r;n=s;}t=BW.nil.sub(n.abs,BX);o.abs=o.abs.add(o.abs.xor(m.abs,t),BX);o.neg=true;return o;};BN.prototype.Xor=function(m,n){return this.$val.Xor(m,n);};BN.ptr.prototype.Not=function(m){var $ptr,m,n;n=this;if(m.neg){n.abs=n.abs.sub(m.abs,BX);n.neg=false;return n;}n.abs=n.abs.add(m.abs,BX);n.neg=true;return n;};BN.prototype.Not=function(m){return this.$val.Not(m);};BN.ptr.prototype.Text=function(m){var $ptr,m,n;n=this;if(n===DI.nil){return"";}return $bytesToString(n.abs.itoa(n.neg,m));};BN.prototype.Text=function(m){return this.$val.Text(m);};BN.ptr.prototype.Append=function(m,n){var $ptr,m,n,o;o=this;if(o===DI.nil){return $appendSlice(m,"");}return $appendSlice(m,o.abs.itoa(o.neg,n));};BN.prototype.Append=function(m,n){return this.$val.Append(m,n);};BN.ptr.prototype.String=function(){var $ptr,m;m=this;return m.Text(10);};BN.prototype.String=function(){return this.$val.String();};BT=function(m,n,o){var $ptr,m,n,o,p,q,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:if(n.length>0){$s=1;continue;}$s=2;continue;case 1:p=new DE($stringToBytes(n));case 3:if(!(o>0)){$s=4;continue;}q=m.Write(p);$s=5;case 5:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}q;o=o-(1)>>0;$s=3;continue;case 4:case 2:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BT};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.$s=$s;$f.$r=$r;return $f;};BN.ptr.prototype.Format=function(m,n){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:o=this;p=0;q=n;if(q===(98)){$s=2;continue;}if(q===(111)){$s=3;continue;}if((q===(100))||(q===(115))||(q===(118))){$s=4;continue;}if((q===(120))||(q===(88))){$s=5;continue;}$s=6;continue;case 2:p=2;$s=7;continue;case 3:p=8;$s=7;continue;case 4:p=10;$s=7;continue;case 5:p=16;$s=7;continue;case 6:r=A.Fprintf(m,"%%!%c(big.Int=%s)",new DF([new $Int32(n),new $String(o.String())]));$s=8;case 8:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}r;return;case 7:case 1:if(o===DI.nil){$s=9;continue;}$s=10;continue;case 9:s=A.Fprint(m,new DF([new $String("")]));$s=11;case 11:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}s;return;case 10:t="";if(o.neg){$s=13;continue;}u=m.Flag(43);$s=17;case 17:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}if(u){$s=14;continue;}v=m.Flag(32);$s=18;case 18:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}if(v){$s=15;continue;}$s=16;continue;case 13:t="-";$s=16;continue;case 14:t="+";$s=16;continue;case 15:t=" ";case 16:case 12:w="";x=m.Flag(35);$s=21;case 21:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}if(x){$s=19;continue;}$s=20;continue;case 19:y=n;if(y===(111)){w="0";}else if(y===(120)){w="0x";}else if(y===(88)){w="0X";}case 20:z=o.abs.utoa(p);if(n===88){aa=z;ab=0;while(true){if(!(ab=aa.$length)?$throwRuntimeError("index out of range"):aa.$array[aa.$offset+ab]);if(97<=ad&&ad<=122){((ac<0||ac>=z.$length)?$throwRuntimeError("index out of range"):z.$array[z.$offset+ac]=(65+((ad-97<<24>>>24))<<24>>>24));}ab++;}}ae=0;af=0;ag=0;ai=m.Precision();$s=22;case 22:if($c){$c=false;ai=ai.$blk();}if(ai&&ai.$blk!==undefined){break s;}ah=ai;aj=ah[0];ak=ah[1];if(ak){if(z.$length>0;}else if((z.$length===1)&&((0>=z.$length?$throwRuntimeError("index out of range"):z.$array[z.$offset+0])===48)&&(aj===0)){return;}}al=((t.length+w.length>>0)+af>>0)+z.$length>>0;an=m.Width();$s=23;case 23:if($c){$c=false;an=an.$blk();}if(an&&an.$blk!==undefined){break s;}am=an;ao=am[0];ap=am[1];if(ap&&al>0;ar=m.Flag(45);$s=31;case 31:if($c){$c=false;ar=ar.$blk();}if(ar&&ar.$blk!==undefined){break s;}if(ar){$s=27;continue;}as=m.Flag(48);$s=32;case 32:if($c){$c=false;as=as.$blk();}if(as&&as.$blk!==undefined){break s;}if(as&&!ak){$s=28;continue;}$s=29;continue;case 27:ag=aq;$s=30;continue;case 28:af=aq;$s=30;continue;case 29:ae=aq;case 30:case 26:case 25:$r=BT(m," ",ae);$s=33;case 33:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=BT(m,t,1);$s=34;case 34:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=BT(m,w,1);$s=35;case 35:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=BT(m,"0",af);$s=36;case 36:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}at=m.Write(z);$s=37;case 37:if($c){$c=false;at=at.$blk();}if(at&&at.$blk!==undefined){break s;}at;$r=BT(m," ",ag);$s=38;case 38:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BN.ptr.prototype.Format};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};BN.prototype.Format=function(m,n){return this.$val.Format(m,n);};BN.ptr.prototype.scan=function(m,n){var $ptr,m,n,o,p,q,r,s,t,u,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:o=this;q=BU(m);$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}p=q;r=p[0];s=p[1];if(!($interfaceIsEqual(s,$ifaceNil))){return[DI.nil,0,s];}u=o.abs.scan(m,n,false);$s=2;case 2:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}t=u;o.abs=t[0];n=t[1];s=t[3];if(!($interfaceIsEqual(s,$ifaceNil))){return[DI.nil,n,s];}o.neg=o.abs.$length>0&&r;return[o,n,$ifaceNil];}return;}if($f===undefined){$f={$blk:BN.ptr.prototype.scan};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.$s=$s;$f.$r=$r;return $f;};BN.prototype.scan=function(m,n){return this.$val.scan(m,n);};BU=function(m){var $ptr,m,n,o,p,q,r,s,t,u,v,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=false;o=$ifaceNil;p=0;r=m.ReadByte();$s=1;case 1:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}q=r;p=q[0];o=q[1];if(!($interfaceIsEqual(o,$ifaceNil))){s=false;t=o;n=s;o=t;return[n,o];}u=p;if(u===(45)){$s=3;continue;}if(u===(43)){$s=4;continue;}$s=5;continue;case 3:n=true;$s=6;continue;case 4:$s=6;continue;case 5:v=m.UnreadByte();$s=7;case 7:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}v;case 6:case 2:return[n,o];}return;}if($f===undefined){$f={$blk:BU};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.$s=$s;$f.$r=$r;return $f;};BV.ptr.prototype.ReadByte=function(){var $ptr,m,n,o,p,q,r,s,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BV);o=m.ScanState.ReadRune();$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}n=o;p=n[0];q=n[1];r=n[2];if(!((q===1))&&$interfaceIsEqual(r,$ifaceNil)){$s=2;continue;}$s=3;continue;case 2:s=A.Errorf("invalid rune %#U",new DF([new $Int32(p)]));$s=4;case 4:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}r=s;case 3:return[(p<<24>>>24),r];}return;}if($f===undefined){$f={$blk:BV.ptr.prototype.ReadByte};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.$s=$s;$f.$r=$r;return $f;};BV.prototype.ReadByte=function(){return this.$val.ReadByte();};BV.ptr.prototype.UnreadByte=function(){var $ptr,m,n,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:m=$clone(this,BV);n=m.ScanState.UnreadRune();$s=1;case 1:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}$s=2;case 2:return n;}return;}if($f===undefined){$f={$blk:BV.ptr.prototype.UnreadByte};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.$s=$s;$f.$r=$r;return $f;};BV.prototype.UnreadByte=function(){return this.$val.UnreadByte();};BN.ptr.prototype.Scan=function(m,n){var $ptr,m,n,o,p,q,r,s,t,u,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:o=this;$r=m.SkipSpace();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}p=0;q=n;if(q===(98)){p=2;}else if(q===(111)){p=8;}else if(q===(100)){p=10;}else if((q===(120))||(q===(88))){p=16;}else if((q===(115))||(q===(118))){}else{return H.New("Int.Scan: invalid verb");}t=o.scan((s=new BV.ptr(m),new s.constructor.elem(s)),p);$s=2;case 2:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}r=t;u=r[2];return u;}return;}if($f===undefined){$f={$blk:BN.ptr.prototype.Scan};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.$s=$s;$f.$r=$r;return $f;};BN.prototype.Scan=function(m,n){return this.$val.Scan(m,n);};BN.ptr.prototype.GobEncode=function(){var $ptr,m,n,o,p;m=this;if(m===DI.nil){return[DE.nil,$ifaceNil];}n=$makeSlice(DE,(1+($imul(m.abs.$length,4))>>0));o=m.abs.bytes(n)-1>>0;p=2;if(m.neg){p=(p|(1))>>>0;}((o<0||o>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+o]=p);return[$subslice(n,o),$ifaceNil];};BN.prototype.GobEncode=function(){return this.$val.GobEncode();};BN.ptr.prototype.GobDecode=function(m){var $ptr,m,n,o,p,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=this;if(m.$length===0){BN.copy(n,new BN.ptr(false,BW.nil));return $ifaceNil;}o=(0>=m.$length?$throwRuntimeError("index out of range"):m.$array[m.$offset+0]);if(!(((o>>>1<<24>>>24)===1))){$s=1;continue;}$s=2;continue;case 1:p=A.Errorf("Int.GobDecode: encoding version %d not supported",new DF([new $Uint8((o>>>1<<24>>>24))]));$s=3;case 3:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}$s=4;case 4:return p;case 2:n.neg=!((((o&1)>>>0)===0));n.abs=n.abs.setBytes($subslice(m,1));return $ifaceNil;}return;}if($f===undefined){$f={$blk:BN.ptr.prototype.GobDecode};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.$s=$s;$f.$r=$r;return $f;};BN.prototype.GobDecode=function(m){return this.$val.GobDecode(m);};BN.ptr.prototype.MarshalText=function(){var $ptr,m,n,o,p,q,r,s;m=DE.nil;n=$ifaceNil;o=this;if(o===DI.nil){p=new DE($stringToBytes(""));q=$ifaceNil;m=p;n=q;return[m,n];}r=o.abs.itoa(o.neg,10);s=$ifaceNil;m=r;n=s;return[m,n];};BN.prototype.MarshalText=function(){return this.$val.MarshalText();};BN.ptr.prototype.UnmarshalText=function(m){var $ptr,m,n,o,p,q,r,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=this;p=n.SetString($bytesToString(m),0);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}o=p;q=o[1];if(!q){$s=2;continue;}$s=3;continue;case 2:r=A.Errorf("math/big: cannot unmarshal %q into a *big.Int",new DF([m]));$s=4;case 4:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}$s=5;case 5:return r;case 3:return $ifaceNil;}return;}if($f===undefined){$f={$blk:BN.ptr.prototype.UnmarshalText};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.$s=$s;$f.$r=$r;return $f;};BN.prototype.UnmarshalText=function(m){return this.$val.UnmarshalText(m);};BN.ptr.prototype.MarshalJSON=function(){var $ptr,m;m=this;return m.MarshalText();};BN.prototype.MarshalJSON=function(){return this.$val.MarshalJSON();};BN.ptr.prototype.UnmarshalJSON=function(m){var $ptr,m,n,o,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;m=$f.m;n=$f.n;o=$f.o;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=this;o=n.UnmarshalText(m);$s=1;case 1:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}$s=2;case 2:return o;}return;}if($f===undefined){$f={$blk:BN.ptr.prototype.UnmarshalJSON};}$f.$ptr=$ptr;$f.m=m;$f.n=n;$f.o=o;$f.$s=$s;$f.$r=$r;return $f;};BN.prototype.UnmarshalJSON=function(m){return this.$val.UnmarshalJSON(m);};BW.prototype.clear=function(){var $ptr,m,n,o,p;m=this;n=m;o=0;while(true){if(!(o=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+p]=0);o++;}};$ptrType(BW).prototype.clear=function(){return this.$get().clear();};BW.prototype.norm=function(){var $ptr,m,n,o;m=this;n=m.$length;while(true){if(!(n>0&&((o=n-1>>0,((o<0||o>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+o]))===0))){break;}n=n-(1)>>0;}return $subslice(m,0,n);};$ptrType(BW).prototype.norm=function(){return this.$get().norm();};BW.prototype.make=function(m){var $ptr,m,n;n=this;if(m<=n.$capacity){return $subslice(n,0,m);}return $makeSlice(BW,m,(m+4>>0));};$ptrType(BW).prototype.make=function(m){return this.$get().make(m);};BW.prototype.setWord=function(m){var $ptr,m,n;n=this;if(m===0){return $subslice(n,0,0);}n=n.make(1);(0>=n.$length?$throwRuntimeError("index out of range"):n.$array[n.$offset+0]=m);return n;};$ptrType(BW).prototype.setWord=function(m){return this.$get().setWord(m);};BW.prototype.setUint64=function(m){var $ptr,m,n,o,p,q,r,s,t,u;n=this;o=(m.$low>>>0);if((p=new $Uint64(0,o.constructor===Number?o:1),(p.$high===m.$high&&p.$low===m.$low))){return n.setWord(o);}q=0;r=m;while(true){if(!((r.$high>0||(r.$high===0&&r.$low>0)))){break;}q=q+(1)>>0;r=$shiftRightUint64(r,(32));}n=n.make(q);s=n;t=0;while(true){if(!(t=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+u]=(new $Uint64(m.$high&0,(m.$low&4294967295)>>>0).$low>>>0));m=$shiftRightUint64(m,(32));t++;}return n;};$ptrType(BW).prototype.setUint64=function(m){return this.$get().setUint64(m);};BW.prototype.set=function(m){var $ptr,m,n;n=this;n=n.make(m.$length);$copySlice(n,m);return n;};$ptrType(BW).prototype.set=function(m){return this.$get().set(m);};BW.prototype.add=function(m,n){var $ptr,m,n,o,p,q,r,s,t,u;o=this;p=m.$length;q=n.$length;if(p>0);s=M((r=$subslice(o,0,q),$subslice(new DH(r.$array),r.$offset,r.$offset+r.$length)),$subslice(new DH(m.$array),m.$offset,m.$offset+m.$length),$subslice(new DH(n.$array),n.$offset,n.$offset+n.$length));if(p>q){s=O((t=$subslice(o,q,p),$subslice(new DH(t.$array),t.$offset,t.$offset+t.$length)),(u=$subslice(m,q),$subslice(new DH(u.$array),u.$offset,u.$offset+u.$length)),s);}((p<0||p>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+p]=s);return o.norm();};$ptrType(BW).prototype.add=function(m,n){return this.$get().add(m,n);};BW.prototype.sub=function(m,n){var $ptr,m,n,o,p,q,r,s,t,u;o=this;p=m.$length;q=n.$length;if(pq){s=P((t=$subslice(o,q),$subslice(new DH(t.$array),t.$offset,t.$offset+t.$length)),(u=$subslice(m,q),$subslice(new DH(u.$array),u.$offset,u.$offset+u.$length)),s);}if(!((s===0))){$panic(new $String("underflow"));}return o.norm();};$ptrType(BW).prototype.sub=function(m,n){return this.$get().sub(m,n);};BW.prototype.cmp=function(m){var $ptr,m,n,o,p,q,r;n=0;o=this;p=o.$length;q=m.$length;if(!((p===q))||(p===0)){if(pq){n=1;}return n;}r=p-1>>0;while(true){if(!(r>0&&(((r<0||r>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+r])===((r<0||r>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+r])))){break;}r=r-(1)>>0;}if(((r<0||r>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+r])<((r<0||r>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+r])){n=-1;}else if(((r<0||r>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+r])>((r<0||r>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+r])){n=1;}return n;};$ptrType(BW).prototype.cmp=function(m){return this.$get().cmp(m);};BW.prototype.mulAddWW=function(m,n,o){var $ptr,m,n,o,p,q,r;p=this;q=m.$length;if((q===0)||(n===0)){return p.setWord(o);}p=p.make(q+1>>0);((q<0||q>=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+q]=S((r=$subslice(p,0,q),$subslice(new DH(r.$array),r.$offset,r.$offset+r.$length)),$subslice(new DH(m.$array),m.$offset,m.$offset+m.$length),n,o));return p.norm();};$ptrType(BW).prototype.mulAddWW=function(m,n,o){return this.$get().mulAddWW(m,n,o);};CA=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u;$subslice(m,0,(n.$length+o.$length>>0)).clear();p=o;q=0;while(true){if(!(q=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+q]);if(!((s===0))){(u=n.$length+r>>0,((u<0||u>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+u]=T((t=$subslice(m,r,(r+n.$length>>0)),$subslice(new DH(t.$array),t.$offset,t.$offset+t.$length)),$subslice(new DH(n.$array),n.$offset,n.$offset+n.$length),s)));}q++;}};BW.prototype.montgomery=function(m,n,o,p,q){var $ptr,aa,m,n,o,p,q,r,s,t,u,v,w,x,y,z;r=this;if(!((m.$length===q))||!((n.$length===q))||!((o.$length===q))){$panic(new $String("math/big: mismatched montgomery number lengths"));}r=r.make(q);r.clear();s=0;t=0;while(true){if(!(t=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+t]);v=T($subslice(new DH(r.$array),r.$offset,r.$offset+r.$length),$subslice(new DH(m.$array),m.$offset,m.$offset+m.$length),u);w=$imul((0>=r.$length?$throwRuntimeError("index out of range"):r.$array[r.$offset+0]),p)>>>0;x=T($subslice(new DH(r.$array),r.$offset,r.$offset+r.$length),$subslice(new DH(o.$array),o.$offset,o.$offset+o.$length),w);$copySlice(r,$subslice(r,1));y=s+v>>>0;z=y+x>>>0;(aa=q-1>>0,((aa<0||aa>=r.$length)?$throwRuntimeError("index out of range"):r.$array[r.$offset+aa]=z));if(y>0;}if(!((s===0))){N($subslice(new DH(r.$array),r.$offset,r.$offset+r.$length),$subslice(new DH(r.$array),r.$offset,r.$offset+r.$length),$subslice(new DH(o.$array),o.$offset,o.$offset+o.$length));}return r;};$ptrType(BW).prototype.montgomery=function(m,n,o,p,q){return this.$get().montgomery(m,n,o,p,q);};CB=function(m,n,o){var $ptr,m,n,o,p,q,r,s;q=M((p=$subslice(m,0,o),$subslice(new DH(p.$array),p.$offset,p.$offset+p.$length)),$subslice(new DH(m.$array),m.$offset,m.$offset+m.$length),$subslice(new DH(n.$array),n.$offset,n.$offset+n.$length));if(!((q===0))){O((r=$subslice(m,o,(o+(o>>1>>0)>>0)),$subslice(new DH(r.$array),r.$offset,r.$offset+r.$length)),(s=$subslice(m,o),$subslice(new DH(s.$array),s.$offset,s.$offset+s.$length)),q);}};CC=function(m,n,o){var $ptr,m,n,o,p,q,r,s;q=N((p=$subslice(m,0,o),$subslice(new DH(p.$array),p.$offset,p.$offset+p.$length)),$subslice(new DH(m.$array),m.$offset,m.$offset+m.$length),$subslice(new DH(n.$array),n.$offset,n.$offset+n.$length));if(!((q===0))){P((r=$subslice(m,o,(o+(o>>1>>0)>>0)),$subslice(new DH(r.$array),r.$offset,r.$offset+r.$length)),(s=$subslice(m,o),$subslice(new DH(s.$array),s.$offset,s.$offset+s.$length)),q);}};CE=function(m,n,o){var $ptr,aa,ab,ac,ad,m,n,o,p,q,r,s,t,u,v,w,x,y,z;p=o.$length;if(!(((p&1)===0))||p>1>>0;r=$subslice(n,q);s=$subslice(n,0,q);t=r;u=s;v=$subslice(o,q);w=$subslice(o,0,q);x=v;y=w;CE(m,u,y);CE($subslice(m,p),t,x);z=1;aa=$subslice(m,($imul(2,p)),(($imul(2,p))+q>>0));if(!((N($subslice(new DH(aa.$array),aa.$offset,aa.$offset+aa.$length),$subslice(new DH(t.$array),t.$offset,t.$offset+t.$length),$subslice(new DH(u.$array),u.$offset,u.$offset+u.$length))===0))){z=-z;N($subslice(new DH(aa.$array),aa.$offset,aa.$offset+aa.$length),$subslice(new DH(u.$array),u.$offset,u.$offset+u.$length),$subslice(new DH(t.$array),t.$offset,t.$offset+t.$length));}ab=$subslice(m,(($imul(2,p))+q>>0),($imul(3,p)));if(!((N($subslice(new DH(ab.$array),ab.$offset,ab.$offset+ab.$length),$subslice(new DH(y.$array),y.$offset,y.$offset+y.$length),$subslice(new DH(x.$array),x.$offset,x.$offset+x.$length))===0))){z=-z;N($subslice(new DH(ab.$array),ab.$offset,ab.$offset+ab.$length),$subslice(new DH(x.$array),x.$offset,x.$offset+x.$length),$subslice(new DH(y.$array),y.$offset,y.$offset+y.$length));}ac=$subslice(m,($imul(p,3)));CE(ac,aa,ab);ad=$subslice(m,($imul(p,4)));$copySlice(ad,$subslice(m,0,($imul(p,2))));CB($subslice(m,q),ad,p);CB($subslice(m,q),$subslice(ad,p),p);if(z>0){CB($subslice(m,q),ac,p);}else{CC($subslice(m,q),ac,p);}};CF=function(m,n){var $ptr,m,n,o,p;return m.$capacity>0&&n.$capacity>0&&(o=$subslice(m,0,m.$capacity),$indexPtr(o.$array,o.$offset+(m.$capacity-1>>0),DK))===(p=$subslice(n,0,n.$capacity),$indexPtr(p.$array,p.$offset+(n.$capacity-1>>0),DK));};CG=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u,v;p=n.$length;if(p>0){s=M((q=$subslice(m,o,(o+p>>0)),$subslice(new DH(q.$array),q.$offset,q.$offset+q.$length)),(r=$subslice(m,o),$subslice(new DH(r.$array),r.$offset,r.$offset+r.$length)),$subslice(new DH(n.$array),n.$offset,n.$offset+n.$length));if(!((s===0))){t=o+p>>0;if(tn){return m;}return n;};CI=function(m){var $ptr,m,n,o;n=0;while(true){if(!(m>CD)){break;}m=(m>>$min((1),31))>>0;n=n+(1)>>>0;}return(o=n,o<32?(m<>0;};BW.prototype.mul=function(m,n){var $ptr,m,n,o,p,q,r,s,t,u,v,w,x,y,z;o=this;p=m.$length;q=n.$length;if(p=n.$length?$throwRuntimeError("index out of range"):n.$array[n.$offset+0]),0);}if(CF(o,m)||CF(o,n)){o=BW.nil;}if(q>0);CA(o,m,n);return o.norm();}r=CI(q);s=$subslice(m,0,r);t=$subslice(n,0,r);o=o.make(CH($imul(6,r),p+q>>0));CE(o,s,t);o=$subslice(o,0,(p+q>>0));$subslice(o,($imul(2,r))).clear();if(rr){z=$subslice(z,0,r);}z=z.norm();u=u.mul(z,x);CG(o,u,y);u=u.mul(z,w);CG(o,u,y+r>>0);y=y+(r)>>0;}}return o.norm();};$ptrType(BW).prototype.mul=function(m,n){return this.$get().mul(m,n);};BW.prototype.mulRange=function(m,n){var $ptr,m,n,o,p,q;o=this;if((m.$high===0&&m.$low===0)){return o.setUint64(new $Uint64(0,0));}else if((m.$high>n.$high||(m.$high===n.$high&&m.$low>n.$low))){return o.setUint64(new $Uint64(0,1));}else if((m.$high===n.$high&&m.$low===n.$low)){return o.setUint64(m);}else if((p=new $Uint64(m.$high+0,m.$low+1),(p.$high===n.$high&&p.$low===n.$low))){return o.mul(BW.nil.setUint64(m),BW.nil.setUint64(n));}q=$div64((new $Uint64(m.$high+n.$high,m.$low+n.$low)),new $Uint64(0,2),false);return o.mul(BW.nil.mulRange(m,q),BW.nil.mulRange(new $Uint64(q.$high+0,q.$low+1),n));};$ptrType(BW).prototype.mulRange=function(m,n){return this.$get().mulRange(m,n);};BW.prototype.divW=function(m,n){var $ptr,m,n,o,p,q,r;o=BW.nil;p=0;q=this;r=m.$length;if((n===0)){$panic(new $String("division by zero"));}else if((n===1)){o=q.set(m);return[o,p];}else if((r===0)){o=$subslice(q,0,0);return[o,p];}q=q.make(r);p=U($subslice(new DH(q.$array),q.$offset,q.$offset+q.$length),0,$subslice(new DH(m.$array),m.$offset,m.$offset+m.$length),n);o=q.norm();return[o,p];};$ptrType(BW).prototype.divW=function(m,n){return this.$get().divW(m,n);};BW.prototype.div=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u;p=BW.nil;q=BW.nil;r=this;if(o.$length===0){$panic(new $String("division by zero"));}if(n.cmp(o)<0){p=$subslice(r,0,0);q=m.set(n);return[p,q];}if(o.$length===1){s=0;t=r.divW(n,(0>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0]));p=t[0];s=t[1];q=m.setWord(s);return[p,q];}u=r.divLarge(m,n,o);p=u[0];q=u[1];return[p,q];};$ptrType(BW).prototype.div=function(m,n,o){return this.$get().div(m,n,o);};BW.prototype.divLarge=function(m,n,o){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,m,n,o,p,q,r,s,t,u,v,w,x,y,z;p=BW.nil;q=BW.nil;r=this;s=o.$length;t=n.$length-s>>0;if(CF(r,n)||CF(r,o)){r=BW.nil;}p=r.make(t+1>>0);u=$makeSlice(BW,(s+1>>0));if(CF(m,n)||CF(m,o)){m=BW.nil;}m=m.make(n.$length+1>>0);m.clear();w=AE((v=s-1>>0,((v<0||v>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+v])));if(w>0){x=$makeSlice(BW,s);Q($subslice(new DH(x.$array),x.$offset,x.$offset+x.$length),$subslice(new DH(o.$array),o.$offset,o.$offset+o.$length),w);o=x;}(z=n.$length,((z<0||z>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+z]=Q((y=$subslice(m,0,n.$length),$subslice(new DH(y.$array),y.$offset,y.$offset+y.$length)),$subslice(new DH(n.$array),n.$offset,n.$offset+n.$length),w)));aa=t;while(true){if(!(aa>=0)){break;}ab=4294967295;if(!(((ac=aa+s>>0,((ac<0||ac>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+ac]))===(ad=s-1>>0,((ad<0||ad>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+ad]))))){ae=0;af=L((ag=aa+s>>0,((ag<0||ag>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+ag])),(ah=(aa+s>>0)-1>>0,((ah<0||ah>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+ah])),(ai=s-1>>0,((ai<0||ai>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+ai])));ab=af[0];ae=af[1];aj=K(ab,(ak=s-2>>0,((ak<0||ak>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+ak])));al=aj[0];am=aj[1];while(true){if(!(CM(al,am,ae,(an=(aa+s>>0)-2>>0,((an<0||an>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+an]))))){break;}ab=ab-(1)>>>0;ao=ae;ae=ae+((ap=s-1>>0,((ap<0||ap>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+ap])))>>>0;if(ae>0,((ar<0||ar>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+ar])));al=aq[0];am=aq[1];}}((s<0||s>=u.$length)?$throwRuntimeError("index out of range"):u.$array[u.$offset+s]=S((as=$subslice(u,0,s),$subslice(new DH(as.$array),as.$offset,as.$offset+as.$length)),$subslice(new DH(o.$array),o.$offset,o.$offset+o.$length),ab,0));av=N((at=$subslice(m,aa,(aa+u.$length>>0)),$subslice(new DH(at.$array),at.$offset,at.$offset+at.$length)),(au=$subslice(m,aa),$subslice(new DH(au.$array),au.$offset,au.$offset+au.$length)),$subslice(new DH(u.$array),u.$offset,u.$offset+u.$length));if(!((av===0))){ay=M((aw=$subslice(m,aa,(aa+s>>0)),$subslice(new DH(aw.$array),aw.$offset,aw.$offset+aw.$length)),(ax=$subslice(m,aa),$subslice(new DH(ax.$array),ax.$offset,ax.$offset+ax.$length)),$subslice(new DH(o.$array),o.$offset,o.$offset+o.$length));az=aa+s>>0;((az<0||az>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+az]=(((az<0||az>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+az])+(ay)>>>0));ab=ab-(1)>>>0;}((aa<0||aa>=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+aa]=ab);aa=aa-(1)>>0;}p=p.norm();R($subslice(new DH(m.$array),m.$offset,m.$offset+m.$length),$subslice(new DH(m.$array),m.$offset,m.$offset+m.$length),w);q=m.norm();ba=p;bb=q;p=ba;q=bb;return[p,q];};$ptrType(BW).prototype.divLarge=function(m,n,o){return this.$get().divLarge(m,n,o);};BW.prototype.bitLen=function(){var $ptr,m,n;m=this;n=m.$length-1>>0;if(n>=0){return($imul(n,32))+V(((n<0||n>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+n]))>>0;}return 0;};$ptrType(BW).prototype.bitLen=function(){return this.$get().bitLen();};CL=function(m){var $ptr,m,n,o,p;n=32;if(n===(32)){return((o=(($imul((((m&(-m>>>0))>>>0)),125613361)>>>0))>>>27>>>0,((o<0||o>=CJ.$length)?$throwRuntimeError("index out of range"):CJ.$array[CJ.$offset+o]))>>>0);}else if(n===(64)){return((p=0,((p<0||p>=CK.$length)?$throwRuntimeError("index out of range"):CK.$array[CK.$offset+p]))>>>0);}else{$panic(new $String("unknown word size"));}};BW.prototype.trailingZeroBits=function(){var $ptr,m,n;m=this;if(m.$length===0){return 0;}n=0;while(true){if(!(((n<0||n>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+n])===0)){break;}n=n+(1)>>>0;}return(n*32>>>0)+CL(((n<0||n>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+n]))>>>0;};$ptrType(BW).prototype.trailingZeroBits=function(){return this.$get().trailingZeroBits();};BW.prototype.shl=function(m,n){var $ptr,m,n,o,p,q,r,s,t;o=this;p=m.$length;if(p===0){return $subslice(o,0,0);}r=p+((q=n/32,(q===q&&q!==1/0&&q!==-1/0)?q>>>0:$throwRuntimeError("integer divide by zero"))>>0)>>0;o=o.make(r+1>>0);((r<0||r>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+r]=Q((s=$subslice(o,(r-p>>0),r),$subslice(new DH(s.$array),s.$offset,s.$offset+s.$length)),$subslice(new DH(m.$array),m.$offset,m.$offset+m.$length),(t=n%32,t===t?t:$throwRuntimeError("integer divide by zero"))));$subslice(o,0,(r-p>>0)).clear();return o.norm();};$ptrType(BW).prototype.shl=function(m,n){return this.$get().shl(m,n);};BW.prototype.shr=function(m,n){var $ptr,m,n,o,p,q,r,s,t;o=this;p=m.$length;r=p-((q=n/32,(q===q&&q!==1/0&&q!==-1/0)?q>>>0:$throwRuntimeError("integer divide by zero"))>>0)>>0;if(r<=0){return $subslice(o,0,0);}o=o.make(r);R($subslice(new DH(o.$array),o.$offset,o.$offset+o.$length),(s=$subslice(m,(p-r>>0)),$subslice(new DH(s.$array),s.$offset,s.$offset+s.$length)),(t=n%32,t===t?t:$throwRuntimeError("integer divide by zero")));return o.norm();};$ptrType(BW).prototype.shr=function(m,n){return this.$get().shr(m,n);};BW.prototype.setBit=function(m,n,o){var $ptr,m,n,o,p,q,r,s,t,u,v,w;p=this;r=((q=n/32,(q===q&&q!==1/0&&q!==-1/0)?q>>>0:$throwRuntimeError("integer divide by zero"))>>0);u=(s=((t=n%32,t===t?t:$throwRuntimeError("integer divide by zero"))),s<32?(1<>>0;v=m.$length;w=o;if(w===(0)){p=p.make(v);$copySlice(p,m);if(r>=v){return p;}((r<0||r>=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+r]=((((r<0||r>=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+r])&~(u))>>>0));return p.norm();}else if(w===(1)){if(r>=v){p=p.make(r+1>>0);$subslice(p,v).clear();}else{p=p.make(v);}$copySlice(p,m);((r<0||r>=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+r]=((((r<0||r>=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+r])|(u))>>>0));return p;}$panic(new $String("set bit is not 0 or 1"));};$ptrType(BW).prototype.setBit=function(m,n,o){return this.$get().setBit(m,n,o);};BW.prototype.bit=function(m){var $ptr,m,n,o,p,q,r;n=this;p=(o=m/32,(o===o&&o!==1/0&&o!==-1/0)?o>>>0:$throwRuntimeError("integer divide by zero"));if(p>=(n.$length>>>0)){return 0;}return(((((q=((r=m%32,r===r?r:$throwRuntimeError("integer divide by zero"))),q<32?(((p<0||p>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+p])>>>q):0)>>>0)&1)>>>0)>>>0);};$ptrType(BW).prototype.bit=function(m){return this.$get().bit(m);};BW.prototype.and=function(m,n){var $ptr,m,n,o,p,q,r;o=this;p=m.$length;q=n.$length;if(p>q){p=q;}o=o.make(p);r=0;while(true){if(!(r=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+r]=((((r<0||r>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+r])&((r<0||r>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+r]))>>>0));r=r+(1)>>0;}return o.norm();};$ptrType(BW).prototype.and=function(m,n){return this.$get().and(m,n);};BW.prototype.andNot=function(m,n){var $ptr,m,n,o,p,q,r;o=this;p=m.$length;q=n.$length;if(q>p){q=p;}o=o.make(p);r=0;while(true){if(!(r=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+r]=((((r<0||r>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+r])&~((r<0||r>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+r]))>>>0));r=r+(1)>>0;}$copySlice($subslice(o,q,p),$subslice(m,q,p));return o.norm();};$ptrType(BW).prototype.andNot=function(m,n){return this.$get().andNot(m,n);};BW.prototype.or=function(m,n){var $ptr,m,n,o,p,q,r,s,t,u;o=this;p=m.$length;q=n.$length;r=m;if(p=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+u]=((((u<0||u>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+u])|((u<0||u>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+u]))>>>0));u=u+(1)>>0;}$copySlice($subslice(o,q,p),$subslice(r,q,p));return o.norm();};$ptrType(BW).prototype.or=function(m,n){return this.$get().or(m,n);};BW.prototype.xor=function(m,n){var $ptr,m,n,o,p,q,r,s,t,u;o=this;p=m.$length;q=n.$length;r=m;if(p=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+u]=((((u<0||u>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+u])^((u<0||u>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+u]))>>>0));u=u+(1)>>0;}$copySlice($subslice(o,q,p),$subslice(r,q,p));return o.norm();};$ptrType(BW).prototype.xor=function(m,n){return this.$get().xor(m,n);};CM=function(m,n,o,p){var $ptr,m,n,o,p;return m>o||(m===o)&&n>p;};BW.prototype.modW=function(m){var $ptr,m,n,o,p;n=0;o=this;p=BW.nil;p=p.make(o.$length);n=U($subslice(new DH(p.$array),p.$offset,p.$offset+p.$length),0,$subslice(new DH(o.$array),o.$offset,o.$offset+o.$length),m);return n;};$ptrType(BW).prototype.modW=function(m){return this.$get().modW(m);};BW.prototype.random=function(m,n,o){var $ptr,aa,ab,ac,ad,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:p=this;if(CF(p,n)){p=BW.nil;}p=p.make(n.$length);r=((q=o%32,q===q?q:$throwRuntimeError("integer divide by zero"))>>>0);if(r===0){r=32;}t=((((s=r,s<32?(1<>>0))-1>>>0);case 1:u=32;if(u===(32)){$s=4;continue;}if(u===(64)){$s=5;continue;}$s=6;continue;case 4:v=p;w=0;case 8:if(!(w=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+x]=(y>>>0));w++;$s=8;continue;case 9:$s=7;continue;case 5:z=p;aa=0;case 11:if(!(aa=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+ab]=(((ac>>>0)|0)>>>0));aa++;$s=11;continue;case 12:$s=7;continue;case 6:$panic(new $String("unknown word size"));case 7:case 3:ad=n.$length-1>>0;((ad<0||ad>=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+ad]=((((ad<0||ad>=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+ad])&(t))>>>0));if(p.cmp(n)<0){$s=2;continue;}$s=1;continue;case 2:return p.norm();}return;}if($f===undefined){$f={$blk:BW.prototype.random};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};$ptrType(BW).prototype.random=function(m,n,o){return this.$get().random(m,n,o);};BW.prototype.expNN=function(m,n,o){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,m,n,o,p,q,r,s,t,u,v,w,x,y,z;p=this;if(CF(p,m)||CF(p,n)){p=BW.nil;}if((o.$length===1)&&((0>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0])===1)){return p.setWord(0);}if(n.$length===0){return p.setWord(1);}if((n.$length===1)&&((0>=n.$length?$throwRuntimeError("index out of range"):n.$array[n.$offset+0])===1)&&!((o.$length===0))){q=p.div(p,m,o);p=q[1];return p;}if(!((o.$length===0))){p=p.make(o.$length);}p=p.set(m);if(m.$length>1&&n.$length>1&&o.$length>0){if((((0>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0])&1)>>>0)===1){return p.expNNMontgomery(m,n,o);}return p.expNNWindowed(m,n,o);}s=(r=n.$length-1>>0,((r<0||r>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+r]));t=AE(s)+1>>>0;s=(u=(t),u<32?(s<>>0;v=BW.nil;w=32-(t>>0)>>0;x=BW.nil;y=BW.nil;z=x;aa=y;ab=0;while(true){if(!(ab>>0)===0))){z=z.mul(p,m);ae=p;af=z;z=ae;p=af;}if(!((o.$length===0))){ag=z.div(aa,p,o);z=ag[0];aa=ag[1];ah=v;ai=p;aj=z;ak=aa;z=ah;aa=ai;v=aj;p=ak;}s=(al=(1),al<32?(s<>>0;ab=ab+(1)>>0;}am=n.$length-2>>0;while(true){if(!(am>=0)){break;}s=((am<0||am>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+am]);an=0;while(true){if(!(an<32)){break;}z=z.mul(p,p);ao=p;ap=z;z=ao;p=ap;if(!((((s&2147483648)>>>0)===0))){z=z.mul(p,m);aq=p;ar=z;z=aq;p=ar;}if(!((o.$length===0))){as=z.div(aa,p,o);z=as[0];aa=as[1];at=v;au=p;av=z;aw=aa;z=at;aa=au;v=av;p=aw;}s=(ax=(1),ax<32?(s<>>0;an=an+(1)>>0;}am=am-(1)>>0;}return p.norm();};$ptrType(BW).prototype.expNN=function(m,n,o){return this.$get().expNN(m,n,o);};BW.prototype.expNNWindowed=function(m,n,o){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,m,n,o,p,q,r,s,t,u,v,w,x,y,z;p=this;q=BW.nil;r=BW.nil;s=q;t=r;u=DL.zero();u[0]=BX;u[1]=m;v=2;while(true){if(!(v<16)){break;}w=$indexPtr(u,(x=v/2,(x===x&&x!==1/0&&x!==-1/0)?x>>0:$throwRuntimeError("integer divide by zero")),DM);y=$indexPtr(u,v,DM);z=$indexPtr(u,(v+1>>0),DM);aa=w;ab=y;ac=z;ab.$set(ab.mul(aa.$get(),aa.$get()));ad=s.div(t,ab.$get(),o);s=ad[0];t=ad[1];ae=t;af=ab.$get();ab.$set(ae);t=af;ac.$set(ac.mul(ab.$get(),m));ag=s.div(t,ac.$get(),o);s=ag[0];t=ag[1];ah=t;ai=ac.$get();ac.$set(ah);t=ai;v=v+(2)>>0;}p=p.setWord(1);aj=n.$length-1>>0;while(true){if(!(aj>=0)){break;}ak=((aj<0||aj>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+aj]);al=0;while(true){if(!(al<32)){break;}if(!((aj===(n.$length-1>>0)))||!((al===0))){s=s.mul(p,p);am=p;an=s;s=am;p=an;ao=s.div(t,p,o);s=ao[0];t=ao[1];ap=t;aq=p;p=ap;t=aq;s=s.mul(p,p);ar=p;as=s;s=ar;p=as;at=s.div(t,p,o);s=at[0];t=at[1];au=t;av=p;p=au;t=av;s=s.mul(p,p);aw=p;ax=s;s=aw;p=ax;ay=s.div(t,p,o);s=ay[0];t=ay[1];az=t;ba=p;p=az;t=ba;s=s.mul(p,p);bb=p;bc=s;s=bb;p=bc;bd=s.div(t,p,o);s=bd[0];t=bd[1];be=t;bf=p;p=be;t=bf;}s=s.mul(p,(bg=ak>>>28>>>0,((bg<0||bg>=u.length)?$throwRuntimeError("index out of range"):u[bg])));bh=p;bi=s;s=bh;p=bi;bj=s.div(t,p,o);s=bj[0];t=bj[1];bk=t;bl=p;p=bk;t=bl;ak=(bm=(4),bm<32?(ak<>>0;al=al+(4)>>0;}aj=aj-(1)>>0;}return p.norm();};$ptrType(BW).prototype.expNNWindowed=function(m,n,o){return this.$get().expNNWindowed(m,n,o);};BW.prototype.expNNMontgomery=function(m,n,o){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,m,n,o,p,q,r,s,t,u,v,w,x,y,z;p=this;q=o.$length;if(m.$length>q){r=BW.nil.div(BW.nil,m,o);m=r[1];}if(m.$length=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0])>>>0;u=(0>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0])-1>>>0;v=1;while(true){if(!(v<32)){break;}u=$imul(u,(u))>>>0;t=$imul(t,(((u+1>>>0))))>>>0;v=(w=(1),w<32?(v<>0;}t=-t>>>0;x=BW.nil.setWord(1);y=BW.nil.shl(x,(($imul(($imul(2,q)),32))>>>0));z=x.div(x,y,o);x=z[1];if(x.$length=aa.$length?$throwRuntimeError("index out of range"):aa.$array[aa.$offset+0]=1);ab=DL.zero();ab[0]=ab[0].montgomery(aa,x,o,t,q);ab[1]=ab[1].montgomery(m,x,o,t,q);ac=2;while(true){if(!(ac<16)){break;}((ac<0||ac>=ab.length)?$throwRuntimeError("index out of range"):ab[ac]=((ac<0||ac>=ab.length)?$throwRuntimeError("index out of range"):ab[ac]).montgomery((ad=ac-1>>0,((ad<0||ad>=ab.length)?$throwRuntimeError("index out of range"):ab[ad])),ab[1],o,t,q));ac=ac+(1)>>0;}p=p.make(q);$copySlice(p,ab[0]);y=y.make(q);ae=n.$length-1>>0;while(true){if(!(ae>=0)){break;}af=((ae<0||ae>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+ae]);ag=0;while(true){if(!(ag<32)){break;}if(!((ae===(n.$length-1>>0)))||!((ag===0))){y=y.montgomery(p,p,o,t,q);p=p.montgomery(y,y,o,t,q);y=y.montgomery(p,p,o,t,q);p=p.montgomery(y,y,o,t,q);}y=y.montgomery(p,(ah=af>>>28>>>0,((ah<0||ah>=ab.length)?$throwRuntimeError("index out of range"):ab[ah])),o,t,q);ai=y;aj=p;p=ai;y=aj;af=(ak=(4),ak<32?(af<>>0;ag=ag+(4)>>0;}ae=ae-(1)>>0;}y=y.montgomery(p,aa,o,t,q);if(y.cmp(o)>=0){y=y.sub(y,o);if(y.cmp(o)>=0){al=BW.nil.div(BW.nil,y,o);y=al[1];}}return y.norm();};$ptrType(BW).prototype.expNNMontgomery=function(m,n,o){return this.$get().expNNMontgomery(m,n,o);};BW.prototype.probablyPrime=function(m){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;ax=$f.ax;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:n=this;if(n.$length===0){return false;}if(n.$length===1){if((0>=n.$length?$throwRuntimeError("index out of range"):n.$array[n.$offset+0])<2){return false;}if((o=(0>=n.$length?$throwRuntimeError("index out of range"):n.$array[n.$offset+0])%2,o===o?o:$throwRuntimeError("integer divide by zero"))===0){return(0>=n.$length?$throwRuntimeError("index out of range"):n.$array[n.$offset+0])===2;}p=(0>=n.$length?$throwRuntimeError("index out of range"):n.$array[n.$offset+0]);if((p===(3))||(p===(5))||(p===(7))||(p===(11))||(p===(13))||(p===(17))||(p===(19))||(p===(23))||(p===(29))||(p===(31))||(p===(37))||(p===(41))||(p===(43))||(p===(47))||(p===(53))){return true;}}if((((0>=n.$length?$throwRuntimeError("index out of range"):n.$array[n.$offset+0])&1)>>>0)===0){return false;}q=0;r=32;if(r===(32)){q=n.modW(3234846615);}else if(r===(64)){q=n.modW(820596253);}else{$panic(new $String("Unknown word size"));}if(((s=q%3,s===s?s:$throwRuntimeError("integer divide by zero"))===0)||((t=q%5,t===t?t:$throwRuntimeError("integer divide by zero"))===0)||((u=q%7,u===u?u:$throwRuntimeError("integer divide by zero"))===0)||((v=q%11,v===v?v:$throwRuntimeError("integer divide by zero"))===0)||((w=q%13,w===w?w:$throwRuntimeError("integer divide by zero"))===0)||((x=q%17,x===x?x:$throwRuntimeError("integer divide by zero"))===0)||((y=q%19,y===y?y:$throwRuntimeError("integer divide by zero"))===0)||((z=q%23,z===z?z:$throwRuntimeError("integer divide by zero"))===0)||((aa=q%29,aa===aa?aa:$throwRuntimeError("integer divide by zero"))===0)){return false;}if(false&&(((ab=q%31,ab===ab?ab:$throwRuntimeError("integer divide by zero"))===0)||((ac=q%37,ac===ac?ac:$throwRuntimeError("integer divide by zero"))===0)||((ad=q%41,ad===ad?ad:$throwRuntimeError("integer divide by zero"))===0)||((ae=q%43,ae===ae?ae:$throwRuntimeError("integer divide by zero"))===0)||((af=q%47,af===af?af:$throwRuntimeError("integer divide by zero"))===0)||((ag=q%53,ag===ag?ag:$throwRuntimeError("integer divide by zero"))===0))){return false;}ah=BW.nil.sub(n,BX);ai=ah.trailingZeroBits();aj=BW.nil.shr(ah,ai);ak=BW.nil.sub(ah,BY);am=G.New(G.NewSource((al=(0>=n.$length?$throwRuntimeError("index out of range"):n.$array[n.$offset+0]),new $Int64(0,al.constructor===Number?al:1))));an=BW.nil;ao=BW.nil;ap=BW.nil;aq=an;ar=ao;as=ap;at=ak.bitLen();au=0;case 1:if(!(au>0;$s=1;continue;}aw=1;while(true){if(!(aw>0;$s=1;continue s;}if(ar.cmp(BX)===0){return false;}aw=aw+(1)>>>0;}return false;$s=1;continue;case 2:return true;}return;}if($f===undefined){$f={$blk:BW.prototype.probablyPrime};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.ax=ax;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};$ptrType(BW).prototype.probablyPrime=function(m){return this.$get().probablyPrime(m);};BW.prototype.bytes=function(m){var $ptr,m,n,o,p,q,r,s,t;n=0;o=this;n=m.$length;p=o;q=0;while(true){if(!(q=p.$length)?$throwRuntimeError("index out of range"):p.$array[p.$offset+q]);s=0;while(true){if(!(s<4)){break;}n=n-(1)>>0;((n<0||n>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+n]=(r<<24>>>24));r=(t=(8),t<32?(r>>>t):0)>>>0;s=s+(1)>>0;}q++;}while(true){if(!(n=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+n])===0))){break;}n=n+(1)>>0;}return n;};$ptrType(BW).prototype.bytes=function(m){return this.$get().bytes(m);};BW.prototype.setBytes=function(m){var $ptr,m,n,o,p,q,r,s,t,u;n=this;n=n.make((o=(((m.$length+4>>0)-1>>0))/4,(o===o&&o!==1/0&&o!==-1/0)?o>>0:$throwRuntimeError("integer divide by zero")));p=0;q=0;r=0;s=m.$length;while(true){if(!(s>0)){break;}r=(r|(((t=q,t<32?(((u=s-1>>0,((u<0||u>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+u]))>>>0)<>>0)))>>>0;q=q+(8)>>>0;if(q===32){((p<0||p>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+p]=r);p=p+(1)>>0;q=0;r=0;}s=s-(1)>>0;}if(p=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+p]=r);}return n.norm();};$ptrType(BW).prototype.setBytes=function(m){return this.$get().setBytes(m);};CN=function(m){var $ptr,m,n,o,p,q,r,s;n=0;o=0;p=m;q=1;n=p;o=q;s=(r=4294967295/m,(r===r&&r!==1/0&&r!==-1/0)?r>>>0:$throwRuntimeError("integer divide by zero"));while(true){if(!(n<=s)){break;}n=$imul(n,(m))>>>0;o=o+(1)>>0;}return[n,o];};CO=function(m,n){var $ptr,m,n,o;o=0;o=1;while(true){if(!(n>0)){break;}if(!(((n&1)===0))){o=$imul(o,(m))>>>0;}m=$imul(m,(m))>>>0;n=(n>>$min((1),31))>>0;}return o;};BW.prototype.scan=function(m,n,o){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:p=BW.nil;q=0;r=0;s=$ifaceNil;t=this;u=(n===0)||!o&&2<=n&&n<=36||o&&((n===2)||(n===10)||(n===16));if(!u){$s=1;continue;}$s=2;continue;case 1:v=A.Sprintf("illegal number base %d",new DF([new $Int(n)]));$s=3;case 3:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}$panic(new $String(v));case 2:x=m.ReadByte();$s=4;case 4:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}w=x;y=w[0];s=w[1];if(!($interfaceIsEqual(s,$ifaceNil))){return[p,q,r,s];}q=n;if(n===0){$s=5;continue;}$s=6;continue;case 5:q=10;if(y===48){$s=7;continue;}$s=8;continue;case 7:r=1;aa=m.ReadByte();$s=10;case 10:if($c){$c=false;aa=aa.$blk();}if(aa&&aa.$blk!==undefined){break s;}z=aa;y=z[0];s=z[1];ab=s;if($interfaceIsEqual(ab,$ifaceNil)){$s=11;continue;}if($interfaceIsEqual(ab,(C.EOF))){$s=12;continue;}$s=13;continue;case 11:if(!o){q=8;}ac=y;if((ac===(120))||(ac===(88))){q=16;}else if((ac===(98))||(ac===(66))){q=2;}ad=q;if((ad===(16))||(ad===(2))){$s=16;continue;}if(ad===(8)){$s=17;continue;}$s=18;continue;case 16:r=0;af=m.ReadByte();$s=19;case 19:if($c){$c=false;af=af.$blk();}if(af&&af.$blk!==undefined){break s;}ae=af;y=ae[0];s=ae[1];if(!($interfaceIsEqual(s,$ifaceNil))){return[p,q,r,s];}$s=18;continue;case 17:r=0;case 18:case 15:$s=14;continue;case 12:p=$subslice(t,0,0);s=$ifaceNil;return[p,q,r,s];case 13:return[p,q,r,s];case 14:case 9:case 8:case 6:t=$subslice(t,0,0);ag=(q>>>0);ah=CN(ag);ai=ah[0];aj=ah[1];ak=0;al=0;am=-1;case 20:if(o&&(y===46)){$s=22;continue;}$s=23;continue;case 22:o=false;am=r;ao=m.ReadByte();$s=24;case 24:if($c){$c=false;ao=ao.$blk();}if(ao&&ao.$blk!==undefined){break s;}an=ao;y=an[0];s=an[1];if(!($interfaceIsEqual(s,$ifaceNil))){if($interfaceIsEqual(s,C.EOF)){s=$ifaceNil;$s=21;continue;}return[p,q,r,s];}case 23:ap=0;if(48<=y&&y<=57){ap=((y-48<<24>>>24)>>>0);}else if(97<=y&&y<=122){ap=(((y-97<<24>>>24)+10<<24>>>24)>>>0);}else if(65<=y&&y<=90){ap=(((y-65<<24>>>24)+10<<24>>>24)>>>0);}else{ap=37;}if(ap>=ag){$s=25;continue;}$s=26;continue;case 25:aq=m.UnreadByte();$s=27;case 27:if($c){$c=false;aq=aq.$blk();}if(aq&&aq.$blk!==undefined){break s;}aq;$s=21;continue;case 26:r=r+(1)>>0;ak=($imul(ak,ag)>>>0)+ap>>>0;al=al+(1)>>0;if(al===aj){t=t.mulAddWW(t,ai,ak);ak=0;al=0;}as=m.ReadByte();$s=28;case 28:if($c){$c=false;as=as.$blk();}if(as&&as.$blk!==undefined){break s;}ar=as;y=ar[0];s=ar[1];if(!($interfaceIsEqual(s,$ifaceNil))){if($interfaceIsEqual(s,C.EOF)){s=$ifaceNil;$s=21;continue;}return[p,q,r,s];}$s=20;continue;case 21:if(r===0){if((n===0)&&(q===8)){r=1;q=10;}else if(!((n===0))||!((q===8))){s=H.New("syntax error scanning number");}return[p,q,r,s];}if(al>0){t=t.mulAddWW(t,CO(ag,al),ak);}p=t.norm();if(am>=0){r=am-r>>0;}return[p,q,r,s];}return;}if($f===undefined){$f={$blk:BW.prototype.scan};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};$ptrType(BW).prototype.scan=function(m,n,o){return this.$get().scan(m,n,o);};BW.prototype.utoa=function(m){var $ptr,m,n;n=this;return n.itoa(false,m);};$ptrType(BW).prototype.utoa=function(m){return this.$get().utoa(m);};BW.prototype.itoa=function(m,n){var $ptr,aa,ab,ac,ad,ae,af,ag,m,n,o,p,q,r,s,t,u,v,w,x,y,z;o=this;if(n<2||n>36){$panic(new $String("invalid base"));}if(o.$length===0){return new DE($stringToBytes("0"));}p=(o.bitLen()/B.Log2(n)>>0)+1>>0;if(m){p=p+(1)>>0;}q=$makeSlice(DE,p);r=(n>>>0);if(r===((r&(-r>>>0))>>>0)){s=CL(r);u=(((t=s,t<32?(1<>>0)-1>>>0);v=(0>=o.$length?$throwRuntimeError("index out of range"):o.$array[o.$offset+0]);w=32;x=1;while(true){if(!(x=s)){break;}p=p-(1)>>0;((p<0||p>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+p]="0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((v&u)>>>0)));v=(y=(s),y<32?(v>>>y):0)>>>0;w=w-(s)>>>0;}if(w===0){v=((x<0||x>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+x]);w=32;}else{v=(v|(((z=w,z<32?(((x<0||x>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+x])<>>0)))>>>0;p=p-(1)>>0;((p<0||p>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+p]="0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((v&u)>>>0)));v=(aa=((s-w>>>0)),aa<32?(((x<0||x>=o.$length)?$throwRuntimeError("index out of range"):o.$array[o.$offset+x])>>>aa):0)>>>0;w=32-((s-w>>>0))>>>0;}x=x+(1)>>0;}while(true){if(!(!((v===0)))){break;}p=p-(1)>>0;((p<0||p>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+p]="0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt(((v&u)>>>0)));v=(ab=(s),ab<32?(v>>>ab):0)>>>0;}}else{ac=CN(r);ad=ac[0];ae=ac[1];af=CS(o.$length,r,ae,ad);ag=BW.nil.set(o);ag.convertWords(q,r,ae,ad,af);p=0;while(true){if(!(((p<0||p>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+p])===48)){break;}p=p+(1)>>0;}}if(m){p=p-(1)>>0;((p<0||p>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+p]=45);}return $subslice(q,p);};$ptrType(BW).prototype.itoa=function(m,n){return this.$get().itoa(m,n);};BW.prototype.convertWords=function(m,n,o,p,q){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,m,n,o,p,q,r,s,t,u,v,w,x,y,z;r=this;if(!(q===DN.nil)){s=BW.nil;t=q.$length-1>>0;while(true){if(!(r.$length>CP)){break;}u=r.bitLen();v=u>>1>>0;while(true){if(!(t>0&&(w=t-1>>0,((w<0||w>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+w])).nbits>v)){break;}t=t-(1)>>0;}if(((t<0||t>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+t]).nbits>=u&&((t<0||t>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+t]).bbb.cmp(r)>=0){t=t-(1)>>0;if(t<0){$panic(new $String("internal inconsistency"));}}x=r.div(s,r,((t<0||t>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+t]).bbb);r=x[0];s=x[1];y=m.$length-((t<0||t>=q.$length)?$throwRuntimeError("index out of range"):q.$array[q.$offset+t]).ndigits>>0;s.convertWords($subslice(m,y),n,o,p,$subslice(q,0,t));m=$subslice(m,0,y);}}z=m.$length;aa=0;if(n===10){while(true){if(!(r.$length>0)){break;}ab=r.divW(r,p);r=ab[0];aa=ab[1];ac=0;while(true){if(!(ac0)){break;}z=z-(1)>>0;ae=(ad=aa/10,(ad===ad&&ad!==1/0&&ad!==-1/0)?ad>>>0:$throwRuntimeError("integer divide by zero"));((z<0||z>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+z]=(48+((((aa-(ae<<3>>>0)>>>0)-ae>>>0)-ae>>>0)<<24>>>24)<<24>>>24));aa=ae;ac=ac+(1)>>0;}}}else{while(true){if(!(r.$length>0)){break;}af=r.divW(r,p);r=af[0];aa=af[1];ag=0;while(true){if(!(ag0)){break;}z=z-(1)>>0;((z<0||z>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+z]="0123456789abcdefghijklmnopqrstuvwxyz".charCodeAt((ah=aa%n,ah===ah?ah:$throwRuntimeError("integer divide by zero"))));aa=(ai=aa/(n),(ai===ai&&ai!==1/0&&ai!==-1/0)?ai>>>0:$throwRuntimeError("integer divide by zero"));ag=ag+(1)>>0;}}}while(true){if(!(z>0)){break;}z=z-(1)>>0;((z<0||z>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+z]=48);}};$ptrType(BW).prototype.convertWords=function(m,n,o,p,q){return this.$get().convertWords(m,n,o,p,q);};BW.prototype.expWW=function(m,n){var $ptr,m,n,o;o=this;return o.expNN(BW.nil.setWord(m),BW.nil.setWord(n),BW.nil);};$ptrType(BW).prototype.expWW=function(m,n){return this.$get().expWW(m,n);};CS=function(m,n,o,p){var $ptr,m,n,o,p,q,r,s,t,u,v,w,x,y,z;if((CP===0)||m<=CP){return DN.nil;}q=1;r=CP;while(true){if(!(r<(m>>1>>0)&&q<64)){break;}q=q+(1)>>0;r=(s=(1),s<32?(r<>0;}t=DN.nil;if(n===10){CR.Mutex.Lock();t=$subslice(new DN(CR.table),0,q);}else{t=$makeSlice(DN,q);}if((u=q-1>>0,((u<0||u>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+u])).ndigits===0){v=BW.nil;w=0;while(true){if(!(w=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+w]).ndigits===0){if(w===0){(0>=t.$length?$throwRuntimeError("index out of range"):t.$array[t.$offset+0]).bbb=BW.nil.expWW(p,(CP>>>0));(0>=t.$length?$throwRuntimeError("index out of range"):t.$array[t.$offset+0]).ndigits=$imul(o,CP);}else{((w<0||w>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+w]).bbb=BW.nil.mul((x=w-1>>0,((x<0||x>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+x])).bbb,(y=w-1>>0,((y<0||y>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+y])).bbb);((w<0||w>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+w]).ndigits=$imul(2,(z=w-1>>0,((z<0||z>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+z])).ndigits);}v=BW.nil.set(((w<0||w>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+w]).bbb);while(true){if(!(S($subslice(new DH(v.$array),v.$offset,v.$offset+v.$length),$subslice(new DH(v.$array),v.$offset,v.$offset+v.$length),n,0)===0)){break;}((w<0||w>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+w]).bbb=((w<0||w>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+w]).bbb.set(v);((w<0||w>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+w]).ndigits=((w<0||w>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+w]).ndigits+(1)>>0;}((w<0||w>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+w]).nbits=((w<0||w>=t.$length)?$throwRuntimeError("index out of range"):t.$array[t.$offset+w]).bbb.bitLen();}w=w+(1)>>0;}}if(n===10){CR.Mutex.Unlock();}return t;};DI.methods=[{prop:"Sign",name:"Sign",pkg:"",typ:$funcType([],[$Int],false)},{prop:"SetInt64",name:"SetInt64",pkg:"",typ:$funcType([$Int64],[DI],false)},{prop:"SetUint64",name:"SetUint64",pkg:"",typ:$funcType([$Uint64],[DI],false)},{prop:"Set",name:"Set",pkg:"",typ:$funcType([DI],[DI],false)},{prop:"Bits",name:"Bits",pkg:"",typ:$funcType([],[DH],false)},{prop:"SetBits",name:"SetBits",pkg:"",typ:$funcType([DH],[DI],false)},{prop:"Abs",name:"Abs",pkg:"",typ:$funcType([DI],[DI],false)},{prop:"Neg",name:"Neg",pkg:"",typ:$funcType([DI],[DI],false)},{prop:"Add",name:"Add",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"Sub",name:"Sub",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"Mul",name:"Mul",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"MulRange",name:"MulRange",pkg:"",typ:$funcType([$Int64,$Int64],[DI],false)},{prop:"Binomial",name:"Binomial",pkg:"",typ:$funcType([$Int64,$Int64],[DI],false)},{prop:"Quo",name:"Quo",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"Rem",name:"Rem",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"QuoRem",name:"QuoRem",pkg:"",typ:$funcType([DI,DI,DI],[DI,DI],false)},{prop:"Div",name:"Div",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"Mod",name:"Mod",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"DivMod",name:"DivMod",pkg:"",typ:$funcType([DI,DI,DI],[DI,DI],false)},{prop:"Cmp",name:"Cmp",pkg:"",typ:$funcType([DI],[$Int],false)},{prop:"Int64",name:"Int64",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"Uint64",name:"Uint64",pkg:"",typ:$funcType([],[$Uint64],false)},{prop:"SetString",name:"SetString",pkg:"",typ:$funcType([$String,$Int],[DI,$Bool],false)},{prop:"SetBytes",name:"SetBytes",pkg:"",typ:$funcType([DE],[DI],false)},{prop:"Bytes",name:"Bytes",pkg:"",typ:$funcType([],[DE],false)},{prop:"BitLen",name:"BitLen",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Exp",name:"Exp",pkg:"",typ:$funcType([DI,DI,DI],[DI],false)},{prop:"GCD",name:"GCD",pkg:"",typ:$funcType([DI,DI,DI,DI],[DI],false)},{prop:"binaryGCD",name:"binaryGCD",pkg:"math/big",typ:$funcType([DI,DI],[DI],false)},{prop:"ProbablyPrime",name:"ProbablyPrime",pkg:"",typ:$funcType([$Int],[$Bool],false)},{prop:"Rand",name:"Rand",pkg:"",typ:$funcType([DP,DI],[DI],false)},{prop:"ModInverse",name:"ModInverse",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"modSqrt3Mod4Prime",name:"modSqrt3Mod4Prime",pkg:"math/big",typ:$funcType([DI,DI],[DI],false)},{prop:"modSqrtTonelliShanks",name:"modSqrtTonelliShanks",pkg:"math/big",typ:$funcType([DI,DI],[DI],false)},{prop:"ModSqrt",name:"ModSqrt",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"Lsh",name:"Lsh",pkg:"",typ:$funcType([DI,$Uint],[DI],false)},{prop:"Rsh",name:"Rsh",pkg:"",typ:$funcType([DI,$Uint],[DI],false)},{prop:"Bit",name:"Bit",pkg:"",typ:$funcType([$Int],[$Uint],false)},{prop:"SetBit",name:"SetBit",pkg:"",typ:$funcType([DI,$Int,$Uint],[DI],false)},{prop:"And",name:"And",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"AndNot",name:"AndNot",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"Or",name:"Or",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"Xor",name:"Xor",pkg:"",typ:$funcType([DI,DI],[DI],false)},{prop:"Not",name:"Not",pkg:"",typ:$funcType([DI],[DI],false)},{prop:"Text",name:"Text",pkg:"",typ:$funcType([$Int],[$String],false)},{prop:"Append",name:"Append",pkg:"",typ:$funcType([DE,$Int],[DE],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Format",name:"Format",pkg:"",typ:$funcType([A.State,$Int32],[],false)},{prop:"scan",name:"scan",pkg:"math/big",typ:$funcType([C.ByteScanner,$Int],[DI,$Int,$error],false)},{prop:"Scan",name:"Scan",pkg:"",typ:$funcType([A.ScanState,$Int32],[$error],false)},{prop:"GobEncode",name:"GobEncode",pkg:"",typ:$funcType([],[DE,$error],false)},{prop:"GobDecode",name:"GobDecode",pkg:"",typ:$funcType([DE],[$error],false)},{prop:"MarshalText",name:"MarshalText",pkg:"",typ:$funcType([],[DE,$error],false)},{prop:"UnmarshalText",name:"UnmarshalText",pkg:"",typ:$funcType([DE],[$error],false)},{prop:"MarshalJSON",name:"MarshalJSON",pkg:"",typ:$funcType([],[DE,$error],false)},{prop:"UnmarshalJSON",name:"UnmarshalJSON",pkg:"",typ:$funcType([DE],[$error],false)}];BV.methods=[{prop:"ReadByte",name:"ReadByte",pkg:"",typ:$funcType([],[$Uint8,$error],false)},{prop:"UnreadByte",name:"UnreadByte",pkg:"",typ:$funcType([],[$error],false)}];BW.methods=[{prop:"clear",name:"clear",pkg:"math/big",typ:$funcType([],[],false)},{prop:"norm",name:"norm",pkg:"math/big",typ:$funcType([],[BW],false)},{prop:"make",name:"make",pkg:"math/big",typ:$funcType([$Int],[BW],false)},{prop:"setWord",name:"setWord",pkg:"math/big",typ:$funcType([X],[BW],false)},{prop:"setUint64",name:"setUint64",pkg:"math/big",typ:$funcType([$Uint64],[BW],false)},{prop:"set",name:"set",pkg:"math/big",typ:$funcType([BW],[BW],false)},{prop:"add",name:"add",pkg:"math/big",typ:$funcType([BW,BW],[BW],false)},{prop:"sub",name:"sub",pkg:"math/big",typ:$funcType([BW,BW],[BW],false)},{prop:"cmp",name:"cmp",pkg:"math/big",typ:$funcType([BW],[$Int],false)},{prop:"mulAddWW",name:"mulAddWW",pkg:"math/big",typ:$funcType([BW,X,X],[BW],false)},{prop:"montgomery",name:"montgomery",pkg:"math/big",typ:$funcType([BW,BW,BW,X,$Int],[BW],false)},{prop:"mul",name:"mul",pkg:"math/big",typ:$funcType([BW,BW],[BW],false)},{prop:"mulRange",name:"mulRange",pkg:"math/big",typ:$funcType([$Uint64,$Uint64],[BW],false)},{prop:"divW",name:"divW",pkg:"math/big",typ:$funcType([BW,X],[BW,X],false)},{prop:"div",name:"div",pkg:"math/big",typ:$funcType([BW,BW,BW],[BW,BW],false)},{prop:"divLarge",name:"divLarge",pkg:"math/big",typ:$funcType([BW,BW,BW],[BW,BW],false)},{prop:"bitLen",name:"bitLen",pkg:"math/big",typ:$funcType([],[$Int],false)},{prop:"trailingZeroBits",name:"trailingZeroBits",pkg:"math/big",typ:$funcType([],[$Uint],false)},{prop:"shl",name:"shl",pkg:"math/big",typ:$funcType([BW,$Uint],[BW],false)},{prop:"shr",name:"shr",pkg:"math/big",typ:$funcType([BW,$Uint],[BW],false)},{prop:"setBit",name:"setBit",pkg:"math/big",typ:$funcType([BW,$Uint,$Uint],[BW],false)},{prop:"bit",name:"bit",pkg:"math/big",typ:$funcType([$Uint],[$Uint],false)},{prop:"sticky",name:"sticky",pkg:"math/big",typ:$funcType([$Uint],[$Uint],false)},{prop:"and",name:"and",pkg:"math/big",typ:$funcType([BW,BW],[BW],false)},{prop:"andNot",name:"andNot",pkg:"math/big",typ:$funcType([BW,BW],[BW],false)},{prop:"or",name:"or",pkg:"math/big",typ:$funcType([BW,BW],[BW],false)},{prop:"xor",name:"xor",pkg:"math/big",typ:$funcType([BW,BW],[BW],false)},{prop:"modW",name:"modW",pkg:"math/big",typ:$funcType([X],[X],false)},{prop:"random",name:"random",pkg:"math/big",typ:$funcType([DP,BW,$Int],[BW],false)},{prop:"expNN",name:"expNN",pkg:"math/big",typ:$funcType([BW,BW,BW],[BW],false)},{prop:"expNNWindowed",name:"expNNWindowed",pkg:"math/big",typ:$funcType([BW,BW,BW],[BW],false)},{prop:"expNNMontgomery",name:"expNNMontgomery",pkg:"math/big",typ:$funcType([BW,BW,BW],[BW],false)},{prop:"probablyPrime",name:"probablyPrime",pkg:"math/big",typ:$funcType([$Int],[$Bool],false)},{prop:"bytes",name:"bytes",pkg:"math/big",typ:$funcType([DE],[$Int],false)},{prop:"setBytes",name:"setBytes",pkg:"math/big",typ:$funcType([DE],[BW],false)},{prop:"scan",name:"scan",pkg:"math/big",typ:$funcType([C.ByteScanner,$Int,$Bool],[BW,$Int,$Int,$error],false)},{prop:"utoa",name:"utoa",pkg:"math/big",typ:$funcType([$Int],[DE],false)},{prop:"itoa",name:"itoa",pkg:"math/big",typ:$funcType([$Bool,$Int],[DE],false)},{prop:"convertWords",name:"convertWords",pkg:"math/big",typ:$funcType([DE,X,$Int,X,DN],[],false)},{prop:"expWW",name:"expWW",pkg:"math/big",typ:$funcType([X,X],[BW],false)}];BN.init([{prop:"neg",name:"neg",pkg:"math/big",typ:$Bool,tag:""},{prop:"abs",name:"abs",pkg:"math/big",typ:BW,tag:""}]);BV.init([{prop:"ScanState",name:"",pkg:"",typ:A.ScanState,tag:""}]);BW.init(X);CQ.init([{prop:"bbb",name:"bbb",pkg:"math/big",typ:BW,tag:""},{prop:"nbits",name:"nbits",pkg:"math/big",typ:$Int,tag:""},{prop:"ndigits",name:"ndigits",pkg:"math/big",typ:$Int,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=E.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=J.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=H.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=I.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=G.$init();$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=F.$init();$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}CR=new DD.ptr(new I.Mutex.ptr(false),DC.zero());BX=new BW([1]);BO=new BN.ptr(false,BX);BY=new BW([2]);CD=40;CJ=new DE([0,1,28,2,29,14,24,3,30,22,20,15,25,17,4,8,31,27,13,23,21,19,16,7,26,12,18,6,11,5,10,9]);CK=new DE([0,1,56,2,57,49,28,3,61,58,42,50,38,29,17,4,62,47,59,36,45,43,51,22,53,39,33,30,24,18,12,5,63,55,48,27,60,41,37,16,46,35,44,21,52,32,23,11,54,26,40,15,34,20,31,10,25,14,19,9,13,8,7,6]);CP=8;}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["crypto/rand"]=(function(){var $pkg={},$init,A,B,C,D,F,L,N,I,E,G;A=$packages["errors"];B=$packages["github.com/gopherjs/gopherjs/js"];C=$packages["io"];D=$packages["math/big"];F=$pkg.rngReader=$newType(0,$kindStruct,"rand.rngReader","rngReader","crypto/rand",function(){this.$val=this;if(arguments.length===0){return;}});L=$sliceType($Uint8);N=$ptrType(F);E=function(){var $ptr;$pkg.Reader=new F.ptr();};F.ptr.prototype.Read=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;b=0;c=$ifaceNil;d=this;e=a.$array;f=$parseInt(a.$offset)>>0;g=$global.crypto;if(g===undefined){g=$global.msCrypto;}if(!(g===undefined)){if(!(g.getRandomValues===undefined)){b=a.$length;if(b>65536){b=65536;}g.getRandomValues(e.subarray(f,f+b>>0));h=b;i=$ifaceNil;b=h;c=i;return[b,c];}}j=$global.require;if(!(j===undefined)){k=j($externalize("crypto",$String)).randomBytes;if(!(k===undefined)){e.set(k(a.$length),f);l=a.$length;m=$ifaceNil;b=l;c=m;return[b,c];}}n=0;o=A.New("crypto/rand not available in this environment");b=n;c=o;return[b,c];};F.prototype.Read=function(a){return this.$val.Read(a);};G=function(a){var $ptr,a,b,c,d,e,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=0;c=$ifaceNil;e=C.ReadFull($pkg.Reader,a);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}d=e;b=d[0];c=d[1];$s=2;case 2:return[b,c];}return;}if($f===undefined){$f={$blk:G};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Read=G;N.methods=[{prop:"Read",name:"Read",pkg:"",typ:$funcType([L],[$Int,$error],false)}];F.init([]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.Reader=$ifaceNil;I=new D.Int.ptr(false,D.nat.nil).SetUint64(new $Uint64(3793877372,820596253));E();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["hash"]=(function(){var $pkg={},$init,A,B,E;A=$packages["io"];B=$pkg.Hash=$newType(8,$kindInterface,"hash.Hash","Hash","hash",null);E=$sliceType($Uint8);B.init([{prop:"BlockSize",name:"BlockSize",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Reset",name:"Reset",pkg:"",typ:$funcType([],[],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Sum",name:"Sum",pkg:"",typ:$funcType([E],[E],false)},{prop:"Write",name:"Write",pkg:"",typ:$funcType([E],[$Int,$error],false)}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["crypto"]=(function(){var $pkg={},$init,A,B,C,O,P,F,G;A=$packages["hash"];B=$packages["io"];C=$packages["strconv"];O=$funcType([],[A.Hash],false);P=$sliceType(O);G=function(a,b){var $ptr,a,b;if(a>=16){$panic(new $String("crypto: RegisterHash of unknown hash function"));}((a<0||a>=F.$length)?$throwRuntimeError("index out of range"):F.$array[F.$offset+a]=b);};$pkg.RegisterHash=G;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}F=$makeSlice(P,16);}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["crypto/sha256"]=(function(){var $pkg={},$init,A,B,D,K,L,M,N,O,Q,R,I,C,E,F,G,J;A=$packages["crypto"];B=$packages["hash"];D=$pkg.digest=$newType(0,$kindStruct,"sha256.digest","digest","crypto/sha256",function(h_,x_,nx_,len_,is224_){this.$val=this;if(arguments.length===0){this.h=L.zero();this.x=M.zero();this.nx=0;this.len=new $Uint64(0,0);this.is224=false;return;}this.h=h_;this.x=x_;this.nx=nx_;this.len=len_;this.is224=is224_;});K=$sliceType($Uint32);L=$arrayType($Uint32,8);M=$arrayType($Uint8,64);N=$sliceType($Uint8);O=$arrayType($Uint8,32);Q=$arrayType($Uint32,64);R=$ptrType(D);C=function(){var $ptr;A.RegisterHash(4,F);A.RegisterHash(5,E);};D.ptr.prototype.Reset=function(){var $ptr,a;a=this;if(!a.is224){a.h[0]=1779033703;a.h[1]=3144134277;a.h[2]=1013904242;a.h[3]=2773480762;a.h[4]=1359893119;a.h[5]=2600822924;a.h[6]=528734635;a.h[7]=1541459225;}else{a.h[0]=3238371032;a.h[1]=914150663;a.h[2]=812702999;a.h[3]=4144912697;a.h[4]=4290775857;a.h[5]=1750603025;a.h[6]=1694076839;a.h[7]=3204075428;}a.nx=0;a.len=new $Uint64(0,0);};D.prototype.Reset=function(){return this.$val.Reset();};E=function(){var $ptr,a;a=new D.ptr(L.zero(),M.zero(),0,new $Uint64(0,0),false);a.Reset();return a;};$pkg.New=E;F=function(){var $ptr,a;a=new D.ptr(L.zero(),M.zero(),0,new $Uint64(0,0),false);a.is224=true;a.Reset();return a;};$pkg.New224=F;D.ptr.prototype.Size=function(){var $ptr,a;a=this;if(!a.is224){return 32;}return 28;};D.prototype.Size=function(){return this.$val.Size();};D.ptr.prototype.BlockSize=function(){var $ptr,a;a=this;return 64;};D.prototype.BlockSize=function(){return this.$val.BlockSize();};D.ptr.prototype.Write=function(a){var $ptr,a,b,c,d,e,f,g,h;b=0;c=$ifaceNil;d=this;b=a.$length;d.len=(e=d.len,f=new $Uint64(0,b),new $Uint64(e.$high+f.$high,e.$low+f.$low));if(d.nx>0){g=$copySlice($subslice(new N(d.x),d.nx),a);d.nx=d.nx+(g)>>0;if(d.nx===64){J(d,new N(d.x));d.nx=0;}a=$subslice(a,g);}if(a.$length>=64){h=(a.$length&~63)>>0;J(d,$subslice(a,0,h));a=$subslice(a,h);}if(a.$length>0){d.nx=$copySlice(new N(d.x),a);}return[b,c];};D.prototype.Write=function(a){return this.$val.Write(a);};D.ptr.prototype.Sum=function(a){var $ptr,a,b,c,d;b=this;c=$clone(b,D);d=$clone(c.checkSum(),O);if(c.is224){return $appendSlice(a,$subslice(new N(d),0,28));}return $appendSlice(a,new N(d));};D.prototype.Sum=function(a){return this.$val.Sum(a);};D.ptr.prototype.checkSum=function(){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;a=this;b=a.len;c=M.zero();c[0]=128;if((d=$div64(b,new $Uint64(0,64),true),(d.$high<0||(d.$high===0&&d.$low<56)))){a.Write($subslice(new N(c),0,$flatten64((e=$div64(b,new $Uint64(0,64),true),new $Uint64(0-e.$high,56-e.$low)))));}else{a.Write($subslice(new N(c),0,$flatten64((f=$div64(b,new $Uint64(0,64),true),new $Uint64(0-f.$high,120-f.$low)))));}b=$shiftLeft64(b,(3));g=0;while(true){if(!(g<8)){break;}((g<0||g>=c.length)?$throwRuntimeError("index out of range"):c[g]=($shiftRightUint64(b,((56-(8*g>>>0)>>>0))).$low<<24>>>24));g=g+(1)>>>0;}a.Write($subslice(new N(c),0,8));if(!((a.nx===0))){$panic(new $String("d.nx != 0"));}h=new K(a.h);if(a.is224){h=$subslice(new K(a.h),0,7);}i=O.zero();j=h;k=0;while(true){if(!(k=j.$length)?$throwRuntimeError("index out of range"):j.$array[j.$offset+k]);(n=$imul(l,4),((n<0||n>=i.length)?$throwRuntimeError("index out of range"):i[n]=((m>>>24>>>0)<<24>>>24)));(o=($imul(l,4))+1>>0,((o<0||o>=i.length)?$throwRuntimeError("index out of range"):i[o]=((m>>>16>>>0)<<24>>>24)));(p=($imul(l,4))+2>>0,((p<0||p>=i.length)?$throwRuntimeError("index out of range"):i[p]=((m>>>8>>>0)<<24>>>24)));(q=($imul(l,4))+3>>0,((q<0||q>=i.length)?$throwRuntimeError("index out of range"):i[q]=(m<<24>>>24)));k++;}return i;};D.prototype.checkSum=function(){return this.$val.checkSum();};G=function(a){var $ptr,a,b;b=new D.ptr(L.zero(),M.zero(),0,new $Uint64(0,0),false);b.Reset();b.Write(a);return b.checkSum();};$pkg.Sum256=G;J=function(a,b){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;c=Q.zero();d=a.h[0];e=a.h[1];f=a.h[2];g=a.h[3];h=a.h[4];i=a.h[5];j=a.h[6];k=a.h[7];l=d;m=e;n=f;o=g;p=h;q=i;r=j;s=k;while(true){if(!(b.$length>=64)){break;}t=0;while(true){if(!(t<16)){break;}u=$imul(t,4);((t<0||t>=c.length)?$throwRuntimeError("index out of range"):c[t]=((((((((((u<0||u>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+u])>>>0)<<24>>>0)|(((v=u+1>>0,((v<0||v>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+v]))>>>0)<<16>>>0))>>>0)|(((w=u+2>>0,((w<0||w>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+w]))>>>0)<<8>>>0))>>>0)|((x=u+3>>0,((x<0||x>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+x]))>>>0))>>>0));t=t+(1)>>0;}y=16;while(true){if(!(y<64)){break;}aa=(z=y-2>>0,((z<0||z>=c.length)?$throwRuntimeError("index out of range"):c[z]));ab=(((((((aa>>>17>>>0)|(aa<<15>>>0))>>>0))^((((aa>>>19>>>0)|(aa<<13>>>0))>>>0)))>>>0)^((aa>>>10>>>0)))>>>0;ad=(ac=y-15>>0,((ac<0||ac>=c.length)?$throwRuntimeError("index out of range"):c[ac]));ae=(((((((ad>>>7>>>0)|(ad<<25>>>0))>>>0))^((((ad>>>18>>>0)|(ad<<14>>>0))>>>0)))>>>0)^((ad>>>3>>>0)))>>>0;((y<0||y>=c.length)?$throwRuntimeError("index out of range"):c[y]=(((ab+(af=y-7>>0,((af<0||af>=c.length)?$throwRuntimeError("index out of range"):c[af]))>>>0)+ae>>>0)+(ag=y-16>>0,((ag<0||ag>=c.length)?$throwRuntimeError("index out of range"):c[ag]))>>>0));y=y+(1)>>0;}ah=l;ai=m;aj=n;ak=o;al=p;am=q;an=r;ao=s;ap=ah;aq=ai;ar=aj;as=ak;at=al;au=am;av=an;aw=ao;ax=0;while(true){if(!(ax<64)){break;}ay=(((aw+(((((((((at>>>6>>>0)|(at<<26>>>0))>>>0))^((((at>>>11>>>0)|(at<<21>>>0))>>>0)))>>>0)^((((at>>>25>>>0)|(at<<7>>>0))>>>0)))>>>0))>>>0)+((((((at&au)>>>0))^((((~at>>>0)&av)>>>0)))>>>0))>>>0)+((ax<0||ax>=I.$length)?$throwRuntimeError("index out of range"):I.$array[I.$offset+ax])>>>0)+((ax<0||ax>=c.length)?$throwRuntimeError("index out of range"):c[ax])>>>0;az=(((((((((ap>>>2>>>0)|(ap<<30>>>0))>>>0))^((((ap>>>13>>>0)|(ap<<19>>>0))>>>0)))>>>0)^((((ap>>>22>>>0)|(ap<<10>>>0))>>>0)))>>>0))+((((((((ap&aq)>>>0))^(((ap&ar)>>>0)))>>>0)^(((aq&ar)>>>0)))>>>0))>>>0;aw=av;av=au;au=at;at=as+ay>>>0;as=ar;ar=aq;aq=ap;ap=ay+az>>>0;ax=ax+(1)>>0;}l=l+(ap)>>>0;m=m+(aq)>>>0;n=n+(ar)>>>0;o=o+(as)>>>0;p=p+(at)>>>0;q=q+(au)>>>0;r=r+(av)>>>0;s=s+(aw)>>>0;b=$subslice(b,64);}ba=l;bb=m;bc=n;bd=o;be=p;bf=q;bg=r;bh=s;a.h[0]=ba;a.h[1]=bb;a.h[2]=bc;a.h[3]=bd;a.h[4]=be;a.h[5]=bf;a.h[6]=bg;a.h[7]=bh;};R.methods=[{prop:"Reset",name:"Reset",pkg:"",typ:$funcType([],[],false)},{prop:"Size",name:"Size",pkg:"",typ:$funcType([],[$Int],false)},{prop:"BlockSize",name:"BlockSize",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Write",name:"Write",pkg:"",typ:$funcType([N],[$Int,$error],false)},{prop:"Sum",name:"Sum",pkg:"",typ:$funcType([N],[N],false)},{prop:"checkSum",name:"checkSum",pkg:"crypto/sha256",typ:$funcType([],[O],false)}];D.init([{prop:"h",name:"h",pkg:"crypto/sha256",typ:L,tag:""},{prop:"x",name:"x",pkg:"crypto/sha256",typ:M,tag:""},{prop:"nx",name:"nx",pkg:"crypto/sha256",typ:$Int,tag:""},{prop:"len",name:"len",pkg:"crypto/sha256",typ:$Uint64,tag:""},{prop:"is224",name:"is224",pkg:"crypto/sha256",typ:$Bool,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}I=new K([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);C();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["encoding/base64"]=(function(){var $pkg={},$init,A,B,C,E,G,K,L,M,N,O,P,Q,S,D,F;A=$packages["io"];B=$packages["strconv"];C=$pkg.Encoding=$newType(0,$kindStruct,"base64.Encoding","Encoding","encoding/base64",function(encode_,decodeMap_,padChar_){this.$val=this;if(arguments.length===0){this.encode=K.zero();this.decodeMap=L.zero();this.padChar=0;return;}this.encode=encode_;this.decodeMap=decodeMap_;this.padChar=padChar_;});E=$pkg.encoder=$newType(0,$kindStruct,"base64.encoder","encoder","encoding/base64",function(err_,enc_,w_,buf_,nbuf_,out_){this.$val=this;if(arguments.length===0){this.err=$ifaceNil;this.enc=N.nil;this.w=$ifaceNil;this.buf=O.zero();this.nbuf=0;this.out=P.zero();return;}this.err=err_;this.enc=enc_;this.w=w_;this.buf=buf_;this.nbuf=nbuf_;this.out=out_;});G=$pkg.CorruptInputError=$newType(8,$kindInt64,"base64.CorruptInputError","CorruptInputError","encoding/base64",null);K=$arrayType($Uint8,64);L=$arrayType($Uint8,256);M=$sliceType($Uint8);N=$ptrType(C);O=$arrayType($Uint8,3);P=$arrayType($Uint8,1024);Q=$arrayType($Uint8,4);S=$ptrType(E);D=function(a){var $ptr,a,b,c,d,e,f,g;if(!((a.length===64))){$panic(new $String("encoding alphabet is not 64-bytes long"));}b=new C.ptr(K.zero(),L.zero(),0);b.padChar=61;$copyString(new M(b.encode),a);c=0;while(true){if(!(c<256)){break;}(d=b.decodeMap,((c<0||c>=d.length)?$throwRuntimeError("index out of range"):d[c]=255));c=c+(1)>>0;}e=0;while(true){if(!(e=f.length)?$throwRuntimeError("index out of range"):f[g]=(e<<24>>>24)));e=e+(1)>>0;}return b;};$pkg.NewEncoding=D;C.ptr.prototype.WithPadding=function(a){var $ptr,a,b;b=$clone(this,C);b.padChar=a;return b;};C.prototype.WithPadding=function(a){return this.$val.WithPadding(a);};C.ptr.prototype.Encode=function(a,b){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;c=this;if(b.$length===0){return;}d=0;e=0;f=d;g=e;i=$imul(((h=b.$length/3,(h===h&&h!==1/0&&h!==-1/0)?h>>0:$throwRuntimeError("integer divide by zero"))),3);while(true){if(!(g>0,((j<0||j>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+j]))>>>0)<<16>>>0)|(((k=g+1>>0,((k<0||k>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+k]))>>>0)<<8>>>0))>>>0)|((l=g+2>>0,((l<0||l>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+l]))>>>0))>>>0;(p=f+0>>0,((p<0||p>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+p]=(n=c.encode,o=((m>>>18>>>0)&63)>>>0,((o<0||o>=n.length)?$throwRuntimeError("index out of range"):n[o]))));(s=f+1>>0,((s<0||s>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+s]=(q=c.encode,r=((m>>>12>>>0)&63)>>>0,((r<0||r>=q.length)?$throwRuntimeError("index out of range"):q[r]))));(v=f+2>>0,((v<0||v>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+v]=(t=c.encode,u=((m>>>6>>>0)&63)>>>0,((u<0||u>=t.length)?$throwRuntimeError("index out of range"):t[u]))));(y=f+3>>0,((y<0||y>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+y]=(w=c.encode,x=(m&63)>>>0,((x<0||x>=w.length)?$throwRuntimeError("index out of range"):w[x]))));g=g+(3)>>0;f=f+(4)>>0;}z=b.$length-g>>0;if(z===0){return;}ab=((aa=g+0>>0,((aa<0||aa>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+aa]))>>>0)<<16>>>0;if(z===2){ab=(ab|((((ac=g+1>>0,((ac<0||ac>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+ac]))>>>0)<<8>>>0)))>>>0;}(af=f+0>>0,((af<0||af>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+af]=(ad=c.encode,ae=((ab>>>18>>>0)&63)>>>0,((ae<0||ae>=ad.length)?$throwRuntimeError("index out of range"):ad[ae]))));(ai=f+1>>0,((ai<0||ai>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+ai]=(ag=c.encode,ah=((ab>>>12>>>0)&63)>>>0,((ah<0||ah>=ag.length)?$throwRuntimeError("index out of range"):ag[ah]))));aj=z;if(aj===(2)){(am=f+2>>0,((am<0||am>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+am]=(ak=c.encode,al=((ab>>>6>>>0)&63)>>>0,((al<0||al>=ak.length)?$throwRuntimeError("index out of range"):ak[al]))));if(!((c.padChar===-1))){(an=f+3>>0,((an<0||an>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+an]=(c.padChar<<24>>>24)));}}else if(aj===(1)){if(!((c.padChar===-1))){(ao=f+2>>0,((ao<0||ao>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+ao]=(c.padChar<<24>>>24)));(ap=f+3>>0,((ap<0||ap>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+ap]=(c.padChar<<24>>>24)));}}};C.prototype.Encode=function(a,b){return this.$val.Encode(a,b);};C.ptr.prototype.EncodeToString=function(a){var $ptr,a,b,c;b=this;c=$makeSlice(M,b.EncodedLen(a.$length));b.Encode(c,a);return $bytesToString(c);};C.prototype.EncodeToString=function(a){return this.$val.EncodeToString(a);};E.ptr.prototype.Write=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=0;c=$ifaceNil;d=this;if(!($interfaceIsEqual(d.err,$ifaceNil))){e=0;f=d.err;b=e;c=f;return[b,c];}if(d.nbuf>0){$s=1;continue;}$s=2;continue;case 1:g=0;g=0;while(true){if(!(g=h.length)?$throwRuntimeError("index out of range"):h[i]=((g<0||g>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+g])));d.nbuf=d.nbuf+(1)>>0;g=g+(1)>>0;}b=b+(g)>>0;a=$subslice(a,g);if(d.nbuf<3){return[b,c];}d.enc.Encode(new M(d.out),new M(d.buf));k=d.w.Write($subslice(new M(d.out),0,4));$s=3;case 3:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}j=k;d.err=j[1];if(!($interfaceIsEqual(d.err,$ifaceNil))){l=b;m=d.err;b=l;c=m;return[b,c];}d.nbuf=0;case 2:case 4:if(!(a.$length>=3)){$s=5;continue;}n=768;if(n>a.$length){n=a.$length;n=n-((o=n%3,o===o?o:$throwRuntimeError("integer divide by zero")))>>0;}d.enc.Encode(new M(d.out),$subslice(a,0,n));r=d.w.Write($subslice(new M(d.out),0,($imul((q=n/3,(q===q&&q!==1/0&&q!==-1/0)?q>>0:$throwRuntimeError("integer divide by zero")),4))));$s=6;case 6:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}p=r;d.err=p[1];if(!($interfaceIsEqual(d.err,$ifaceNil))){s=b;t=d.err;b=s;c=t;return[b,c];}b=b+(n)>>0;a=$subslice(a,n);$s=4;continue;case 5:u=0;while(true){if(!(u=v.length)?$throwRuntimeError("index out of range"):v[u]=((u<0||u>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+u])));u=u+(1)>>0;}d.nbuf=a.$length;b=b+(a.$length)>>0;return[b,c];}return;}if($f===undefined){$f={$blk:E.ptr.prototype.Write};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.$s=$s;$f.$r=$r;return $f;};E.prototype.Write=function(a){return this.$val.Write(a);};E.ptr.prototype.Close=function(){var $ptr,a,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=this;if($interfaceIsEqual(a.err,$ifaceNil)&&a.nbuf>0){$s=1;continue;}$s=2;continue;case 1:a.enc.Encode(new M(a.out),$subslice(new M(a.buf),0,a.nbuf));c=a.w.Write($subslice(new M(a.out),0,a.enc.EncodedLen(a.nbuf)));$s=3;case 3:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}b=c;a.err=b[1];a.nbuf=0;case 2:return a.err;}return;}if($f===undefined){$f={$blk:E.ptr.prototype.Close};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};E.prototype.Close=function(){return this.$val.Close();};F=function(a,b){var $ptr,a,b;return new E.ptr($ifaceNil,a,b,O.zero(),0,P.zero());};$pkg.NewEncoder=F;C.ptr.prototype.EncodedLen=function(a){var $ptr,a,b,c,d;b=this;if(b.padChar===-1){return(c=((($imul(a,8))+5>>0))/6,(c===c&&c!==1/0&&c!==-1/0)?c>>0:$throwRuntimeError("integer divide by zero"));}return $imul((d=((a+2>>0))/3,(d===d&&d!==1/0&&d!==-1/0)?d>>0:$throwRuntimeError("integer divide by zero")),4);};C.prototype.EncodedLen=function(a){return this.$val.EncodedLen(a);};G.prototype.Error=function(){var $ptr,a;a=this;return"illegal base64 data at input byte "+B.FormatInt(new $Int64(a.$high,a.$low),10);};$ptrType(G).prototype.Error=function(){return this.$get().Error();};C.ptr.prototype.decode=function(a,b){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;c=0;d=false;e=$ifaceNil;f=this;g=0;while(true){if(!(g=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+g])===10)||(((g<0||g>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+g])===13)))){break;}g=g+(1)>>0;}while(true){if(!(g>0));c=p;d=q;e=r;return[c,d,e];}s=o-1>>0;t=o;u=true;k=s;l=t;d=u;break;}v=((g<0||g>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+g]);g=g+(1)>>0;while(true){if(!(g=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+g])===10)||(((g<0||g>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+g])===13)))){break;}g=g+(1)>>0;}if((v>>0)===f.padChar){w=o;if((w===(0))||(w===(1))){x=c;y=false;z=new G(0,(g-1>>0));c=x;d=y;e=z;return[c,d,e];}else if(w===(2)){if(g===b.$length){aa=c;ab=false;ac=new G(0,b.$length);c=aa;d=ab;e=ac;return[c,d,e];}if(!(((((g<0||g>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+g])>>0)===f.padChar))){ad=c;ae=false;af=new G(0,(g-1>>0));c=ad;d=ae;e=af;return[c,d,e];}g=g+(1)>>0;while(true){if(!(g=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+g])===10)||(((g<0||g>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+g])===13)))){break;}g=g+(1)>>0;}}if(g=h.length)?$throwRuntimeError("index out of range"):h[o]=(aj=f.decodeMap,((v<0||v>=aj.length)?$throwRuntimeError("index out of range"):aj[v])));if(((o<0||o>=h.length)?$throwRuntimeError("index out of range"):h[o])===255){ak=c;al=false;am=new G(0,(g-1>>0));c=ak;d=al;e=am;return[c,d,e];}n++;}an=(((((((h[0]>>>0)<<18>>>0)|((h[1]>>>0)<<12>>>0))>>>0)|((h[2]>>>0)<<6>>>0))>>>0)|(h[3]>>>0))>>>0;ao=l;if(ao===(4)){(2>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+2]=((an>>>0>>>0)<<24>>>24));(1>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+1]=((an>>>8>>>0)<<24>>>24));(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0]=((an>>>16>>>0)<<24>>>24));}else if(ao===(3)){(1>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+1]=((an>>>8>>>0)<<24>>>24));(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0]=((an>>>16>>>0)<<24>>>24));}else if(ao===(2)){(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0]=((an>>>16>>>0)<<24>>>24));}a=$subslice(a,k);c=c+((l-1>>0))>>0;}ap=c;aq=d;ar=e;c=ap;d=aq;e=ar;return[c,d,e];};C.prototype.decode=function(a,b){return this.$val.decode(a,b);};C.ptr.prototype.Decode=function(a,b){var $ptr,a,b,c,d,e,f;c=0;d=$ifaceNil;e=this;f=e.decode(a,b);c=f[0];d=f[2];return[c,d];};C.prototype.Decode=function(a,b){return this.$val.Decode(a,b);};C.ptr.prototype.DecodeString=function(a){var $ptr,a,b,c,d,e,f;b=this;c=$makeSlice(M,b.DecodedLen(a.length));d=b.decode(c,new M($stringToBytes(a)));e=d[0];f=d[2];return[$subslice(c,0,e),f];};C.prototype.DecodeString=function(a){return this.$val.DecodeString(a);};C.ptr.prototype.DecodedLen=function(a){var $ptr,a,b,c,d;b=this;if(b.padChar===-1){return(c=((($imul(a,6))+7>>0))/8,(c===c&&c!==1/0&&c!==-1/0)?c>>0:$throwRuntimeError("integer divide by zero"));}return $imul((d=a/4,(d===d&&d!==1/0&&d!==-1/0)?d>>0:$throwRuntimeError("integer divide by zero")),3);};C.prototype.DecodedLen=function(a){return this.$val.DecodedLen(a);};C.methods=[{prop:"WithPadding",name:"WithPadding",pkg:"",typ:$funcType([$Int32],[N],false)}];N.methods=[{prop:"Encode",name:"Encode",pkg:"",typ:$funcType([M,M],[],false)},{prop:"EncodeToString",name:"EncodeToString",pkg:"",typ:$funcType([M],[$String],false)},{prop:"EncodedLen",name:"EncodedLen",pkg:"",typ:$funcType([$Int],[$Int],false)},{prop:"decode",name:"decode",pkg:"encoding/base64",typ:$funcType([M,M],[$Int,$Bool,$error],false)},{prop:"Decode",name:"Decode",pkg:"",typ:$funcType([M,M],[$Int,$error],false)},{prop:"DecodeString",name:"DecodeString",pkg:"",typ:$funcType([$String],[M,$error],false)},{prop:"DecodedLen",name:"DecodedLen",pkg:"",typ:$funcType([$Int],[$Int],false)}];S.methods=[{prop:"Write",name:"Write",pkg:"",typ:$funcType([M],[$Int,$error],false)},{prop:"Close",name:"Close",pkg:"",typ:$funcType([],[$error],false)}];G.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];C.init([{prop:"encode",name:"encode",pkg:"encoding/base64",typ:K,tag:""},{prop:"decodeMap",name:"decodeMap",pkg:"encoding/base64",typ:L,tag:""},{prop:"padChar",name:"padChar",pkg:"encoding/base64",typ:$Int32,tag:""}]);E.init([{prop:"err",name:"err",pkg:"encoding/base64",typ:$error,tag:""},{prop:"enc",name:"enc",pkg:"encoding/base64",typ:N,tag:""},{prop:"w",name:"w",pkg:"encoding/base64",typ:A.Writer,tag:""},{prop:"buf",name:"buf",pkg:"encoding/base64",typ:O,tag:""},{prop:"nbuf",name:"nbuf",pkg:"encoding/base64",typ:$Int,tag:""},{prop:"out",name:"out",pkg:"encoding/base64",typ:P,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.StdEncoding=D("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");$pkg.URLEncoding=D("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_");$pkg.RawStdEncoding=$pkg.StdEncoding.WithPadding(-1);$pkg.RawURLEncoding=$pkg.URLEncoding.WithPadding(-1);}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["encoding"]=(function(){var $pkg={},$init,C,E;C=$pkg.TextMarshaler=$newType(8,$kindInterface,"encoding.TextMarshaler","TextMarshaler","encoding",null);E=$sliceType($Uint8);C.init([{prop:"MarshalText",name:"MarshalText",pkg:"",typ:$funcType([],[E,$error],false)}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["sort"]=(function(){var $pkg={},$init,U,AG,A,D,G,H,I,J,L,M,N;U=$pkg.StringSlice=$newType(12,$kindSlice,"sort.StringSlice","StringSlice","sort",null);AG=$sliceType($String);A=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=0;d=a;e=c;f=d;case 1:if(!(e>0))/2,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero"))>>0;i=b(h);$s=6;case 6:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}if(!i){$s=3;continue;}$s=4;continue;case 3:e=h+1>>0;$s=5;continue;case 4:f=h;case 5:$s=1;continue;case 2:return e;}return;}if($f===undefined){$f={$blk:A};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Search=A;D=function(a,b){var $ptr,a,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=[a];b=[b];c=A(a[0].$length,(function(a,b){return function(c){var $ptr,c;return((c<0||c>=a[0].$length)?$throwRuntimeError("index out of range"):a[0].$array[a[0].$offset+c])>=b[0];};})(a,b));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=2;case 2:return c;}return;}if($f===undefined){$f={$blk:D};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};$pkg.SearchStrings=D;U.prototype.Search=function(a){var $ptr,a,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;c=D($subslice(new AG(b.$array),b.$offset,b.$offset+b.$length),a);$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=2;case 2:return c;}return;}if($f===undefined){$f={$blk:U.prototype.Search};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};$ptrType(U).prototype.Search=function(a){return this.$get().Search(a);};G=function(a,b,c){var $ptr,a,b,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=b+1>>0;case 1:if(!(db)){f=false;$s=5;continue s;}g=a.Less(e,e-1>>0);$s=6;case 6:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}f=g;case 5:if(!(f)){$s=4;continue;}$r=a.Swap(e,e-1>>0);$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}e=e-(1)>>0;$s=3;continue;case 4:d=d+(1)>>0;$s=1;continue;case 2:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:G};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};H=function(a,b,c,d){var $ptr,a,b,c,d,e,f,g,h,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=b;case 1:f=($imul(2,e))+1>>0;if(f>=c){$s=2;continue;}if(!((f+1>>0)>0,(d+f>>0)+1>>0);$s=6;case 6:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}g=h;case 5:if(g){$s=3;continue;}$s=4;continue;case 3:f=f+(1)>>0;case 4:i=a.Less(d+e>>0,d+f>>0);$s=9;case 9:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}if(!i){$s=7;continue;}$s=8;continue;case 7:return;case 8:$r=a.Swap(d+e>>0,d+f>>0);$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}e=f;$s=1;continue;case 2:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:H};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};I=function(a,b,c){var $ptr,a,b,c,d,e,f,g,h,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=b;e=0;f=c-b>>0;h=(g=((f-1>>0))/2,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero"));case 1:if(!(h>=0)){$s=2;continue;}$r=H(a,h,f,d);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}h=h-(1)>>0;$s=1;continue;case 2:i=f-1>>0;case 4:if(!(i>=0)){$s=5;continue;}$r=a.Swap(d,d+i>>0);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=H(a,e,i,d);$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}i=i-(1)>>0;$s=4;continue;case 5:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:I};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};J=function(a,b,c,d){var $ptr,a,b,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=a.Less(b,c);$s=3;case 3:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}if(e){$s=1;continue;}$s=2;continue;case 1:$r=a.Swap(b,c);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:f=a.Less(d,b);$s=7;case 7:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}if(f){$s=5;continue;}$s=6;continue;case 5:$r=a.Swap(d,b);$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g=a.Less(b,c);$s=11;case 11:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}if(g){$s=9;continue;}$s=10;continue;case 9:$r=a.Swap(b,c);$s=12;case 12:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 10:case 6:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:J};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};L=function(a,b,c){var $ptr,a,aa,ab,ac,ad,ae,af,ag,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=0;e=0;g=b+(f=((c-b>>0))/2,(f===f&&f!==1/0&&f!==-1/0)?f>>0:$throwRuntimeError("integer divide by zero"))>>0;if((c-b>>0)>40){$s=1;continue;}$s=2;continue;case 1:i=(h=((c-b>>0))/8,(h===h&&h!==1/0&&h!==-1/0)?h>>0:$throwRuntimeError("integer divide by zero"));$r=J(a,b,b+i>>0,b+($imul(2,i))>>0);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=J(a,g,g-i>>0,g+i>>0);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=J(a,c-1>>0,(c-1>>0)-i>>0,(c-1>>0)-($imul(2,i))>>0);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$r=J(a,b,g,c-1>>0);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}j=b;k=b+1>>0;l=c-1>>0;m=k;n=l;case 7:if(!(!((m===n)))){o=false;$s=9;continue s;}p=a.Less(m,j);$s=10;case 10:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}o=p;case 9:if(!(o)){$s=8;continue;}m=m+(1)>>0;$s=7;continue;case 8:q=m;case 11:case 13:if(!(!((q===n)))){r=false;$s=15;continue s;}s=a.Less(j,q);$s=16;case 16:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}r=!s;case 15:if(!(r)){$s=14;continue;}q=q+(1)>>0;$s=13;continue;case 14:case 17:if(!(!((q===n)))){t=false;$s=19;continue s;}u=a.Less(j,n-1>>0);$s=20;case 20:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}t=u;case 19:if(!(t)){$s=18;continue;}n=n-(1)>>0;$s=17;continue;case 18:if(q===n){$s=12;continue;}$r=a.Swap(q,n-1>>0);$s=21;case 21:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}q=q+(1)>>0;n=n-(1)>>0;$s=11;continue;case 12:v=(c-n>>0)<5;if(!v&&(c-n>>0)<(w=((c-b>>0))/4,(w===w&&w!==1/0&&w!==-1/0)?w>>0:$throwRuntimeError("integer divide by zero"))){$s=22;continue;}$s=23;continue;case 22:x=0;y=a.Less(j,c-1>>0);$s=26;case 26:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}if(!y){$s=24;continue;}$s=25;continue;case 24:$r=a.Swap(n,c-1>>0);$s=27;case 27:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}n=n+(1)>>0;x=x+(1)>>0;case 25:z=a.Less(q-1>>0,j);$s=30;case 30:if($c){$c=false;z=z.$blk();}if(z&&z.$blk!==undefined){break s;}if(!z){$s=28;continue;}$s=29;continue;case 28:q=q-(1)>>0;x=x+(1)>>0;case 29:aa=a.Less(g,j);$s=33;case 33:if($c){$c=false;aa=aa.$blk();}if(aa&&aa.$blk!==undefined){break s;}if(!aa){$s=31;continue;}$s=32;continue;case 31:$r=a.Swap(g,q-1>>0);$s=34;case 34:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}q=q-(1)>>0;x=x+(1)>>0;case 32:v=x>1;case 23:if(v){$s=35;continue;}$s=36;continue;case 35:case 37:case 39:if(!(!((m===q)))){ab=false;$s=41;continue s;}ac=a.Less(q-1>>0,j);$s=42;case 42:if($c){$c=false;ac=ac.$blk();}if(ac&&ac.$blk!==undefined){break s;}ab=!ac;case 41:if(!(ab)){$s=40;continue;}q=q-(1)>>0;$s=39;continue;case 40:case 43:if(!(!((m===q)))){ad=false;$s=45;continue s;}ae=a.Less(m,j);$s=46;case 46:if($c){$c=false;ae=ae.$blk();}if(ae&&ae.$blk!==undefined){break s;}ad=ae;case 45:if(!(ad)){$s=44;continue;}m=m+(1)>>0;$s=43;continue;case 44:if(m===q){$s=38;continue;}$r=a.Swap(m,q-1>>0);$s=47;case 47:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}m=m+(1)>>0;q=q-(1)>>0;$s=37;continue;case 38:case 36:$r=a.Swap(j,q-1>>0);$s=48;case 48:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}af=q-1>>0;ag=n;d=af;e=ag;return[d,e];}return;}if($f===undefined){$f={$blk:L};}$f.$ptr=$ptr;$f.a=a;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};M=function(a,b,c,d){var $ptr,a,b,c,d,e,f,g,h,i,j,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:case 1:if(!((c-b>>0)>12)){$s=2;continue;}if(d===0){$s=3;continue;}$s=4;continue;case 3:$r=I(a,b,c);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return;case 4:d=d-(1)>>0;f=L(a,b,c);$s=6;case 6:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}e=f;g=e[0];h=e[1];if((g-b>>0)<(c-h>>0)){$s=7;continue;}$s=8;continue;case 7:$r=M(a,b,g,d);$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}b=h;$s=9;continue;case 8:$r=M(a,h,c,d);$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}c=g;case 9:$s=1;continue;case 2:if((c-b>>0)>1){$s=12;continue;}$s=13;continue;case 12:i=b+6>>0;case 14:if(!(i>0);$s=18;case 18:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}if(j){$s=16;continue;}$s=17;continue;case 16:$r=a.Swap(i,i-6>>0);$s=19;case 19:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 17:i=i+(1)>>0;$s=14;continue;case 15:$r=G(a,b,c);$s=20;case 20:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 13:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:M};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.$s=$s;$f.$r=$r;return $f;};N=function(a){var $ptr,a,b,c,d,e,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=a.Len();$s=1;case 1:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}c=b;d=0;e=c;while(true){if(!(e>0)){break;}d=d+(1)>>0;e=(e>>$min((1),31))>>0;}d=$imul(d,(2));$r=M(a,0,c,d);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:N};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Sort=N;U.prototype.Len=function(){var $ptr,a;a=this;return a.$length;};$ptrType(U).prototype.Len=function(){return this.$get().Len();};U.prototype.Less=function(a,b){var $ptr,a,b,c;c=this;return((a<0||a>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+a])<((b<0||b>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+b]);};$ptrType(U).prototype.Less=function(a,b){return this.$get().Less(a,b);};U.prototype.Swap=function(a,b){var $ptr,a,b,c,d,e;c=this;d=((b<0||b>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+b]);e=((a<0||a>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+a]);((a<0||a>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+a]=d);((b<0||b>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+b]=e);};$ptrType(U).prototype.Swap=function(a,b){return this.$get().Swap(a,b);};U.prototype.Sort=function(){var $ptr,a,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=this;$r=N(a);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:U.prototype.Sort};}$f.$ptr=$ptr;$f.a=a;$f.$s=$s;$f.$r=$r;return $f;};$ptrType(U).prototype.Sort=function(){return this.$get().Sort();};U.methods=[{prop:"Search",name:"Search",pkg:"",typ:$funcType([$String],[$Int],false)},{prop:"Len",name:"Len",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Less",name:"Less",pkg:"",typ:$funcType([$Int,$Int],[$Bool],false)},{prop:"Swap",name:"Swap",pkg:"",typ:$funcType([$Int,$Int],[],false)},{prop:"Sort",name:"Sort",pkg:"",typ:$funcType([],[],false)}];U.init($String);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["flag"]=(function(){var $pkg={},$init,A,B,C,D,E,F,G,H,J,K,M,O,Q,S,U,W,Y,AA,AB,AC,BK,BL,BM,BN,BO,BP,BQ,BR,BS,BT,BU,BV,BW,BX,BY,BZ,CA,CB,CC,CD,CE,CF,CG,CH,a,I,L,N,P,R,T,V,X,AD,AI,AJ,AK,AL,AR,AT,AX,BB,BF,BJ;A=$packages["errors"];B=$packages["fmt"];C=$packages["io"];D=$packages["os"];E=$packages["sort"];F=$packages["strconv"];G=$packages["time"];H=$pkg.boolValue=$newType(1,$kindBool,"flag.boolValue","boolValue","flag",null);J=$pkg.boolFlag=$newType(8,$kindInterface,"flag.boolFlag","boolFlag","flag",null);K=$pkg.intValue=$newType(4,$kindInt,"flag.intValue","intValue","flag",null);M=$pkg.int64Value=$newType(8,$kindInt64,"flag.int64Value","int64Value","flag",null);O=$pkg.uintValue=$newType(4,$kindUint,"flag.uintValue","uintValue","flag",null);Q=$pkg.uint64Value=$newType(8,$kindUint64,"flag.uint64Value","uint64Value","flag",null);S=$pkg.stringValue=$newType(8,$kindString,"flag.stringValue","stringValue","flag",null);U=$pkg.float64Value=$newType(8,$kindFloat64,"flag.float64Value","float64Value","flag",null);W=$pkg.durationValue=$newType(8,$kindInt64,"flag.durationValue","durationValue","flag",null);Y=$pkg.Value=$newType(8,$kindInterface,"flag.Value","Value","flag",null);AA=$pkg.ErrorHandling=$newType(4,$kindInt,"flag.ErrorHandling","ErrorHandling","flag",null);AB=$pkg.FlagSet=$newType(0,$kindStruct,"flag.FlagSet","FlagSet","flag",function(Usage_,name_,parsed_,actual_,formal_,args_,errorHandling_,output_){this.$val=this;if(arguments.length===0){this.Usage=$throwNilPointerError;this.name="";this.parsed=false;this.actual=false;this.formal=false;this.args=CD.nil;this.errorHandling=0;this.output=$ifaceNil;return;}this.Usage=Usage_;this.name=name_;this.parsed=parsed_;this.actual=actual_;this.formal=formal_;this.args=args_;this.errorHandling=errorHandling_;this.output=output_;});AC=$pkg.Flag=$newType(0,$kindStruct,"flag.Flag","Flag","flag",function(Name_,Usage_,Value_,DefValue_){this.$val=this;if(arguments.length===0){this.Name="";this.Usage="";this.Value=$ifaceNil;this.DefValue="";return;}this.Name=Name_;this.Usage=Usage_;this.Value=Value_;this.DefValue=DefValue_;});BK=$sliceType($emptyInterface);BL=$ptrType(H);BM=$ptrType(K);BN=$ptrType(M);BO=$ptrType(O);BP=$ptrType(Q);BQ=$ptrType(S);BR=$ptrType(U);BS=$ptrType(W);BT=$ptrType(G.Duration);BU=$ptrType(AC);BV=$sliceType(BU);BW=$ptrType($Bool);BX=$ptrType($Int);BY=$ptrType($Int64);BZ=$ptrType($Uint);CA=$ptrType($Uint64);CB=$ptrType($String);CC=$ptrType($Float64);CD=$sliceType($String);CE=$funcType([BU],[],false);CF=$ptrType(AB);CG=$funcType([],[],false);CH=$mapType($String,BU);I=function(b,c){var $ptr,b,c,d;c.$set(b);return(d=c,new BL(function(){return d.$get();},function($v){d.$set($v);},d.$target));};$ptrType(H).prototype.Set=function(b){var $ptr,b,c,d,e,f;c=this;d=F.ParseBool(b);e=d[0];f=d[1];c.$set(e);return f;};$ptrType(H).prototype.Get=function(){var $ptr,b;b=this;return new $Bool(b.$get());};$ptrType(H).prototype.String=function(){var $ptr,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;c=B.Sprintf("%v",new BK([new H(b.$get())]));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=2;case 2:return c;}return;}if($f===undefined){$f={$blk:$ptrType(H).prototype.String};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};$ptrType(H).prototype.IsBoolFlag=function(){var $ptr,b;b=this;return true;};L=function(b,c){var $ptr,b,c,d;c.$set(b);return(d=c,new BM(function(){return(d.$get()>>0);},function($v){d.$set(($v>>0));},d.$target));};$ptrType(K).prototype.Set=function(b){var $ptr,b,c,d,e,f;c=this;d=F.ParseInt(b,0,64);e=d[0];f=d[1];c.$set(((e.$low+((e.$high>>31)*4294967296))>>0));return f;};$ptrType(K).prototype.Get=function(){var $ptr,b;b=this;return new $Int((b.$get()>>0));};$ptrType(K).prototype.String=function(){var $ptr,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;c=B.Sprintf("%v",new BK([new K(b.$get())]));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=2;case 2:return c;}return;}if($f===undefined){$f={$blk:$ptrType(K).prototype.String};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};N=function(b,c){var $ptr,b,c,d,e;c.$set(b);return(d=c,new BN(function(){return(e=d.$get(),new M(e.$high,e.$low));},function($v){d.$set(new $Int64($v.$high,$v.$low));},d.$target));};$ptrType(M).prototype.Set=function(b){var $ptr,b,c,d,e,f;c=this;d=F.ParseInt(b,0,64);e=d[0];f=d[1];c.$set(new M(e.$high,e.$low));return f;};$ptrType(M).prototype.Get=function(){var $ptr,b,c;b=this;return(c=b.$get(),new $Int64(c.$high,c.$low));};$ptrType(M).prototype.String=function(){var $ptr,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;c=B.Sprintf("%v",new BK([b.$get()]));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=2;case 2:return c;}return;}if($f===undefined){$f={$blk:$ptrType(M).prototype.String};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};P=function(b,c){var $ptr,b,c,d;c.$set(b);return(d=c,new BO(function(){return(d.$get()>>>0);},function($v){d.$set(($v>>>0));},d.$target));};$ptrType(O).prototype.Set=function(b){var $ptr,b,c,d,e,f;c=this;d=F.ParseUint(b,0,64);e=d[0];f=d[1];c.$set((e.$low>>>0));return f;};$ptrType(O).prototype.Get=function(){var $ptr,b;b=this;return new $Uint((b.$get()>>>0));};$ptrType(O).prototype.String=function(){var $ptr,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;c=B.Sprintf("%v",new BK([new O(b.$get())]));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=2;case 2:return c;}return;}if($f===undefined){$f={$blk:$ptrType(O).prototype.String};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};R=function(b,c){var $ptr,b,c,d,e;c.$set(b);return(d=c,new BP(function(){return(e=d.$get(),new Q(e.$high,e.$low));},function($v){d.$set(new $Uint64($v.$high,$v.$low));},d.$target));};$ptrType(Q).prototype.Set=function(b){var $ptr,b,c,d,e,f;c=this;d=F.ParseUint(b,0,64);e=d[0];f=d[1];c.$set(new Q(e.$high,e.$low));return f;};$ptrType(Q).prototype.Get=function(){var $ptr,b,c;b=this;return(c=b.$get(),new $Uint64(c.$high,c.$low));};$ptrType(Q).prototype.String=function(){var $ptr,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;c=B.Sprintf("%v",new BK([b.$get()]));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=2;case 2:return c;}return;}if($f===undefined){$f={$blk:$ptrType(Q).prototype.String};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};T=function(b,c){var $ptr,b,c,d;c.$set(b);return(d=c,new BQ(function(){return d.$get();},function($v){d.$set($v);},d.$target));};$ptrType(S).prototype.Set=function(b){var $ptr,b,c;c=this;c.$set(b);return $ifaceNil;};$ptrType(S).prototype.Get=function(){var $ptr,b;b=this;return new $String(b.$get());};$ptrType(S).prototype.String=function(){var $ptr,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;c=B.Sprintf("%s",new BK([new S(b.$get())]));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=2;case 2:return c;}return;}if($f===undefined){$f={$blk:$ptrType(S).prototype.String};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};V=function(b,c){var $ptr,b,c,d;c.$set(b);return(d=c,new BR(function(){return d.$get();},function($v){d.$set($v);},d.$target));};$ptrType(U).prototype.Set=function(b){var $ptr,b,c,d,e,f;c=this;d=F.ParseFloat(b,64);e=d[0];f=d[1];c.$set(e);return f;};$ptrType(U).prototype.Get=function(){var $ptr,b;b=this;return new $Float64(b.$get());};$ptrType(U).prototype.String=function(){var $ptr,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;c=B.Sprintf("%v",new BK([new U(b.$get())]));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$s=2;case 2:return c;}return;}if($f===undefined){$f={$blk:$ptrType(U).prototype.String};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;};X=function(b,c){var $ptr,b,c,d,e;c.$set(b);return(d=c,new BS(function(){return(e=d.$get(),new W(e.$high,e.$low));},function($v){d.$set(new G.Duration($v.$high,$v.$low));},d.$target));};$ptrType(W).prototype.Set=function(b){var $ptr,b,c,d,e,f;c=this;d=G.ParseDuration(b);e=d[0];f=d[1];c.$set(new W(e.$high,e.$low));return f;};$ptrType(W).prototype.Get=function(){var $ptr,b,c;b=this;return(c=b.$get(),new G.Duration(c.$high,c.$low));};$ptrType(W).prototype.String=function(){var $ptr,b,c,d;b=this;return(c=b,new BT(function(){return(d=c.$get(),new G.Duration(d.$high,d.$low));},function($v){c.$set(new W($v.$high,$v.$low));},c.$target)).String();};AD=function(b){var $ptr,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=$makeSlice(E.StringSlice,$keys(b).length);d=0;e=b;f=0;g=$keys(e);while(true){if(!(f=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+d]=i.Name);d=d+(1)>>0;f++;}$r=c.Sort();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}j=$makeSlice(BV,c.$length);k=c;l=0;while(true){if(!(l=k.$length)?$throwRuntimeError("index out of range"):k.$array[k.$offset+l]);((m<0||m>=j.$length)?$throwRuntimeError("index out of range"):j.$array[j.$offset+m]=(o=b[$String.keyFor(n)],o!==undefined?o.v:BU.nil));l++;}return j;}return;}if($f===undefined){$f={$blk:AD};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.$s=$s;$f.$r=$r;return $f;};AB.ptr.prototype.out=function(){var $ptr,b;b=this;if($interfaceIsEqual(b.output,$ifaceNil)){return D.Stderr;}return b.output;};AB.prototype.out=function(){return this.$val.out();};AB.ptr.prototype.SetOutput=function(b){var $ptr,b,c;c=this;c.output=b;};AB.prototype.SetOutput=function(b){return this.$val.SetOutput(b);};AB.ptr.prototype.VisitAll=function(b){var $ptr,b,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=this;e=AD(c.formal);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}d=e;f=0;case 2:if(!(f=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+f]);$r=b(g);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}f++;$s=2;continue;case 3:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.VisitAll};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.VisitAll=function(b){return this.$val.VisitAll(b);};AB.ptr.prototype.Visit=function(b){var $ptr,b,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=this;e=AD(c.actual);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}d=e;f=0;case 2:if(!(f=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+f]);$r=b(g);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}f++;$s=2;continue;case 3:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Visit};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Visit=function(b){return this.$val.Visit(b);};AB.ptr.prototype.Lookup=function(b){var $ptr,b,c,d;c=this;return(d=c.formal[$String.keyFor(b)],d!==undefined?d.v:BU.nil);};AB.prototype.Lookup=function(b){return this.$val.Lookup(b);};AB.ptr.prototype.Set=function(b,c){var $ptr,b,c,d,e,f,g,h,i,j,k,l,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=this;e=(f=d.formal[$String.keyFor(b)],f!==undefined?[f.v,true]:[BU.nil,false]);g=e[0];h=e[1];if(!h){$s=1;continue;}$s=2;continue;case 1:i=B.Errorf("no such flag -%v",new BK([new $String(b)]));$s=3;case 3:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}$s=4;case 4:return i;case 2:j=g.Value.Set(c);$s=5;case 5:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}k=j;if(!($interfaceIsEqual(k,$ifaceNil))){return k;}if(d.actual===false){d.actual={};}l=b;(d.actual||$throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(l)]={k:l,v:g};return $ifaceNil;}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Set};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Set=function(b,c){return this.$val.Set(b,c);};AI=function(b){var $ptr,b,c;c=b;if(c===("false")){return true;}else if(c===("")){return true;}else if(c===("0")){return true;}return false;};AJ=function(b){var $ptr,b,c,d,e,f,g,h,i;c="";d="";d=b.Usage;e=0;while(true){if(!(e>0;while(true){if(!(f>0),f);d=d.substring(0,e)+c+d.substring((f+1>>0));g=c;h=d;c=g;d=h;return[c,d];}f=f+(1)>>0;}break;}e=e+(1)>>0;}c="value";i=b.Value;if($assertType(i,J,true)[1]){c="";}else if($assertType(i,BS,true)[1]){c="duration";}else if($assertType(i,BR,true)[1]){c="float";}else if($assertType(i,BM,true)[1]||$assertType(i,BN,true)[1]){c="int";}else if($assertType(i,BQ,true)[1]){c="string";}else if($assertType(i,BO,true)[1]||$assertType(i,BP,true)[1]){c="uint";}return[c,d];};$pkg.UnquoteUsage=AJ;AB.ptr.prototype.PrintDefaults=function(){var $ptr,b,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=[b];b[0]=this;$r=b[0].VisitAll((function(b){return function $b(c){var $ptr,c,d,e,f,g,h,i,j,k,l,m,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=B.Sprintf(" -%s",new BK([new $String(c.Name)]));$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=d;f=AJ(c);g=f[0];h=f[1];if(g.length>0){e=e+(" "+g);}if(e.length<=4){e=e+("\t");}else{e=e+("\n \t");}e=e+(h);if(!AI(c.DefValue)){$s=2;continue;}$s=3;continue;case 2:i=$assertType(c.Value,BQ,true);j=i[1];if(j){$s=4;continue;}$s=5;continue;case 4:k=B.Sprintf(" (default %q)",new BK([new $String(c.DefValue)]));$s=7;case 7:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}e=e+(k);$s=6;continue;case 5:l=B.Sprintf(" (default %v)",new BK([new $String(c.DefValue)]));$s=8;case 8:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}e=e+(l);case 6:case 3:m=B.Fprint(b[0].out(),new BK([new $String(e),new $String("\n")]));$s=9;case 9:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}m;$s=-1;case-1:}return;}if($f===undefined){$f={$blk:$b};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.$s=$s;$f.$r=$r;return $f;};})(b));$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.PrintDefaults};}$f.$ptr=$ptr;$f.b=b;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.PrintDefaults=function(){return this.$val.PrintDefaults();};AK=function(){var $ptr,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=$pkg.CommandLine.PrintDefaults();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AK};}$f.$ptr=$ptr;$f.$s=$s;$f.$r=$r;return $f;};$pkg.PrintDefaults=AK;AL=function(b){var $ptr,b,c,d,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:if(b.name===""){$s=1;continue;}$s=2;continue;case 1:c=B.Fprintf(b.out(),"Usage:\n",new BK([]));$s=4;case 4:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}c;$s=3;continue;case 2:d=B.Fprintf(b.out(),"Usage of %s:\n",new BK([new $String(b.name)]));$s=5;case 5:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}d;case 3:$r=b.PrintDefaults();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AL};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.$s=$s;$f.$r=$r;return $f;};AB.ptr.prototype.NFlag=function(){var $ptr,b;b=this;return $keys(b.actual).length;};AB.prototype.NFlag=function(){return this.$val.NFlag();};AB.ptr.prototype.Arg=function(b){var $ptr,b,c,d;c=this;if(b<0||b>=c.args.$length){return"";}return(d=c.args,((b<0||b>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+b]));};AB.prototype.Arg=function(b){return this.$val.Arg(b);};AB.ptr.prototype.NArg=function(){var $ptr,b;b=this;return b.args.$length;};AB.prototype.NArg=function(){return this.$val.NArg();};AB.ptr.prototype.Args=function(){var $ptr,b;b=this;return b.args;};AB.prototype.Args=function(){return this.$val.Args();};AB.ptr.prototype.BoolVar=function(b,c,d,e){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=this;$r=f.Var(I(d,b),c,e);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.BoolVar};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.BoolVar=function(b,c,d,e){return this.$val.BoolVar(b,c,d,e);};AB.ptr.prototype.Bool=function(b,c,d){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=$newDataPointer(false,BW);$r=e.BoolVar(f,b,c,d);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return f;}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Bool};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Bool=function(b,c,d){return this.$val.Bool(b,c,d);};AR=function(b,c,d){var $ptr,b,c,d,e,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=$pkg.CommandLine.Bool(b,c,d);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}$s=2;case 2:return e;}return;}if($f===undefined){$f={$blk:AR};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Bool=AR;AB.ptr.prototype.IntVar=function(b,c,d,e){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=this;$r=f.Var(L(d,b),c,e);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.IntVar};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.IntVar=function(b,c,d,e){return this.$val.IntVar(b,c,d,e);};AB.ptr.prototype.Int=function(b,c,d){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=$newDataPointer(0,BX);$r=e.IntVar(f,b,c,d);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return f;}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Int};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Int=function(b,c,d){return this.$val.Int(b,c,d);};AT=function(b,c,d){var $ptr,b,c,d,e,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=$pkg.CommandLine.Int(b,c,d);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}$s=2;case 2:return e;}return;}if($f===undefined){$f={$blk:AT};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Int=AT;AB.ptr.prototype.Int64Var=function(b,c,d,e){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=this;$r=f.Var(N(d,b),c,e);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Int64Var};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Int64Var=function(b,c,d,e){return this.$val.Int64Var(b,c,d,e);};AB.ptr.prototype.Int64=function(b,c,d){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=$newDataPointer(new $Int64(0,0),BY);$r=e.Int64Var(f,b,c,d);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return f;}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Int64};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Int64=function(b,c,d){return this.$val.Int64(b,c,d);};AB.ptr.prototype.UintVar=function(b,c,d,e){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=this;$r=f.Var(P(d,b),c,e);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.UintVar};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.UintVar=function(b,c,d,e){return this.$val.UintVar(b,c,d,e);};AB.ptr.prototype.Uint=function(b,c,d){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=$newDataPointer(0,BZ);$r=e.UintVar(f,b,c,d);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return f;}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Uint};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Uint=function(b,c,d){return this.$val.Uint(b,c,d);};AX=function(b,c,d){var $ptr,b,c,d,e,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=$pkg.CommandLine.Uint(b,c,d);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}$s=2;case 2:return e;}return;}if($f===undefined){$f={$blk:AX};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Uint=AX;AB.ptr.prototype.Uint64Var=function(b,c,d,e){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=this;$r=f.Var(R(d,b),c,e);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Uint64Var};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Uint64Var=function(b,c,d,e){return this.$val.Uint64Var(b,c,d,e);};AB.ptr.prototype.Uint64=function(b,c,d){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=$newDataPointer(new $Uint64(0,0),CA);$r=e.Uint64Var(f,b,c,d);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return f;}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Uint64};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Uint64=function(b,c,d){return this.$val.Uint64(b,c,d);};AB.ptr.prototype.StringVar=function(b,c,d,e){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=this;$r=f.Var(T(d,b),c,e);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.StringVar};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.StringVar=function(b,c,d,e){return this.$val.StringVar(b,c,d,e);};AB.ptr.prototype.String=function(b,c,d){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=$newDataPointer("",CB);$r=e.StringVar(f,b,c,d);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return f;}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.String};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.String=function(b,c,d){return this.$val.String(b,c,d);};BB=function(b,c,d){var $ptr,b,c,d,e,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=$pkg.CommandLine.String(b,c,d);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}$s=2;case 2:return e;}return;}if($f===undefined){$f={$blk:BB};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.$s=$s;$f.$r=$r;return $f;};$pkg.String=BB;AB.ptr.prototype.Float64Var=function(b,c,d,e){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=this;$r=f.Var(V(d,b),c,e);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Float64Var};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Float64Var=function(b,c,d,e){return this.$val.Float64Var(b,c,d,e);};AB.ptr.prototype.Float64=function(b,c,d){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=$newDataPointer(0,CC);$r=e.Float64Var(f,b,c,d);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return f;}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Float64};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Float64=function(b,c,d){return this.$val.Float64(b,c,d);};AB.ptr.prototype.DurationVar=function(b,c,d,e){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=this;$r=f.Var(X(d,b),c,e);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.DurationVar};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.DurationVar=function(b,c,d,e){return this.$val.DurationVar(b,c,d,e);};AB.ptr.prototype.Duration=function(b,c,d){var $ptr,b,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=$newDataPointer(new G.Duration(0,0),BT);$r=e.DurationVar(f,b,c,d);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return f;}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Duration};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Duration=function(b,c,d){return this.$val.Duration(b,c,d);};BF=function(b,c,d){var $ptr,b,c,d,e,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=$pkg.CommandLine.Duration(b,c,d);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}$s=2;case 2:return e;}return;}if($f===undefined){$f={$blk:BF};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Duration=BF;AB.ptr.prototype.Var=function(b,c,d){var $ptr,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=b.String();$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=new AC.ptr(c,d,b,f);h=(i=e.formal[$String.keyFor(c)],i!==undefined?[i.v,true]:[BU.nil,false]);j=h[1];if(j){$s=2;continue;}$s=3;continue;case 2:k="";if(e.name===""){$s=4;continue;}$s=5;continue;case 4:l=B.Sprintf("flag redefined: %s",new BK([new $String(c)]));$s=7;case 7:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}k=l;$s=6;continue;case 5:m=B.Sprintf("%s flag redefined: %s",new BK([new $String(e.name),new $String(c)]));$s=8;case 8:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}k=m;case 6:n=B.Fprintln(e.out(),new BK([new $String(k)]));$s=9;case 9:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}n;$panic(new $String(k));case 3:if(e.formal===false){e.formal={};}o=c;(e.formal||$throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(o)]={k:o,v:g};$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Var};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Var=function(b,c,d){return this.$val.Var(b,c,d);};AB.ptr.prototype.failf=function(b,c){var $ptr,b,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=this;e=B.Errorf(b,c);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=e;g=B.Fprintln(d.out(),new BK([f]));$s=2;case 2:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}g;$r=d.usage();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return f;}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.failf};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.failf=function(b,c){return this.$val.failf(b,c);};AB.ptr.prototype.usage=function(){var $ptr,b,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;if(b.Usage===$throwNilPointerError){$s=1;continue;}$s=2;continue;case 1:if(b===$pkg.CommandLine){$s=4;continue;}$s=5;continue;case 4:$r=$pkg.Usage();$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=6;continue;case 5:$r=AL(b);$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 6:$s=3;continue;case 2:$r=b.Usage();$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 3:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.usage};}$f.$ptr=$ptr;$f.b=b;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.usage=function(){return this.$val.usage();};AB.ptr.prototype.parseOne=function(){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=this;if(b.args.$length===0){return[false,$ifaceNil];}d=(c=b.args,(0>=c.$length?$throwRuntimeError("index out of range"):c.$array[c.$offset+0]));if((d.length===0)||!((d.charCodeAt(0)===45))||(d.length===1)){return[false,$ifaceNil];}e=1;if(d.charCodeAt(1)===45){e=e+(1)>>0;if(d.length===2){b.args=$subslice(b.args,1);return[false,$ifaceNil];}}f=d.substring(e);if((f.length===0)||(f.charCodeAt(0)===45)||(f.charCodeAt(0)===61)){$s=1;continue;}$s=2;continue;case 1:g=b.failf("bad flag syntax: %s",new BK([new $String(d)]));$s=3;case 3:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}$s=4;case 4:return[false,g];case 2:b.args=$subslice(b.args,1);h=false;i="";j=1;while(true){if(!(j>0));h=true;f=f.substring(0,j);break;}j=j+(1)>>0;}k=b.formal;l=(m=k[$String.keyFor(f)],m!==undefined?[m.v,true]:[BU.nil,false]);n=l[0];o=l[1];if(!o){$s=5;continue;}$s=6;continue;case 5:if(f==="help"||f==="h"){$s=7;continue;}$s=8;continue;case 7:$r=b.usage();$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return[false,$pkg.ErrHelp];case 8:p=b.failf("flag provided but not defined: -%s",new BK([new $String(f)]));$s=10;case 10:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}$s=11;case 11:return[false,p];case 6:q=$assertType(n.Value,J,true);r=q[0];s=q[1];if(!(s)){t=false;$s=15;continue s;}u=r.IsBoolFlag();$s=16;case 16:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}t=u;case 15:if(t){$s=12;continue;}$s=13;continue;case 12:if(h){$s=17;continue;}$s=18;continue;case 17:v=r.Set(i);$s=20;case 20:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}w=v;if(!($interfaceIsEqual(w,$ifaceNil))){$s=21;continue;}$s=22;continue;case 21:x=b.failf("invalid boolean value %q for -%s: %v",new BK([new $String(i),new $String(f),w]));$s=23;case 23:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}$s=24;case 24:return[false,x];case 22:$s=19;continue;case 18:y=r.Set("true");$s=25;case 25:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}z=y;if(!($interfaceIsEqual(z,$ifaceNil))){$s=26;continue;}$s=27;continue;case 26:aa=b.failf("invalid boolean flag %s: %v",new BK([new $String(f),z]));$s=28;case 28:if($c){$c=false;aa=aa.$blk();}if(aa&&aa.$blk!==undefined){break s;}$s=29;case 29:return[false,aa];case 27:case 19:$s=14;continue;case 13:if(!h&&b.args.$length>0){h=true;ab=(ac=b.args,(0>=ac.$length?$throwRuntimeError("index out of range"):ac.$array[ac.$offset+0]));ad=$subslice(b.args,1);i=ab;b.args=ad;}if(!h){$s=30;continue;}$s=31;continue;case 30:ae=b.failf("flag needs an argument: -%s",new BK([new $String(f)]));$s=32;case 32:if($c){$c=false;ae=ae.$blk();}if(ae&&ae.$blk!==undefined){break s;}$s=33;case 33:return[false,ae];case 31:af=n.Value.Set(i);$s=34;case 34:if($c){$c=false;af=af.$blk();}if(af&&af.$blk!==undefined){break s;}ag=af;if(!($interfaceIsEqual(ag,$ifaceNil))){$s=35;continue;}$s=36;continue;case 35:ah=b.failf("invalid value %q for flag -%s: %v",new BK([new $String(i),new $String(f),ag]));$s=37;case 37:if($c){$c=false;ah=ah.$blk();}if(ah&&ah.$blk!==undefined){break s;}$s=38;case 38:return[false,ah];case 36:case 14:if(b.actual===false){b.actual={};}ai=f;(b.actual||$throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(ai)]={k:ai,v:n};return[true,$ifaceNil];}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.parseOne};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.parseOne=function(){return this.$val.parseOne();};AB.ptr.prototype.Parse=function(b){var $ptr,b,c,d,e,f,g,h,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=this;c.parsed=true;c.args=b;case 1:e=c.parseOne();$s=3;case 3:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}d=e;f=d[0];g=d[1];if(f){$s=1;continue;}if($interfaceIsEqual(g,$ifaceNil)){$s=2;continue;}h=c.errorHandling;if(h===(0)){return g;}else if(h===(1)){D.Exit(2);}else if(h===(2)){$panic(g);}$s=1;continue;case 2:return $ifaceNil;}return;}if($f===undefined){$f={$blk:AB.ptr.prototype.Parse};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.$s=$s;$f.$r=$r;return $f;};AB.prototype.Parse=function(b){return this.$val.Parse(b);};AB.ptr.prototype.Parsed=function(){var $ptr,b;b=this;return b.parsed;};AB.prototype.Parsed=function(){return this.$val.Parsed();};BJ=function(b,c){var $ptr,b,c,d;d=new AB.ptr($throwNilPointerError,b,false,false,false,CD.nil,c,$ifaceNil);return d;};$pkg.NewFlagSet=BJ;AB.ptr.prototype.Init=function(b,c){var $ptr,b,c,d;d=this;d.name=b;d.errorHandling=c;};AB.prototype.Init=function(b,c){return this.$val.Init(b,c);};BL.methods=[{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String],[$error],false)},{prop:"Get",name:"Get",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"IsBoolFlag",name:"IsBoolFlag",pkg:"",typ:$funcType([],[$Bool],false)}];BM.methods=[{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String],[$error],false)},{prop:"Get",name:"Get",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];BN.methods=[{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String],[$error],false)},{prop:"Get",name:"Get",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];BO.methods=[{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String],[$error],false)},{prop:"Get",name:"Get",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];BP.methods=[{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String],[$error],false)},{prop:"Get",name:"Get",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];BQ.methods=[{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String],[$error],false)},{prop:"Get",name:"Get",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];BR.methods=[{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String],[$error],false)},{prop:"Get",name:"Get",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];BS.methods=[{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String],[$error],false)},{prop:"Get",name:"Get",pkg:"",typ:$funcType([],[$emptyInterface],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}];CF.methods=[{prop:"out",name:"out",pkg:"flag",typ:$funcType([],[C.Writer],false)},{prop:"SetOutput",name:"SetOutput",pkg:"",typ:$funcType([C.Writer],[],false)},{prop:"VisitAll",name:"VisitAll",pkg:"",typ:$funcType([CE],[],false)},{prop:"Visit",name:"Visit",pkg:"",typ:$funcType([CE],[],false)},{prop:"Lookup",name:"Lookup",pkg:"",typ:$funcType([$String],[BU],false)},{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String,$String],[$error],false)},{prop:"PrintDefaults",name:"PrintDefaults",pkg:"",typ:$funcType([],[],false)},{prop:"NFlag",name:"NFlag",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Arg",name:"Arg",pkg:"",typ:$funcType([$Int],[$String],false)},{prop:"NArg",name:"NArg",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Args",name:"Args",pkg:"",typ:$funcType([],[CD],false)},{prop:"BoolVar",name:"BoolVar",pkg:"",typ:$funcType([BW,$String,$Bool,$String],[],false)},{prop:"Bool",name:"Bool",pkg:"",typ:$funcType([$String,$Bool,$String],[BW],false)},{prop:"IntVar",name:"IntVar",pkg:"",typ:$funcType([BX,$String,$Int,$String],[],false)},{prop:"Int",name:"Int",pkg:"",typ:$funcType([$String,$Int,$String],[BX],false)},{prop:"Int64Var",name:"Int64Var",pkg:"",typ:$funcType([BY,$String,$Int64,$String],[],false)},{prop:"Int64",name:"Int64",pkg:"",typ:$funcType([$String,$Int64,$String],[BY],false)},{prop:"UintVar",name:"UintVar",pkg:"",typ:$funcType([BZ,$String,$Uint,$String],[],false)},{prop:"Uint",name:"Uint",pkg:"",typ:$funcType([$String,$Uint,$String],[BZ],false)},{prop:"Uint64Var",name:"Uint64Var",pkg:"",typ:$funcType([CA,$String,$Uint64,$String],[],false)},{prop:"Uint64",name:"Uint64",pkg:"",typ:$funcType([$String,$Uint64,$String],[CA],false)},{prop:"StringVar",name:"StringVar",pkg:"",typ:$funcType([CB,$String,$String,$String],[],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([$String,$String,$String],[CB],false)},{prop:"Float64Var",name:"Float64Var",pkg:"",typ:$funcType([CC,$String,$Float64,$String],[],false)},{prop:"Float64",name:"Float64",pkg:"",typ:$funcType([$String,$Float64,$String],[CC],false)},{prop:"DurationVar",name:"DurationVar",pkg:"",typ:$funcType([BT,$String,G.Duration,$String],[],false)},{prop:"Duration",name:"Duration",pkg:"",typ:$funcType([$String,G.Duration,$String],[BT],false)},{prop:"Var",name:"Var",pkg:"",typ:$funcType([Y,$String,$String],[],false)},{prop:"failf",name:"failf",pkg:"flag",typ:$funcType([$String,BK],[$error],true)},{prop:"usage",name:"usage",pkg:"flag",typ:$funcType([],[],false)},{prop:"parseOne",name:"parseOne",pkg:"flag",typ:$funcType([],[$Bool,$error],false)},{prop:"Parse",name:"Parse",pkg:"",typ:$funcType([CD],[$error],false)},{prop:"Parsed",name:"Parsed",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Init",name:"Init",pkg:"",typ:$funcType([$String,AA],[],false)}];J.init([{prop:"IsBoolFlag",name:"IsBoolFlag",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String],[$error],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}]);Y.init([{prop:"Set",name:"Set",pkg:"",typ:$funcType([$String],[$error],false)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}]);AB.init([{prop:"Usage",name:"Usage",pkg:"",typ:CG,tag:""},{prop:"name",name:"name",pkg:"flag",typ:$String,tag:""},{prop:"parsed",name:"parsed",pkg:"flag",typ:$Bool,tag:""},{prop:"actual",name:"actual",pkg:"flag",typ:CH,tag:""},{prop:"formal",name:"formal",pkg:"flag",typ:CH,tag:""},{prop:"args",name:"args",pkg:"flag",typ:CD,tag:""},{prop:"errorHandling",name:"errorHandling",pkg:"flag",typ:AA,tag:""},{prop:"output",name:"output",pkg:"flag",typ:C.Writer,tag:""}]);AC.init([{prop:"Name",name:"Name",pkg:"",typ:$String,tag:""},{prop:"Usage",name:"Usage",pkg:"",typ:$String,tag:""},{prop:"Value",name:"Value",pkg:"",typ:Y,tag:""},{prop:"DefValue",name:"DefValue",pkg:"",typ:$String,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=F.$init();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=G.$init();$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.ErrHelp=A.New("flag: help requested");$pkg.CommandLine=BJ((a=D.Args,(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0])),1);$pkg.Usage=(function $b(){var $ptr,b,c,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;b=$f.b;c=$f.c;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=B.Fprintf(D.Stderr,"Usage of %s:\n",new BK([new $String((b=D.Args,(0>=b.$length?$throwRuntimeError("index out of range"):b.$array[b.$offset+0])))]));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}c;$r=AK();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:$b};}$f.$ptr=$ptr;$f.b=b;$f.c=c;$f.$s=$s;$f.$r=$r;return $f;});}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["runtime/debug"]=(function(){var $pkg={},$init,D,A,B,C;D=$packages["os"];A=$packages["runtime"];B=$packages["sort"];C=$packages["time"];$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=D.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["runtime/pprof"]=(function(){var $pkg={},$init,A,B;A=$packages["io"];B=$packages["sync"];$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["runtime/trace"]=(function(){var $pkg={},$init,A,B;A=$packages["io"];B=$packages["runtime"];$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["testing"]=(function(){var $pkg={},$init,H,B,C,E,I,D,A,K,L,M,N,J,F,G,P,Q,R,AP,AQ,AR,AS,AT,AU,AV,AW,AX,AY,AZ,BA,BB,BC,BD,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;H=$packages["bytes"];B=$packages["flag"];C=$packages["fmt"];E=$packages["github.com/gopherjs/gopherjs/nosync"];I=$packages["io"];D=$packages["os"];A=$packages["runtime"];K=$packages["runtime/debug"];L=$packages["runtime/pprof"];M=$packages["runtime/trace"];N=$packages["strconv"];J=$packages["strings"];F=$packages["sync/atomic"];G=$packages["time"];$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=H.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=I.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=K.$init();$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=L.$init();$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=M.$init();$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=N.$init();$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=J.$init();$s=12;case 12:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=F.$init();$s=13;case 13:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=G.$init();$s=14;case 14:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}a=B.String("test.bench","","regular expression to select benchmarks to run");$s=15;case 15:if($c){$c=false;a=a.$blk();}if(a&&a.$blk!==undefined){break s;}P=a;b=B.Duration("test.benchtime",new G.Duration(0,1000000000),"approximate run time for each benchmark");$s=16;case 16:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}Q=b;c=B.Bool("test.benchmem",false,"print memory allocations for benchmarks");$s=17;case 17:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}R=c;d=B.Bool("test.short",false,"run smaller test suite to save time");$s=18;case 18:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}AP=d;e=B.String("test.outputdir","","directory in which to write profiles");$s=19;case 19:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}AQ=e;f=B.Bool("test.v",false,"verbose: print additional output");$s=20;case 20:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}AR=f;g=B.Uint("test.count",1,"run tests and benchmarks `n` times");$s=21;case 21:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}AS=g;h=B.String("test.coverprofile","","write a coverage profile to the named file after execution");$s=22;case 22:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}AT=h;i=B.String("test.run","","regular expression to select tests and examples to run");$s=23;case 23:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}AU=i;j=B.String("test.memprofile","","write a memory profile to the named file after execution");$s=24;case 24:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}AV=j;k=B.Int("test.memprofilerate",0,"if >=0, sets runtime.MemProfileRate");$s=25;case 25:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}AW=k;l=B.String("test.cpuprofile","","write a cpu profile to the named file during execution");$s=26;case 26:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}AX=l;m=B.String("test.blockprofile","","write a goroutine blocking profile to the named file after execution");$s=27;case 27:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}AY=m;n=B.Int("test.blockprofilerate",1,"if >= 0, calls runtime.SetBlockProfileRate()");$s=28;case 28:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}AZ=n;o=B.String("test.trace","","write an execution trace to the named file after execution");$s=29;case 29:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}BA=o;p=B.Duration("test.timeout",new G.Duration(0,0),"if positive, sets an aggregate time limit for all tests");$s=30;case 30:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}BB=p;q=B.String("test.cpu","","comma-separated list of number of CPUs to use for each test");$s=31;case 31:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}BC=q;r=B.Int("test.parallel",A.GOMAXPROCS(0),"maximum test parallelism");$s=32;case 32:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}BD=r;}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["unicode/utf16"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["encoding/json"]=(function(){var $pkg={},$init,B,C,D,E,F,P,Q,M,G,H,N,I,O,A,J,K,L,X,AK,AL,AM,AO,AQ,AU,BJ,BP,BR,BU,BW,BY,CA,CF,CG,CI,CJ,CY,CZ,ER,ET,EU,EV,EW,EX,EY,EZ,FA,FB,FC,FD,FG,FH,FI,FJ,FN,FS,FT,FV,FW,FX,FY,FZ,GA,GB,GC,GD,GE,AA,AD,AP,AV,AY,AZ,BK,BL,CM,a,b,Y,AH,AT,AW,AX,BA,BB,BC,BD,BE,BF,BG,BH,BI,BM,BN,BO,BQ,BS,BT,BV,BX,BZ,CB,CC,CD,CE,CH,CK,CL,CN,CO,CP,CQ,CR,CT,DA,DB,DC,DD,DE,DF,DG,DH,DI,DJ,DK,DL,DM,DN,DO,DP,DQ,DR,DS,DT,DU,DV,DW,DX,DY,DZ,EA,EB,EC,ED,EE,EF,EG,ES;B=$packages["bytes"];C=$packages["encoding"];D=$packages["encoding/base64"];E=$packages["errors"];F=$packages["fmt"];P=$packages["github.com/gopherjs/gopherjs/nosync"];Q=$packages["io"];M=$packages["math"];G=$packages["reflect"];H=$packages["runtime"];N=$packages["sort"];I=$packages["strconv"];O=$packages["strings"];A=$packages["testing"];J=$packages["unicode"];K=$packages["unicode/utf16"];L=$packages["unicode/utf8"];X=$pkg.Number=$newType(8,$kindString,"json.Number","Number","encoding/json",null);AK=$pkg.Marshaler=$newType(8,$kindInterface,"json.Marshaler","Marshaler","encoding/json",null);AL=$pkg.UnsupportedTypeError=$newType(0,$kindStruct,"json.UnsupportedTypeError","UnsupportedTypeError","encoding/json",function(Type_){this.$val=this;if(arguments.length===0){this.Type=$ifaceNil;return;}this.Type=Type_;});AM=$pkg.UnsupportedValueError=$newType(0,$kindStruct,"json.UnsupportedValueError","UnsupportedValueError","encoding/json",function(Value_,Str_){this.$val=this;if(arguments.length===0){this.Value=new G.Value.ptr(FD.nil,0,0);this.Str="";return;}this.Value=Value_;this.Str=Str_;});AO=$pkg.MarshalerError=$newType(0,$kindStruct,"json.MarshalerError","MarshalerError","encoding/json",function(Type_,Err_){this.$val=this;if(arguments.length===0){this.Type=$ifaceNil;this.Err=$ifaceNil;return;}this.Type=Type_;this.Err=Err_;});AQ=$pkg.encodeState=$newType(0,$kindStruct,"json.encodeState","encodeState","encoding/json",function(Buffer_,scratch_){this.$val=this;if(arguments.length===0){this.Buffer=new B.Buffer.ptr(EZ.nil,0,FG.zero(),FH.zero(),0);this.scratch=FH.zero();return;}this.Buffer=Buffer_;this.scratch=scratch_;});AU=$pkg.encoderFunc=$newType(4,$kindFunc,"json.encoderFunc","encoderFunc","encoding/json",null);BJ=$pkg.floatEncoder=$newType(4,$kindInt,"json.floatEncoder","floatEncoder","encoding/json",null);BP=$pkg.structEncoder=$newType(0,$kindStruct,"json.structEncoder","structEncoder","encoding/json",function(fields_,fieldEncs_){this.$val=this;if(arguments.length===0){this.fields=EW.nil;this.fieldEncs=FJ.nil;return;}this.fields=fields_;this.fieldEncs=fieldEncs_;});BR=$pkg.mapEncoder=$newType(0,$kindStruct,"json.mapEncoder","mapEncoder","encoding/json",function(elemEnc_){this.$val=this;if(arguments.length===0){this.elemEnc=$throwNilPointerError;return;}this.elemEnc=elemEnc_;});BU=$pkg.sliceEncoder=$newType(0,$kindStruct,"json.sliceEncoder","sliceEncoder","encoding/json",function(arrayEnc_){this.$val=this;if(arguments.length===0){this.arrayEnc=$throwNilPointerError;return;}this.arrayEnc=arrayEnc_;});BW=$pkg.arrayEncoder=$newType(0,$kindStruct,"json.arrayEncoder","arrayEncoder","encoding/json",function(elemEnc_){this.$val=this;if(arguments.length===0){this.elemEnc=$throwNilPointerError;return;}this.elemEnc=elemEnc_;});BY=$pkg.ptrEncoder=$newType(0,$kindStruct,"json.ptrEncoder","ptrEncoder","encoding/json",function(elemEnc_){this.$val=this;if(arguments.length===0){this.elemEnc=$throwNilPointerError;return;}this.elemEnc=elemEnc_;});CA=$pkg.condAddrEncoder=$newType(0,$kindStruct,"json.condAddrEncoder","condAddrEncoder","encoding/json",function(canAddrEnc_,elseEnc_){this.$val=this;if(arguments.length===0){this.canAddrEnc=$throwNilPointerError;this.elseEnc=$throwNilPointerError;return;}this.canAddrEnc=canAddrEnc_;this.elseEnc=elseEnc_;});CF=$pkg.stringValues=$newType(12,$kindSlice,"json.stringValues","stringValues","encoding/json",null);CG=$pkg.field=$newType(0,$kindStruct,"json.field","field","encoding/json",function(name_,nameBytes_,equalFold_,tag_,index_,typ_,omitEmpty_,quoted_){this.$val=this;if(arguments.length===0){this.name="";this.nameBytes=EZ.nil;this.equalFold=$throwNilPointerError;this.tag=false;this.index=FC.nil;this.typ=$ifaceNil;this.omitEmpty=false;this.quoted=false;return;}this.name=name_;this.nameBytes=nameBytes_;this.equalFold=equalFold_;this.tag=tag_;this.index=index_;this.typ=typ_;this.omitEmpty=omitEmpty_;this.quoted=quoted_;});CI=$pkg.byName=$newType(12,$kindSlice,"json.byName","byName","encoding/json",null);CJ=$pkg.byIndex=$newType(12,$kindSlice,"json.byIndex","byIndex","encoding/json",null);CY=$pkg.SyntaxError=$newType(0,$kindStruct,"json.SyntaxError","SyntaxError","encoding/json",function(msg_,Offset_){this.$val=this;if(arguments.length===0){this.msg="";this.Offset=new $Int64(0,0);return;}this.msg=msg_;this.Offset=Offset_;});CZ=$pkg.scanner=$newType(0,$kindStruct,"json.scanner","scanner","encoding/json",function(step_,endTop_,parseState_,err_,redo_,redoCode_,redoState_,bytes_){this.$val=this;if(arguments.length===0){this.step=$throwNilPointerError;this.endTop=false;this.parseState=FC.nil;this.err=$ifaceNil;this.redo=false;this.redoCode=0;this.redoState=$throwNilPointerError;this.bytes=new $Int64(0,0);return;}this.step=step_;this.endTop=endTop_;this.parseState=parseState_;this.err=err_;this.redo=redo_;this.redoCode=redoCode_;this.redoState=redoState_;this.bytes=bytes_;});ER=$pkg.tagOptions=$newType(8,$kindString,"json.tagOptions","tagOptions","encoding/json",null);ET=$sliceType($emptyInterface);EU=$mapType(G.Type,AU);EV=$structType([{prop:"RWMutex",name:"",pkg:"",typ:P.RWMutex,tag:""},{prop:"m",name:"m",pkg:"encoding/json",typ:EU,tag:""}]);EW=$sliceType(CG);EX=$mapType(G.Type,EW);EY=$structType([{prop:"RWMutex",name:"",pkg:"",typ:P.RWMutex,tag:""},{prop:"m",name:"m",pkg:"encoding/json",typ:EX,tag:""}]);EZ=$sliceType($Uint8);FA=$ptrType(AK);FB=$ptrType(C.TextMarshaler);FC=$sliceType($Int);FD=$ptrType(G.rtype);FG=$arrayType($Uint8,4);FH=$arrayType($Uint8,64);FI=$ptrType(AQ);FJ=$sliceType(AU);FN=$ptrType(CY);FS=$ptrType(AL);FT=$ptrType(AM);FV=$ptrType(AO);FW=$ptrType(BP);FX=$ptrType(BR);FY=$ptrType(BU);FZ=$ptrType(BW);GA=$ptrType(BY);GB=$ptrType(CA);GC=$funcType([EZ,EZ],[$Bool],false);GD=$ptrType(CZ);GE=$funcType([GD,$Uint8],[$Int],false);X.prototype.String=function(){var $ptr,c;c=this.$val;return c;};$ptrType(X).prototype.String=function(){return new X(this.$get()).String();};X.prototype.Float64=function(){var $ptr,c;c=this.$val;return I.ParseFloat(c,64);};$ptrType(X).prototype.Float64=function(){return new X(this.$get()).Float64();};X.prototype.Int64=function(){var $ptr,c;c=this.$val;return I.ParseInt(c,10,64);};$ptrType(X).prototype.Int64=function(){return new X(this.$get()).Int64();};Y=function(c){var $ptr,c;if(c===""){return false;}if(c.charCodeAt(0)===45){c=c.substring(1);if(c===""){return false;}}if((c.charCodeAt(0)===48)){c=c.substring(1);}else if(49<=c.charCodeAt(0)&&c.charCodeAt(0)<=57){c=c.substring(1);while(true){if(!(c.length>0&&48<=c.charCodeAt(0)&&c.charCodeAt(0)<=57)){break;}c=c.substring(1);}}else{return false;}if(c.length>=2&&(c.charCodeAt(0)===46)&&48<=c.charCodeAt(1)&&c.charCodeAt(1)<=57){c=c.substring(2);while(true){if(!(c.length>0&&48<=c.charCodeAt(0)&&c.charCodeAt(0)<=57)){break;}c=c.substring(1);}}if(c.length>=2&&((c.charCodeAt(0)===101)||(c.charCodeAt(0)===69))){c=c.substring(1);if((c.charCodeAt(0)===43)||(c.charCodeAt(0)===45)){c=c.substring(1);if(c===""){return false;}}while(true){if(!(c.length>0&&48<=c.charCodeAt(0)&&c.charCodeAt(0)<=57)){break;}c=c.substring(1);}}return c==="";};AH=function(c){var $ptr,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=new AQ.ptr(new B.Buffer.ptr(EZ.nil,0,FG.zero(),FH.zero(),0),FH.zero());e=d.marshal(c);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=e;if(!($interfaceIsEqual(f,$ifaceNil))){return[EZ.nil,f];}return[d.Buffer.Bytes(),$ifaceNil];}return;}if($f===undefined){$f={$blk:AH};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};$pkg.Marshal=AH;AL.ptr.prototype.Error=function(){var $ptr,c,d,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=this;d=c.Type.String();$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}$s=2;case 2:return"json: unsupported type: "+d;}return;}if($f===undefined){$f={$blk:AL.ptr.prototype.Error};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.$s=$s;$f.$r=$r;return $f;};AL.prototype.Error=function(){return this.$val.Error();};AM.ptr.prototype.Error=function(){var $ptr,c;c=this;return"json: unsupported value: "+c.Str;};AM.prototype.Error=function(){return this.$val.Error();};AO.ptr.prototype.Error=function(){var $ptr,c,d,e,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=this;d=c.Type.String();$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=c.Err.Error();$s=2;case 2:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}$s=3;case 3:return"json: error calling MarshalJSON for type "+d+": "+e;}return;}if($f===undefined){$f={$blk:AO.ptr.prototype.Error};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.$s=$s;$f.$r=$r;return $f;};AO.prototype.Error=function(){return this.$val.Error();};AQ.ptr.prototype.marshal=function(c){var $ptr,c,d,e,f,$s,$deferred,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$deferred=$f.$deferred;$r=$f.$r;}var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$deferred.index=$curGoroutine.deferStack.length;$curGoroutine.deferStack.push($deferred);d=[d];d[0]=$ifaceNil;e=this;$deferred.push([(function(d){return function(){var $ptr,f,g,h,i,j,k;f=$recover();if(!($interfaceIsEqual(f,$ifaceNil))){g=$assertType(f,H.Error,true);h=g[1];if(h){$panic(f);}i=$assertType(f,$String,true);j=i[0];k=i[1];if(k){$panic(new $String(j));}d[0]=$assertType(f,$error);}};})(d),[]]);f=G.ValueOf(c);$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}$r=e.reflectValue(f);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}d[0]=$ifaceNil;return d[0];}return;}}catch(err){$err=err;$s=-1;}finally{$callDeferred($deferred,$err);if(!$curGoroutine.asleep){return d[0];}if($curGoroutine.asleep){if($f===undefined){$f={$blk:AQ.ptr.prototype.marshal};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$deferred=$deferred;$f.$r=$r;return $f;}}};AQ.prototype.marshal=function(c){return this.$val.marshal(c);};AQ.ptr.prototype.error=function(c){var $ptr,c,d;d=this;$panic(c);};AQ.prototype.error=function(c){return this.$val.error(c);};AT=function(c){var $ptr,c,d,e,f;c=c;d=c.Kind();if((d===(17))||(d===(21))||(d===(23))||(d===(24))){return c.Len()===0;}else if(d===(1)){return!c.Bool();}else if((d===(2))||(d===(3))||(d===(4))||(d===(5))||(d===(6))){return(e=c.Int(),(e.$high===0&&e.$low===0));}else if((d===(7))||(d===(8))||(d===(9))||(d===(10))||(d===(11))||(d===(12))){return(f=c.Uint(),(f.$high===0&&f.$low===0));}else if((d===(13))||(d===(14))){return c.Float()===0;}else if((d===(20))||(d===(22))){return c.IsNil();}return false;};AQ.ptr.prototype.reflectValue=function(c){var $ptr,c,d,e,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=c;d=this;e=AW(c);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}$r=e(d,c,false);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:AQ.ptr.prototype.reflectValue};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.$s=$s;$f.$r=$r;return $f;};AQ.prototype.reflectValue=function(c){return this.$val.reflectValue(c);};AW=function(c){var $ptr,c,d,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=c;if(!c.IsValid()){return BB;}d=AX(c.Type());$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}$s=2;case 2:return d;}return;}if($f===undefined){$f={$blk:AW};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.$s=$s;$f.$r=$r;return $f;};AX=function(c){var $ptr,c,d,e,f,g,h,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=[d];e=[e];AV.RWMutex.RLock();e[0]=(f=AV.m[G.Type.keyFor(c)],f!==undefined?f.v:$throwNilPointerError);AV.RWMutex.RUnlock();if(!(e[0]===$throwNilPointerError)){return e[0];}AV.RWMutex.Lock();if(AV.m===false){AV.m={};}d[0]=new P.WaitGroup.ptr(0);d[0].Add(1);g=c;(AV.m||$throwRuntimeError("assignment to entry in nil map"))[G.Type.keyFor(g)]={k:g,v:(function(d,e){return function $b(h,i,j){var $ptr,h,i,j,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;h=$f.h;i=$f.i;j=$f.j;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:i=i;d[0].Wait();$r=e[0](h,i,j);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:$b};}$f.$ptr=$ptr;$f.h=h;$f.i=i;$f.j=j;$f.$s=$s;$f.$r=$r;return $f;};})(d,e)};AV.RWMutex.Unlock();h=BA(c,true);$s=1;case 1:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}e[0]=h;d[0].Done();AV.RWMutex.Lock();i=c;(AV.m||$throwRuntimeError("assignment to entry in nil map"))[G.Type.keyFor(i)]={k:i,v:e[0]};AV.RWMutex.Unlock();return e[0];}return;}if($f===undefined){$f={$blk:AX};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};BA=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=c.Implements(AY);$s=3;case 3:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}if(e){$s=1;continue;}$s=2;continue;case 1:return BC;case 2:f=c.Kind();$s=6;case 6:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}if(!((f===22))&&d){$s=4;continue;}$s=5;continue;case 4:g=G.PtrTo(c).Implements(AY);$s=9;case 9:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}if(g){$s=7;continue;}$s=8;continue;case 7:h=BD;i=BA(c,false);$s=10;case 10:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}j=i;k=CB(h,j);$s=11;case 11:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}$s=12;case 12:return k;case 8:case 5:l=c.Implements(AZ);$s=15;case 15:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}if(l){$s=13;continue;}$s=14;continue;case 13:return BE;case 14:m=c.Kind();$s=18;case 18:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}if(!((m===22))&&d){$s=16;continue;}$s=17;continue;case 16:n=G.PtrTo(c).Implements(AZ);$s=21;case 21:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}if(n){$s=19;continue;}$s=20;continue;case 19:o=BF;p=BA(c,false);$s=22;case 22:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;r=CB(o,q);$s=23;case 23:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}$s=24;case 24:return r;case 20:case 17:s=c.Kind();$s=26;case 26:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}t=s;if(t===(1)){$s=27;continue;}if((t===(2))||(t===(3))||(t===(4))||(t===(5))||(t===(6))){$s=28;continue;}if((t===(7))||(t===(8))||(t===(9))||(t===(10))||(t===(11))||(t===(12))){$s=29;continue;}if(t===(13)){$s=30;continue;}if(t===(14)){$s=31;continue;}if(t===(24)){$s=32;continue;}if(t===(20)){$s=33;continue;}if(t===(25)){$s=34;continue;}if(t===(21)){$s=35;continue;}if(t===(23)){$s=36;continue;}if(t===(17)){$s=37;continue;}if(t===(22)){$s=38;continue;}$s=39;continue;case 27:return BG;case 28:return BH;case 29:return BI;case 30:return BK;case 31:return BL;case 32:return BM;case 33:return BN;case 34:u=BQ(c);$s=41;case 41:if($c){$c=false;u=u.$blk();}if(u&&u.$blk!==undefined){break s;}$s=42;case 42:return u;case 35:v=BS(c);$s=43;case 43:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}$s=44;case 44:return v;case 36:w=BV(c);$s=45;case 45:if($c){$c=false;w=w.$blk();}if(w&&w.$blk!==undefined){break s;}$s=46;case 46:return w;case 37:x=BX(c);$s=47;case 47:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}$s=48;case 48:return x;case 38:y=BZ(c);$s=49;case 49:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}$s=50;case 50:return y;case 39:return BO;case 40:case 25:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BA};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.$s=$s;$f.$r=$r;return $f;};BB=function(c,d,e){var $ptr,c,d,e;d=d;c.Buffer.WriteString("null");};BC=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,l,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;if((d.Kind()===22)&&d.IsNil()){c.Buffer.WriteString("null");return;}f=d.Interface();$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=$assertType(f,AK);i=g.MarshalJSON();$s=2;case 2:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}h=i;j=h[0];k=h[1];if($interfaceIsEqual(k,$ifaceNil)){$s=3;continue;}$s=4;continue;case 3:l=CT(c.Buffer,j,true);$s=5;case 5:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}k=l;case 4:if(!($interfaceIsEqual(k,$ifaceNil))){c.error(new AO.ptr(d.Type(),k));}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BC};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.$s=$s;$f.$r=$r;return $f;};BD=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,l,m,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;f=d.Addr();if(f.IsNil()){c.Buffer.WriteString("null");return;}g=f.Interface();$s=1;case 1:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=$assertType(g,AK);j=h.MarshalJSON();$s=2;case 2:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}i=j;k=i[0];l=i[1];if($interfaceIsEqual(l,$ifaceNil)){$s=3;continue;}$s=4;continue;case 3:m=CT(c.Buffer,k,true);$s=5;case 5:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}l=m;case 4:if(!($interfaceIsEqual(l,$ifaceNil))){c.error(new AO.ptr(d.Type(),l));}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BD};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.$s=$s;$f.$r=$r;return $f;};BE=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;if((d.Kind()===22)&&d.IsNil()){c.Buffer.WriteString("null");return;}f=d.Interface();$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=$assertType(f,C.TextMarshaler);i=g.MarshalText();$s=2;case 2:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}h=i;j=h[0];k=h[1];if(!($interfaceIsEqual(k,$ifaceNil))){c.error(new AO.ptr(d.Type(),k));}c.stringBytes(j);$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BE};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.$s=$s;$f.$r=$r;return $f;};BF=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,l,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;f=d.Addr();if(f.IsNil()){c.Buffer.WriteString("null");return;}g=f.Interface();$s=1;case 1:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=$assertType(g,C.TextMarshaler);j=h.MarshalText();$s=2;case 2:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}i=j;k=i[0];l=i[1];if(!($interfaceIsEqual(l,$ifaceNil))){c.error(new AO.ptr(d.Type(),l));}c.stringBytes(k);$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BF};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.$s=$s;$f.$r=$r;return $f;};BG=function(c,d,e){var $ptr,c,d,e;d=d;if(e){c.Buffer.WriteByte(34);}if(d.Bool()){c.Buffer.WriteString("true");}else{c.Buffer.WriteString("false");}if(e){c.Buffer.WriteByte(34);}};BH=function(c,d,e){var $ptr,c,d,e,f;d=d;f=I.AppendInt($subslice(new EZ(c.scratch),0,0),d.Int(),10);if(e){c.Buffer.WriteByte(34);}c.Buffer.Write(f);if(e){c.Buffer.WriteByte(34);}};BI=function(c,d,e){var $ptr,c,d,e,f;d=d;f=I.AppendUint($subslice(new EZ(c.scratch),0,0),d.Uint(),10);if(e){c.Buffer.WriteByte(34);}c.Buffer.Write(f);if(e){c.Buffer.WriteByte(34);}};BJ.prototype.encode=function(c,d,e){var $ptr,c,d,e,f,g,h;d=d;f=this.$val;g=d.Float();if(M.IsInf(g,0)||M.IsNaN(g)){c.error(new AM.ptr($clone(d,G.Value),I.FormatFloat(g,103,-1,(f>>0))));}h=I.AppendFloat($subslice(new EZ(c.scratch),0,0),g,103,-1,(f>>0));if(e){c.Buffer.WriteByte(34);}c.Buffer.Write(h);if(e){c.Buffer.WriteByte(34);}};$ptrType(BJ).prototype.encode=function(c,d,e){return new BJ(this.$get()).encode(c,d,e);};BM=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;if($interfaceIsEqual(d.Type(),AD)){$s=1;continue;}$s=2;continue;case 1:f=d.String();$s=3;case 3:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=f;if(g===""){g="0";}if(!Y(g)){$s=4;continue;}$s=5;continue;case 4:h=F.Errorf("json: invalid number literal %q",new ET([new $String(g)]));$s=6;case 6:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}$r=c.error(h);$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 5:c.Buffer.WriteString(g);return;case 2:if(e){$s=8;continue;}$s=9;continue;case 8:j=d.String();$s=11;case 11:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}k=AH(new $String(j));$s=12;case 12:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}i=k;l=i[0];m=i[1];if(!($interfaceIsEqual(m,$ifaceNil))){c.error(m);}c.string($bytesToString(l));$s=10;continue;case 9:n=d.String();$s=13;case 13:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}o=c.string(n);$s=14;case 14:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}o;case 10:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BM};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.$s=$s;$f.$r=$r;return $f;};BN=function(c,d,e){var $ptr,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;if(d.IsNil()){c.Buffer.WriteString("null");return;}f=d.Elem();$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}$r=c.reflectValue(f);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BN};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};BO=function(c,d,e){var $ptr,c,d,e;d=d;c.error(new AL.ptr(d.Type()));};BP.ptr.prototype.encode=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;f=this;c.Buffer.WriteByte(123);g=true;h=f.fields;i=0;case 1:if(!(i=h.$length)?$throwRuntimeError("index out of range"):h.$array[h.$offset+i]),CG);l=CD(d,k.index);$s=3;case 3:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}m=l;if(!m.IsValid()||k.omitEmpty&&AT(m)){$s=4;continue;}$s=5;continue;case 4:i++;$s=1;continue;case 5:if(g){g=false;}else{c.Buffer.WriteByte(44);}c.string(k.name);c.Buffer.WriteByte(58);$r=(n=f.fieldEncs,((j<0||j>=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+j]))(c,m,k.quoted);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}i++;$s=1;continue;case 2:c.Buffer.WriteByte(125);$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BP.ptr.prototype.encode};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.$s=$s;$f.$r=$r;return $f;};BP.prototype.encode=function(c,d,e){return this.$val.encode(c,d,e);};BQ=function(c){var $ptr,c,d,e,f,g,h,i,j,k,l,m,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=CN(c);$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=d;f=new BP.ptr(e,$makeSlice(FJ,e.$length));g=e;h=0;case 2:if(!(h=g.$length)?$throwRuntimeError("index out of range"):g.$array[g.$offset+h]),CG);k=CE(c,j.index);$s=4;case 4:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}l=AX(k);$s=5;case 5:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}(m=f.fieldEncs,((i<0||i>=m.$length)?$throwRuntimeError("index out of range"):m.$array[m.$offset+i]=l));h++;$s=2;continue;case 3:return $methodVal(f,"encode");}return;}if($f===undefined){$f={$blk:BQ};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.$s=$s;$f.$r=$r;return $f;};BR.ptr.prototype.encode=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;f=this;if(d.IsNil()){c.Buffer.WriteString("null");return;}c.Buffer.WriteByte(123);h=d.MapKeys();$s=1;case 1:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}i=(g=h,$subslice(new CF(g.$array),g.$offset,g.$offset+g.$length));$r=N.Sort(i);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}j=i;k=0;case 3:if(!(k=j.$length)?$throwRuntimeError("index out of range"):j.$array[j.$offset+k]);if(l>0){c.Buffer.WriteByte(44);}n=m.String();$s=5;case 5:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}o=c.string(n);$s=6;case 6:if($c){$c=false;o=o.$blk();}if(o&&o.$blk!==undefined){break s;}o;c.Buffer.WriteByte(58);p=c;q=d.MapIndex(m);$s=7;case 7:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=q;$r=f.elemEnc(p,r,false);$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}k++;$s=3;continue;case 4:c.Buffer.WriteByte(125);$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BR.ptr.prototype.encode};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.$s=$s;$f.$r=$r;return $f;};BR.prototype.encode=function(c,d,e){return this.$val.encode(c,d,e);};BS=function(c){var $ptr,c,d,e,f,g,h,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=c.Key();$s=3;case 3:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=d.Kind();$s=4;case 4:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}if(!((e===24))){$s=1;continue;}$s=2;continue;case 1:return BO;case 2:f=c.Elem();$s=5;case 5:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=AX(f);$s=6;case 6:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=new BR.ptr(g);return $methodVal(h,"encode");}return;}if($f===undefined){$f={$blk:BS};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.$s=$s;$f.$r=$r;return $f;};BT=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;if(d.IsNil()){c.Buffer.WriteString("null");return;}f=d.Bytes();$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=f;c.Buffer.WriteByte(34);if(g.$length<1024){$s=2;continue;}$s=3;continue;case 2:h=$makeSlice(EZ,D.StdEncoding.EncodedLen(g.$length));D.StdEncoding.Encode(h,g);c.Buffer.Write(h);$s=4;continue;case 3:i=D.NewEncoder(D.StdEncoding,c);j=i.Write(g);$s=5;case 5:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}j;k=i.Close();$s=6;case 6:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}k;case 4:c.Buffer.WriteByte(34);$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BT};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.$s=$s;$f.$r=$r;return $f;};BU.ptr.prototype.encode=function(c,d,e){var $ptr,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;f=this;if(d.IsNil()){c.Buffer.WriteString("null");return;}$r=f.arrayEnc(c,d,false);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BU.ptr.prototype.encode};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};BU.prototype.encode=function(c,d,e){return this.$val.encode(c,d,e);};BV=function(c){var $ptr,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=c.Elem();$s=3;case 3:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=d.Kind();$s=4;case 4:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}if(e===8){$s=1;continue;}$s=2;continue;case 1:return BT;case 2:f=BX(c);$s=5;case 5:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=new BU.ptr(f);return $methodVal(g,"encode");}return;}if($f===undefined){$f={$blk:BV};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};BW.ptr.prototype.encode=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;f=this;c.Buffer.WriteByte(91);g=d.Len();h=0;case 1:if(!(h0){c.Buffer.WriteByte(44);}i=c;j=d.Index(h);$s=3;case 3:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}k=j;$r=f.elemEnc(i,k,false);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}h=h+(1)>>0;$s=1;continue;case 2:c.Buffer.WriteByte(93);$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BW.ptr.prototype.encode};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.$s=$s;$f.$r=$r;return $f;};BW.prototype.encode=function(c,d,e){return this.$val.encode(c,d,e);};BX=function(c){var $ptr,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=c.Elem();$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=AX(d);$s=2;case 2:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=new BW.ptr(e);return $methodVal(f,"encode");}return;}if($f===undefined){$f={$blk:BX};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};BY.ptr.prototype.encode=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;f=this;if(d.IsNil()){c.Buffer.WriteString("null");return;}g=c;h=d.Elem();$s=1;case 1:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}i=h;j=e;$r=f.elemEnc(g,i,j);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;case-1:}return;}if($f===undefined){$f={$blk:BY.ptr.prototype.encode};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.$s=$s;$f.$r=$r;return $f;};BY.prototype.encode=function(c,d,e){return this.$val.encode(c,d,e);};BZ=function(c){var $ptr,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=c.Elem();$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=AX(d);$s=2;case 2:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=new BY.ptr(e);return $methodVal(f,"encode");}return;}if($f===undefined){$f={$blk:BZ};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};CA.ptr.prototype.encode=function(c,d,e){var $ptr,c,d,e,f,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=d;f=this;if(d.CanAddr()){$s=1;continue;}$s=2;continue;case 1:$r=f.canAddrEnc(c,d,e);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=3;continue;case 2:$r=f.elseEnc(c,d,e);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 3:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:CA.ptr.prototype.encode};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.$s=$s;$f.$r=$r;return $f;};CA.prototype.encode=function(c,d,e){return this.$val.encode(c,d,e);};CB=function(c,d){var $ptr,c,d,e;e=new CA.ptr(c,d);return $methodVal(e,"encode");};CC=function(c){var $ptr,c,d,e,f,g;if(c===""){return false;}d=c;e=0;while(true){if(!(e?@[]^_{|}~ ",g)){}else if(!J.IsLetter(g)&&!J.IsDigit(g)){return false;}e+=f[1];}return true;};CD=function(c,d){var $ptr,c,d,e,f,g,h,i,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:c=c;e=d;f=0;case 1:if(!(f=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+f]);if(c.Kind()===22){$s=3;continue;}$s=4;continue;case 3:if(c.IsNil()){return new G.Value.ptr(FD.nil,0,0);}h=c.Elem();$s=5;case 5:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}c=h;case 4:i=c.Field(g);$s=6;case 6:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}c=i;f++;$s=1;continue;case 2:return c;}return;}if($f===undefined){$f={$blk:CD};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.$s=$s;$f.$r=$r;return $f;};CE=function(c,d){var $ptr,c,d,e,f,g,h,i,j,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=d;f=0;case 1:if(!(f=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+f]);h=c.Kind();$s=5;case 5:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}if(h===22){$s=3;continue;}$s=4;continue;case 3:i=c.Elem();$s=6;case 6:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}c=i;case 4:j=c.Field(g);$s=7;case 7:if($c){$c=false;j=j.$blk();}if(j&&j.$blk!==undefined){break s;}c=j.Type;f++;$s=1;continue;case 2:return c;}return;}if($f===undefined){$f={$blk:CE};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.$s=$s;$f.$r=$r;return $f;};CF.prototype.Len=function(){var $ptr,c;c=this;return c.$length;};$ptrType(CF).prototype.Len=function(){return this.$get().Len();};CF.prototype.Swap=function(c,d){var $ptr,c,d,e,f,g;e=this;f=((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]);g=((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]);((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]=f);((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]=g);};$ptrType(CF).prototype.Swap=function(c,d){return this.$get().Swap(c,d);};CF.prototype.Less=function(c,d){var $ptr,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:e=this;f=e.get(c);$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=e.get(d);$s=2;case 2:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}$s=3;case 3:return f=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+c]).String();$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}$s=2;case 2:return e;}return;}if($f===undefined){$f={$blk:CF.prototype.get};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.$s=$s;$f.$r=$r;return $f;};$ptrType(CF).prototype.get=function(c){return this.$get().get(c);};AQ.ptr.prototype.string=function(c){var $ptr,c,d,e,f,g,h,i,j,k,l;d=this;e=d.Buffer.Len();d.Buffer.WriteByte(34);f=0;g=0;while(true){if(!(g>0;continue;}if(f>>4<<24>>>24)));d.Buffer.WriteByte(AP.charCodeAt(((h&15)>>>0)));}g=g+(1)>>0;f=g;continue;}j=L.DecodeRuneInString(c.substring(g));k=j[0];l=j[1];if((k===65533)&&(l===1)){if(f>0;f=g;continue;}if((k===8232)||(k===8233)){if(f>0;f=g;continue;}g=g+(l)>>0;}if(f>0;};AQ.prototype.string=function(c){return this.$val.string(c);};AQ.ptr.prototype.stringBytes=function(c){var $ptr,c,d,e,f,g,h,i,j,k,l;d=this;e=d.Buffer.Len();d.Buffer.WriteByte(34);f=0;g=0;while(true){if(!(g=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+g]);if(h<128){if(32<=h&&!((h===92))&&!((h===34))&&!((h===60))&&!((h===62))&&!((h===38))){g=g+(1)>>0;continue;}if(f>>4<<24>>>24)));d.Buffer.WriteByte(AP.charCodeAt(((h&15)>>>0)));}g=g+(1)>>0;f=g;continue;}j=L.DecodeRune($subslice(c,g));k=j[0];l=j[1];if((k===65533)&&(l===1)){if(f>0;f=g;continue;}if((k===8232)||(k===8233)){if(f>0;f=g;continue;}g=g+(l)>>0;}if(f>0;};AQ.prototype.stringBytes=function(c){return this.$val.stringBytes(c);};CH=function(c){var $ptr,c;c=$clone(c,CG);c.nameBytes=new EZ($stringToBytes(c.name));c.equalFold=CO(c.nameBytes);return c;};CI.prototype.Len=function(){var $ptr,c;c=this;return c.$length;};$ptrType(CI).prototype.Len=function(){return this.$get().Len();};CI.prototype.Swap=function(c,d){var $ptr,c,d,e,f,g;e=this;f=$clone(((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]),CG);g=$clone(((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]),CG);CG.copy(((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]),f);CG.copy(((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]),g);};$ptrType(CI).prototype.Swap=function(c,d){return this.$get().Swap(c,d);};CI.prototype.Less=function(c,d){var $ptr,c,d,e;e=this;if(!(((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]).name===((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]).name)){return((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]).name<((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]).name;}if(!((((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]).index.$length===((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]).index.$length))){return((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]).index.$length<((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]).index.$length;}if(!(((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]).tag===((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]).tag)){return((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]).tag;}return $subslice(new CJ(e.$array),e.$offset,e.$offset+e.$length).Less(c,d);};$ptrType(CI).prototype.Less=function(c,d){return this.$get().Less(c,d);};CJ.prototype.Len=function(){var $ptr,c;c=this;return c.$length;};$ptrType(CJ).prototype.Len=function(){return this.$get().Len();};CJ.prototype.Swap=function(c,d){var $ptr,c,d,e,f,g;e=this;f=$clone(((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]),CG);g=$clone(((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]),CG);CG.copy(((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]),f);CG.copy(((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]),g);};$ptrType(CJ).prototype.Swap=function(c,d){return this.$get().Swap(c,d);};CJ.prototype.Less=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k;e=this;f=((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]).index;g=0;while(true){if(!(g=f.$length)?$throwRuntimeError("index out of range"):f.$array[f.$offset+g]);if(h>=((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]).index.$length){return false;}if(!((i===(j=((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]).index,((h<0||h>=j.$length)?$throwRuntimeError("index out of range"):j.$array[j.$offset+h]))))){return i<(k=((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]).index,((h<0||h>=k.$length)?$throwRuntimeError("index out of range"):k.$array[k.$offset+h]));}g++;}return((c<0||c>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+c]).index.$length<((d<0||d>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+d]).index.$length;};$ptrType(CJ).prototype.Less=function(c,d){return this.$get().Less(c,d);};CK=function(c){var $ptr,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,ba,bb,bc,bd,be,bf,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;aa=$f.aa;ab=$f.ab;ac=$f.ac;ad=$f.ad;ae=$f.ae;af=$f.af;ag=$f.ag;ah=$f.ah;ai=$f.ai;aj=$f.aj;ak=$f.ak;al=$f.al;am=$f.am;an=$f.an;ao=$f.ao;ap=$f.ap;aq=$f.aq;ar=$f.ar;as=$f.as;at=$f.at;au=$f.au;av=$f.av;aw=$f.aw;ax=$f.ax;ay=$f.ay;az=$f.az;ba=$f.ba;bb=$f.bb;bc=$f.bc;bd=$f.bd;be=$f.be;bf=$f.bf;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;s=$f.s;t=$f.t;u=$f.u;v=$f.v;w=$f.w;x=$f.x;y=$f.y;z=$f.z;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:d=new EW([]);e=new EW([new CG.ptr("",EZ.nil,$throwNilPointerError,false,FC.nil,c,false,false)]);f=$makeMap(G.Type.keyFor,[]);g=$makeMap(G.Type.keyFor,[]);h=$makeMap(G.Type.keyFor,[]);i=EW.nil;case 1:if(!(e.$length>0)){$s=2;continue;}j=e;k=$subslice(d,0,0);d=j;e=k;l=g;m=$makeMap(G.Type.keyFor,[]);f=l;g=m;n=d;o=0;case 3:if(!(o=n.$length)?$throwRuntimeError("index out of range"):n.$array[n.$offset+o]),CG);if((q=h[G.Type.keyFor(p.typ)],q!==undefined?q.v:false)){$s=5;continue;}$s=6;continue;case 5:o++;$s=3;continue;case 6:r=p.typ;(h||$throwRuntimeError("assignment to entry in nil map"))[G.Type.keyFor(r)]={k:r,v:true};s=0;case 7:t=p.typ.NumField();$s=9;case 9:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}if(!(s>0;$s=7;continue;case 12:w=new G.StructTag(v.Tag).Get("json");if(w==="-"){$s=13;continue;}$s=14;continue;case 13:s=s+(1)>>0;$s=7;continue;case 14:x=ES(w);y=x[0];z=x[1];if(!CC(y)){y="";}aa=$makeSlice(FC,(p.index.$length+1>>0));$copySlice(aa,p.index);(ab=p.index.$length,((ab<0||ab>=aa.$length)?$throwRuntimeError("index out of range"):aa.$array[aa.$offset+ab]=s));ac=v.Type;ae=ac.Name();$s=18;case 18:if($c){$c=false;ae=ae.$blk();}if(ae&&ae.$blk!==undefined){break s;}if(!(ae==="")){ad=false;$s=17;continue s;}af=ac.Kind();$s=19;case 19:if($c){$c=false;af=af.$blk();}if(af&&af.$blk!==undefined){break s;}ad=af===22;case 17:if(ad){$s=15;continue;}$s=16;continue;case 15:ag=ac.Elem();$s=20;case 20:if($c){$c=false;ag=ag.$blk();}if(ag&&ag.$blk!==undefined){break s;}ac=ag;case 16:ah=false;if(new ER(z).Contains("string")){$s=21;continue;}$s=22;continue;case 21:ai=ac.Kind();$s=24;case 24:if($c){$c=false;ai=ai.$blk();}if(ai&&ai.$blk!==undefined){break s;}aj=ai;if((aj===(1))||(aj===(2))||(aj===(3))||(aj===(4))||(aj===(5))||(aj===(6))||(aj===(7))||(aj===(8))||(aj===(9))||(aj===(10))||(aj===(11))||(aj===(13))||(aj===(14))||(aj===(24))){ah=true;}case 23:case 22:if(!(y==="")||!v.Anonymous){ak=true;$s=27;continue s;}al=ac.Kind();$s=28;case 28:if($c){$c=false;al=al.$blk();}if(al&&al.$blk!==undefined){break s;}ak=!((al===25));case 27:if(ak){$s=25;continue;}$s=26;continue;case 25:am=!(y==="");if(y===""){y=v.Name;}i=$append(i,CH(new CG.ptr(y,EZ.nil,$throwNilPointerError,am,aa,ac,new ER(z).Contains("omitempty"),ah)));if((an=f[G.Type.keyFor(p.typ)],an!==undefined?an.v:0)>1){i=$append(i,(ao=i.$length-1>>0,((ao<0||ao>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+ao])));}s=s+(1)>>0;$s=7;continue;case 26:ap=ac;(g||$throwRuntimeError("assignment to entry in nil map"))[G.Type.keyFor(ap)]={k:ap,v:(aq=g[G.Type.keyFor(ac)],aq!==undefined?aq.v:0)+(1)>>0};if((ar=g[G.Type.keyFor(ac)],ar!==undefined?ar.v:0)===1){$s=29;continue;}$s=30;continue;case 29:as=ac.Name();$s=31;case 31:if($c){$c=false;as=as.$blk();}if(as&&as.$blk!==undefined){break s;}at=CH(new CG.ptr(as,EZ.nil,$throwNilPointerError,false,aa,ac,false,false));$s=32;case 32:if($c){$c=false;at=at.$blk();}if(at&&at.$blk!==undefined){break s;}e=$append(e,at);case 30:s=s+(1)>>0;$s=7;continue;case 8:o++;$s=3;continue;case 4:$s=1;continue;case 2:$r=N.Sort($subslice(new CI(i.$array),i.$offset,i.$offset+i.$length));$s=33;case 33:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}au=$subslice(i,0,0);av=0;aw=0;ax=av;ay=aw;case 34:if(!(ay=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+ay]),CG);ba=az.name;ax=1;while(true){if(!((ay+ax>>0)>0,((bb<0||bb>=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+bb])),CG);if(!(bc.name===ba)){break;}ax=ax+(1)>>0;}if(ax===1){au=$append(au,az);ay=ay+(ax)>>0;$s=34;continue;}bd=CL($subslice(i,ay,(ay+ax>>0)));be=$clone(bd[0],CG);bf=bd[1];if(bf){au=$append(au,be);}ay=ay+(ax)>>0;$s=34;continue;case 35:i=au;$r=N.Sort($subslice(new CJ(i.$array),i.$offset,i.$offset+i.$length));$s=36;case 36:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}return i;}return;}if($f===undefined){$f={$blk:CK};}$f.$ptr=$ptr;$f.aa=aa;$f.ab=ab;$f.ac=ac;$f.ad=ad;$f.ae=ae;$f.af=af;$f.ag=ag;$f.ah=ah;$f.ai=ai;$f.aj=aj;$f.ak=ak;$f.al=al;$f.am=am;$f.an=an;$f.ao=ao;$f.ap=ap;$f.aq=aq;$f.ar=ar;$f.as=as;$f.at=at;$f.au=au;$f.av=av;$f.aw=aw;$f.ax=ax;$f.ay=ay;$f.az=az;$f.ba=ba;$f.bb=bb;$f.bc=bc;$f.bd=bd;$f.be=be;$f.bf=bf;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.q=q;$f.r=r;$f.s=s;$f.t=t;$f.u=u;$f.v=v;$f.w=w;$f.x=x;$f.y=y;$f.z=z;$f.$s=$s;$f.$r=$r;return $f;};CL=function(c){var $ptr,c,d,e,f,g,h,i;d=(0>=c.$length?$throwRuntimeError("index out of range"):c.$array[c.$offset+0]).index.$length;e=-1;f=c;g=0;while(true){if(!(g=f.$length)?$throwRuntimeError("index out of range"):f.$array[f.$offset+g]),CG);if(i.index.$length>d){c=$subslice(c,0,h);break;}if(i.tag){if(e>=0){return[new CG.ptr("",EZ.nil,$throwNilPointerError,false,FC.nil,$ifaceNil,false,false),false];}e=h;}g++;}if(e>=0){return[((e<0||e>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+e]),true];}if(c.$length>1){return[new CG.ptr("",EZ.nil,$throwNilPointerError,false,FC.nil,$ifaceNil,false,false),false];}return[(0>=c.$length?$throwRuntimeError("index out of range"):c.$array[c.$offset+0]),true];};CN=function(c){var $ptr,c,d,e,f,g,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:CM.RWMutex.RLock();e=(d=CM.m[G.Type.keyFor(c)],d!==undefined?d.v:EW.nil);CM.RWMutex.RUnlock();if(!(e===EW.nil)){return e;}f=CK(c);$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}e=f;if(e===EW.nil){e=new EW([]);}CM.RWMutex.Lock();if(CM.m===false){CM.m=$makeMap(G.Type.keyFor,[]);}g=c;(CM.m||$throwRuntimeError("assignment to entry in nil map"))[G.Type.keyFor(g)]={k:g,v:e};CM.RWMutex.Unlock();return e;}return;}if($f===undefined){$f={$blk:CN};}$f.$ptr=$ptr;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.$s=$s;$f.$r=$r;return $f;};CO=function(c){var $ptr,c,d,e,f,g,h,i;d=false;e=false;f=c;g=0;while(true){if(!(g=f.$length)?$throwRuntimeError("index out of range"):f.$array[f.$offset+g]);if(h>=128){return B.EqualFold;}i=(h&223)>>>0;if(i<65||i>90){d=true;}else if((i===75)||(i===83)){e=true;}g++;}if(e){return CP;}if(d){return CQ;}return CR;};CP=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k,l,m;e=c;f=0;while(true){if(!(f=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+f]);if(d.$length===0){return false;}h=(0>=d.$length?$throwRuntimeError("index out of range"):d.$array[d.$offset+0]);if(h<128){if(!((g===h))){i=(g&223)>>>0;if(65<=i&&i<=90){if(!((i===((h&223)>>>0)))){return false;}}else{return false;}}d=$subslice(d,1);f++;continue;}j=L.DecodeRune(d);k=j[0];l=j[1];m=g;if((m===(115))||(m===(83))){if(!((k===383))){return false;}}else if((m===(107))||(m===(75))){if(!((k===8490))){return false;}}else{return false;}d=$subslice(d,l);f++;}if(d.$length>0){return false;}return true;};CQ=function(c,d){var $ptr,c,d,e,f,g,h,i;if(!((c.$length===d.$length))){return false;}e=c;f=0;while(true){if(!(f=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+f]);i=((g<0||g>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+g]);if(h===i){f++;continue;}if((97<=h&&h<=122)||(65<=h&&h<=90)){if(!((((h&223)>>>0)===((i&223)>>>0)))){return false;}}else{return false;}f++;}return true;};CR=function(c,d){var $ptr,c,d,e,f,g,h;if(!((c.$length===d.$length))){return false;}e=c;f=0;while(true){if(!(f=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+f]);if(!((((h&223)>>>0)===((((g<0||g>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+g])&223)>>>0)))){return false;}f++;}return true;};CT=function(c,d,e){var $ptr,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;q=$f.q;r=$f.r;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:f=[f];g=c.Len();f[0]=new CZ.ptr($throwNilPointerError,false,FC.nil,$ifaceNil,false,0,$throwNilPointerError,new $Int64(0,0));f[0].reset();h=0;i=d;j=0;case 1:if(!(j=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+j]);if(e&&((l===60)||(l===62)||(l===38))){if(h>>4<<24>>>24)));c.WriteByte(AP.charCodeAt(((l&15)>>>0)));h=k+1>>0;}if((l===226)&&(k+2>>0)>0,((m<0||m>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+m]))===128)&&((((n=k+2>>0,((n<0||n>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+n]))&~1)<<24>>>24)===168)){if(h>0,((o<0||o>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+o]))&15)>>>0)));h=k+3>>0;}p=f[0].step(f[0],l);$s=3;case 3:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;if(q>=9){if(q===11){$s=2;continue;}if(h>0;}j++;$s=1;continue;case 2:r=f[0].eof();$s=6;case 6:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}if(r===11){$s=4;continue;}$s=5;continue;case 4:c.Truncate(g);return f[0].err;case 5:if(h>0;c.parseState=$subslice(c.parseState,0,d);c.redo=false;if(d===0){c.step=DG;c.endTop=true;}else{c.step=DF;}};CZ.prototype.popParseState=function(){return this.$val.popParseState();};DA=function(c){var $ptr,c;return(c===32)||(c===9)||(c===13)||(c===10);};DB=function(c,d){var $ptr,c,d;if(d<=32&&DA(d)){return 9;}if(d===93){return DF(c,d);}return DC(c,d);};DC=function(c,d){var $ptr,c,d,e;if(d<=32&&DA(d)){return 9;}e=d;if(e===(123)){c.step=DD;c.pushParseState(0);return 2;}else if(e===(91)){c.step=DB;c.pushParseState(2);return 6;}else if(e===(34)){c.step=DH;return 1;}else if(e===(45)){c.step=DN;return 1;}else if(e===(48)){c.step=DP;return 1;}else if(e===(116)){c.step=DV;return 1;}else if(e===(102)){c.step=DY;return 1;}else if(e===(110)){c.step=EC;return 1;}if(49<=d&&d<=57){c.step=DO;return 1;}return c.error(d,"looking for beginning of value");};DD=function(c,d){var $ptr,c,d,e,f,g;if(d<=32&&DA(d)){return 9;}if(d===125){e=c.parseState.$length;(f=c.parseState,g=e-1>>0,((g<0||g>=f.$length)?$throwRuntimeError("index out of range"):f.$array[f.$offset+g]=1));return DF(c,d);}return DE(c,d);};DE=function(c,d){var $ptr,c,d;if(d<=32&&DA(d)){return 9;}if(d===34){c.step=DH;return 1;}return c.error(d,"looking for beginning of object key string");};DF=function(c,d){var $ptr,c,d,e,f,g,h,i,j,k,l,m;e=c.parseState.$length;if(e===0){c.step=DG;c.endTop=true;return DG(c,d);}if(d<=32&&DA(d)){c.step=DF;return 9;}h=(f=c.parseState,g=e-1>>0,((g<0||g>=f.$length)?$throwRuntimeError("index out of range"):f.$array[f.$offset+g]));i=h;if(i===(0)){if(d===58){(j=c.parseState,k=e-1>>0,((k<0||k>=j.$length)?$throwRuntimeError("index out of range"):j.$array[j.$offset+k]=1));c.step=DC;return 3;}return c.error(d,"after object key");}else if(i===(1)){if(d===44){(l=c.parseState,m=e-1>>0,((m<0||m>=l.$length)?$throwRuntimeError("index out of range"):l.$array[l.$offset+m]=0));c.step=DE;return 4;}if(d===125){c.popParseState();return 5;}return c.error(d,"after object key:value pair");}else if(i===(2)){if(d===44){c.step=DC;return 7;}if(d===93){c.popParseState();return 8;}return c.error(d,"after array element");}return c.error(d,"");};DG=function(c,d){var $ptr,c,d;if(!((d===32))&&!((d===9))&&!((d===13))&&!((d===10))){c.error(d,"after top-level value");}return 10;};DH=function(c,d){var $ptr,c,d;if(d===34){c.step=DF;return 0;}if(d===92){c.step=DI;return 0;}if(d<32){return c.error(d,"in string literal");}return 0;};DI=function(c,d){var $ptr,c,d,e;e=d;if((e===(98))||(e===(102))||(e===(110))||(e===(114))||(e===(116))||(e===(92))||(e===(47))||(e===(34))){c.step=DH;return 0;}else if(e===(117)){c.step=DJ;return 0;}return c.error(d,"in string escape code");};DJ=function(c,d){var $ptr,c,d;if(48<=d&&d<=57||97<=d&&d<=102||65<=d&&d<=70){c.step=DK;return 0;}return c.error(d,"in \\u hexadecimal character escape");};DK=function(c,d){var $ptr,c,d;if(48<=d&&d<=57||97<=d&&d<=102||65<=d&&d<=70){c.step=DL;return 0;}return c.error(d,"in \\u hexadecimal character escape");};DL=function(c,d){var $ptr,c,d;if(48<=d&&d<=57||97<=d&&d<=102||65<=d&&d<=70){c.step=DM;return 0;}return c.error(d,"in \\u hexadecimal character escape");};DM=function(c,d){var $ptr,c,d;if(48<=d&&d<=57||97<=d&&d<=102||65<=d&&d<=70){c.step=DH;return 0;}return c.error(d,"in \\u hexadecimal character escape");};DN=function(c,d){var $ptr,c,d;if(d===48){c.step=DP;return 0;}if(49<=d&&d<=57){c.step=DO;return 0;}return c.error(d,"in numeric literal");};DO=function(c,d){var $ptr,c,d;if(48<=d&&d<=57){c.step=DO;return 0;}return DP(c,d);};DP=function(c,d){var $ptr,c,d;if(d===46){c.step=DQ;return 0;}if((d===101)||(d===69)){c.step=DS;return 0;}return DF(c,d);};DQ=function(c,d){var $ptr,c,d;if(48<=d&&d<=57){c.step=DR;return 0;}return c.error(d,"after decimal point in numeric literal");};DR=function(c,d){var $ptr,c,d;if(48<=d&&d<=57){return 0;}if((d===101)||(d===69)){c.step=DS;return 0;}return DF(c,d);};DS=function(c,d){var $ptr,c,d;if((d===43)||(d===45)){c.step=DT;return 0;}return DT(c,d);};DT=function(c,d){var $ptr,c,d;if(48<=d&&d<=57){c.step=DU;return 0;}return c.error(d,"in exponent of numeric literal");};DU=function(c,d){var $ptr,c,d;if(48<=d&&d<=57){return 0;}return DF(c,d);};DV=function(c,d){var $ptr,c,d;if(d===114){c.step=DW;return 0;}return c.error(d,"in literal true (expecting 'r')");};DW=function(c,d){var $ptr,c,d;if(d===117){c.step=DX;return 0;}return c.error(d,"in literal true (expecting 'u')");};DX=function(c,d){var $ptr,c,d;if(d===101){c.step=DF;return 0;}return c.error(d,"in literal true (expecting 'e')");};DY=function(c,d){var $ptr,c,d;if(d===97){c.step=DZ;return 0;}return c.error(d,"in literal false (expecting 'a')");};DZ=function(c,d){var $ptr,c,d;if(d===108){c.step=EA;return 0;}return c.error(d,"in literal false (expecting 'l')");};EA=function(c,d){var $ptr,c,d;if(d===115){c.step=EB;return 0;}return c.error(d,"in literal false (expecting 's')");};EB=function(c,d){var $ptr,c,d;if(d===101){c.step=DF;return 0;}return c.error(d,"in literal false (expecting 'e')");};EC=function(c,d){var $ptr,c,d;if(d===117){c.step=ED;return 0;}return c.error(d,"in literal null (expecting 'u')");};ED=function(c,d){var $ptr,c,d;if(d===108){c.step=EE;return 0;}return c.error(d,"in literal null (expecting 'l')");};EE=function(c,d){var $ptr,c,d;if(d===108){c.step=DF;return 0;}return c.error(d,"in literal null (expecting 'l')");};EF=function(c,d){var $ptr,c,d;return 11;};CZ.ptr.prototype.error=function(c,d){var $ptr,c,d,e;e=this;e.step=EF;e.err=new CY.ptr("invalid character "+EG(c)+" "+d,e.bytes);return 11;};CZ.prototype.error=function(c,d){return this.$val.error(c,d);};EG=function(c){var $ptr,c,d;if(c===39){return"'\\''";}if(c===34){return"'\"'";}d=I.Quote($encodeRune(c));return"'"+d.substring(1,(d.length-1>>0))+"'";};ES=function(c){var $ptr,c,d;d=O.Index(c,",");if(!((d===-1))){return[c.substring(0,d),c.substring((d+1>>0))];}return[c,""];};ER.prototype.Contains=function(c){var $ptr,c,d,e,f,g,h,i;d=this.$val;if(d.length===0){return false;}e=d;while(true){if(!(!(e===""))){break;}f="";g=O.Index(e,",");if(g>=0){h=e.substring(0,g);i=e.substring((g+1>>0));e=h;f=i;}if(e===c){return true;}e=f;}return false;};$ptrType(ER).prototype.Contains=function(c){return new ER(this.$get()).Contains(c);};X.methods=[{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"Float64",name:"Float64",pkg:"",typ:$funcType([],[$Float64,$error],false)},{prop:"Int64",name:"Int64",pkg:"",typ:$funcType([],[$Int64,$error],false)}];FS.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];FT.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];FV.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];FI.methods=[{prop:"marshal",name:"marshal",pkg:"encoding/json",typ:$funcType([$emptyInterface],[$error],false)},{prop:"error",name:"error",pkg:"encoding/json",typ:$funcType([$error],[],false)},{prop:"reflectValue",name:"reflectValue",pkg:"encoding/json",typ:$funcType([G.Value],[],false)},{prop:"string",name:"string",pkg:"encoding/json",typ:$funcType([$String],[$Int],false)},{prop:"stringBytes",name:"stringBytes",pkg:"encoding/json",typ:$funcType([EZ],[$Int],false)}];BJ.methods=[{prop:"encode",name:"encode",pkg:"encoding/json",typ:$funcType([FI,G.Value,$Bool],[],false)}];FW.methods=[{prop:"encode",name:"encode",pkg:"encoding/json",typ:$funcType([FI,G.Value,$Bool],[],false)}];FX.methods=[{prop:"encode",name:"encode",pkg:"encoding/json",typ:$funcType([FI,G.Value,$Bool],[],false)}];FY.methods=[{prop:"encode",name:"encode",pkg:"encoding/json",typ:$funcType([FI,G.Value,$Bool],[],false)}];FZ.methods=[{prop:"encode",name:"encode",pkg:"encoding/json",typ:$funcType([FI,G.Value,$Bool],[],false)}];GA.methods=[{prop:"encode",name:"encode",pkg:"encoding/json",typ:$funcType([FI,G.Value,$Bool],[],false)}];GB.methods=[{prop:"encode",name:"encode",pkg:"encoding/json",typ:$funcType([FI,G.Value,$Bool],[],false)}];CF.methods=[{prop:"Len",name:"Len",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Swap",name:"Swap",pkg:"",typ:$funcType([$Int,$Int],[],false)},{prop:"Less",name:"Less",pkg:"",typ:$funcType([$Int,$Int],[$Bool],false)},{prop:"get",name:"get",pkg:"encoding/json",typ:$funcType([$Int],[$String],false)}];CI.methods=[{prop:"Len",name:"Len",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Swap",name:"Swap",pkg:"",typ:$funcType([$Int,$Int],[],false)},{prop:"Less",name:"Less",pkg:"",typ:$funcType([$Int,$Int],[$Bool],false)}];CJ.methods=[{prop:"Len",name:"Len",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Swap",name:"Swap",pkg:"",typ:$funcType([$Int,$Int],[],false)},{prop:"Less",name:"Less",pkg:"",typ:$funcType([$Int,$Int],[$Bool],false)}];FN.methods=[{prop:"Error",name:"Error",pkg:"",typ:$funcType([],[$String],false)}];GD.methods=[{prop:"reset",name:"reset",pkg:"encoding/json",typ:$funcType([],[],false)},{prop:"eof",name:"eof",pkg:"encoding/json",typ:$funcType([],[$Int],false)},{prop:"pushParseState",name:"pushParseState",pkg:"encoding/json",typ:$funcType([$Int],[],false)},{prop:"popParseState",name:"popParseState",pkg:"encoding/json",typ:$funcType([],[],false)},{prop:"error",name:"error",pkg:"encoding/json",typ:$funcType([$Uint8,$String],[$Int],false)},{prop:"undo",name:"undo",pkg:"encoding/json",typ:$funcType([$Int],[],false)}];ER.methods=[{prop:"Contains",name:"Contains",pkg:"",typ:$funcType([$String],[$Bool],false)}];AK.init([{prop:"MarshalJSON",name:"MarshalJSON",pkg:"",typ:$funcType([],[EZ,$error],false)}]);AL.init([{prop:"Type",name:"Type",pkg:"",typ:G.Type,tag:""}]);AM.init([{prop:"Value",name:"Value",pkg:"",typ:G.Value,tag:""},{prop:"Str",name:"Str",pkg:"",typ:$String,tag:""}]);AO.init([{prop:"Type",name:"Type",pkg:"",typ:G.Type,tag:""},{prop:"Err",name:"Err",pkg:"",typ:$error,tag:""}]);AQ.init([{prop:"Buffer",name:"",pkg:"",typ:B.Buffer,tag:""},{prop:"scratch",name:"scratch",pkg:"encoding/json",typ:FH,tag:""}]);AU.init([FI,G.Value,$Bool],[],false);BP.init([{prop:"fields",name:"fields",pkg:"encoding/json",typ:EW,tag:""},{prop:"fieldEncs",name:"fieldEncs",pkg:"encoding/json",typ:FJ,tag:""}]);BR.init([{prop:"elemEnc",name:"elemEnc",pkg:"encoding/json",typ:AU,tag:""}]);BU.init([{prop:"arrayEnc",name:"arrayEnc",pkg:"encoding/json",typ:AU,tag:""}]);BW.init([{prop:"elemEnc",name:"elemEnc",pkg:"encoding/json",typ:AU,tag:""}]);BY.init([{prop:"elemEnc",name:"elemEnc",pkg:"encoding/json",typ:AU,tag:""}]);CA.init([{prop:"canAddrEnc",name:"canAddrEnc",pkg:"encoding/json",typ:AU,tag:""},{prop:"elseEnc",name:"elseEnc",pkg:"encoding/json",typ:AU,tag:""}]);CF.init(G.Value);CG.init([{prop:"name",name:"name",pkg:"encoding/json",typ:$String,tag:""},{prop:"nameBytes",name:"nameBytes",pkg:"encoding/json",typ:EZ,tag:""},{prop:"equalFold",name:"equalFold",pkg:"encoding/json",typ:GC,tag:""},{prop:"tag",name:"tag",pkg:"encoding/json",typ:$Bool,tag:""},{prop:"index",name:"index",pkg:"encoding/json",typ:FC,tag:""},{prop:"typ",name:"typ",pkg:"encoding/json",typ:G.Type,tag:""},{prop:"omitEmpty",name:"omitEmpty",pkg:"encoding/json",typ:$Bool,tag:""},{prop:"quoted",name:"quoted",pkg:"encoding/json",typ:$Bool,tag:""}]);CI.init(CG);CJ.init(CG);CY.init([{prop:"msg",name:"msg",pkg:"encoding/json",typ:$String,tag:""},{prop:"Offset",name:"Offset",pkg:"",typ:$Int64,tag:""}]);CZ.init([{prop:"step",name:"step",pkg:"encoding/json",typ:GE,tag:""},{prop:"endTop",name:"endTop",pkg:"encoding/json",typ:$Bool,tag:""},{prop:"parseState",name:"parseState",pkg:"encoding/json",typ:FC,tag:""},{prop:"err",name:"err",pkg:"encoding/json",typ:$error,tag:""},{prop:"redo",name:"redo",pkg:"encoding/json",typ:$Bool,tag:""},{prop:"redoCode",name:"redoCode",pkg:"encoding/json",typ:$Int,tag:""},{prop:"redoState",name:"redoState",pkg:"encoding/json",typ:GE,tag:""},{prop:"bytes",name:"bytes",pkg:"encoding/json",typ:$Int64,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=B.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=F.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=P.$init();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=Q.$init();$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=M.$init();$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=G.$init();$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=H.$init();$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=N.$init();$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=I.$init();$s=12;case 12:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=O.$init();$s=13;case 13:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=14;case 14:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=J.$init();$s=15;case 15:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=K.$init();$s=16;case 16:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=L.$init();$s=17;case 17:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}AV=new EV.ptr(new P.RWMutex.ptr(false,0),false);CM=new EY.ptr(new P.RWMutex.ptr(false,0),false);AA=E.New("JSON decoder out of sync - data changing underfoot?");AD=G.TypeOf(new X(""));AP="0123456789abcdef";a=G.TypeOf($newDataPointer($ifaceNil,FA)).Elem();$s=18;case 18:if($c){$c=false;a=a.$blk();}if(a&&a.$blk!==undefined){break s;}AY=a;b=G.TypeOf($newDataPointer($ifaceNil,FB)).Elem();$s=19;case 19:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}AZ=b;BK=$methodVal(new BJ(32),"encode");BL=$methodVal(new BJ(64),"encode");}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["github.com/ZiRo-/cuckgo/cuckoo"]=(function(){var $pkg={},$init,A,B,C,H,I,M,N,O,P,R,S,T,D,E,F,G,K;A=$packages["crypto/sha256"];B=$packages["encoding/json"];C=$pkg.Cuckoo=$newType(0,$kindStruct,"cuckoo.Cuckoo","Cuckoo","github.com/ZiRo-/cuckgo/cuckoo",function(v_){this.$val=this;if(arguments.length===0){this.v=N.zero();return;}this.v=v_;});H=$pkg.Edge=$newType(0,$kindStruct,"cuckoo.Edge","Edge","github.com/ZiRo-/cuckgo/cuckoo",function(U_,V_){this.$val=this;if(arguments.length===0){this.U=new $Uint64(0,0);this.V=new $Uint64(0,0);return;}this.U=U_;this.V=V_;});I=$pkg.CuckooJSON=$newType(0,$kindStruct,"cuckoo.CuckooJSON","CuckooJSON","github.com/ZiRo-/cuckgo/cuckoo",function(Parameter_,InputData_,Cycle_){this.$val=this;if(arguments.length===0){this.Parameter=false;this.InputData=P.nil;this.Cycle=O.nil;return;}this.Parameter=Parameter_;this.InputData=InputData_;this.Cycle=Cycle_;});M=$arrayType($Uint8,32);N=$arrayType($Uint64,4);O=$sliceType($Uint64);P=$sliceType($Uint8);R=$ptrType(H);S=$ptrType(C);T=$mapType($String,$Uint64);D=function(a){var $ptr,a,b;return(b=new $Uint64(0,a),new $Uint64(b.$high&0,(b.$low&255)>>>0));};E=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;a=$clone(a,M);return(c=(d=(e=(f=(g=(h=(i=D(((b<0||b>=a.length)?$throwRuntimeError("index out of range"):a[b])),j=$shiftLeft64(D((k=b+1>>0,((k<0||k>=a.length)?$throwRuntimeError("index out of range"):a[k]))),8),new $Uint64(i.$high|j.$high,(i.$low|j.$low)>>>0)),l=$shiftLeft64(D((m=b+2>>0,((m<0||m>=a.length)?$throwRuntimeError("index out of range"):a[m]))),16),new $Uint64(h.$high|l.$high,(h.$low|l.$low)>>>0)),n=$shiftLeft64(D((o=b+3>>0,((o<0||o>=a.length)?$throwRuntimeError("index out of range"):a[o]))),24),new $Uint64(g.$high|n.$high,(g.$low|n.$low)>>>0)),p=$shiftLeft64(D((q=b+4>>0,((q<0||q>=a.length)?$throwRuntimeError("index out of range"):a[q]))),32),new $Uint64(f.$high|p.$high,(f.$low|p.$low)>>>0)),r=$shiftLeft64(D((s=b+5>>0,((s<0||s>=a.length)?$throwRuntimeError("index out of range"):a[s]))),40),new $Uint64(e.$high|r.$high,(e.$low|r.$low)>>>0)),t=$shiftLeft64(D((u=b+6>>0,((u<0||u>=a.length)?$throwRuntimeError("index out of range"):a[u]))),48),new $Uint64(d.$high|t.$high,(d.$low|t.$low)>>>0)),v=$shiftLeft64(D((w=b+7>>0,((w<0||w>=a.length)?$throwRuntimeError("index out of range"):a[w]))),56),new $Uint64(c.$high|v.$high,(c.$low|v.$low)>>>0));};F=function(a){var $ptr,a,b;b=$clone(A.Sum256(a),M);return G(b);};$pkg.NewCuckoo=F;G=function(a){var $ptr,a,b,c,d;a=$clone(a,M);b=new C.ptr(N.zero());c=E(a,0);d=E(a,8);b.v[0]=new $Uint64(c.$high^1936682341,(c.$low^1886610805)>>>0);b.v[1]=new $Uint64(d.$high^1685025377,(d.$low^1852075885)>>>0);b.v[2]=new $Uint64(c.$high^1819895653,(c.$low^1852142177)>>>0);b.v[3]=new $Uint64(d.$high^1952801890,(d.$low^2037671283)>>>0);return b;};$pkg.NewCuckooSHA=G;H.ptr.prototype.HashCode=function(){var $ptr,a;a=this;return((a.U.$low>>0)^(a.V.$low>>0))>>0;};H.prototype.HashCode=function(){return this.$val.HashCode();};C.ptr.prototype.Sipedge=function(a){var $ptr,a,b;b=this;return new H.ptr(b.Sipnode(a,0),b.Sipnode(a,1));};C.prototype.Sipedge=function(a){return this.$val.Sipedge(a);};C.ptr.prototype.siphash24=function(a){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,di,dj,dk,dl,dm,dn,dp,dq,dr,ds,dt,du,dv,dw,dx,dy,dz,e,ea,eb,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b=this;c=b.v[0];d=b.v[1];e=b.v[2];g=(f=b.v[3],new $Uint64(f.$high^a.$high,(f.$low^a.$low)>>>0));c=(h=d,new $Uint64(c.$high+h.$high,c.$low+h.$low));e=(i=g,new $Uint64(e.$high+i.$high,e.$low+i.$low));d=(j=$shiftLeft64(d,13),k=$shiftRightUint64(d,51),new $Uint64(j.$high|k.$high,(j.$low|k.$low)>>>0));g=(l=$shiftLeft64(g,16),m=$shiftRightUint64(g,48),new $Uint64(l.$high|m.$high,(l.$low|m.$low)>>>0));d=(n=c,new $Uint64(d.$high^n.$high,(d.$low^n.$low)>>>0));g=(o=e,new $Uint64(g.$high^o.$high,(g.$low^o.$low)>>>0));c=(p=$shiftLeft64(c,32),q=$shiftRightUint64(c,32),new $Uint64(p.$high|q.$high,(p.$low|q.$low)>>>0));e=(r=d,new $Uint64(e.$high+r.$high,e.$low+r.$low));c=(s=g,new $Uint64(c.$high+s.$high,c.$low+s.$low));d=(t=$shiftLeft64(d,17),u=$shiftRightUint64(d,47),new $Uint64(t.$high|u.$high,(t.$low|u.$low)>>>0));g=(v=$shiftLeft64(g,21),w=$shiftRightUint64(g,43),new $Uint64(v.$high|w.$high,(v.$low|w.$low)>>>0));d=(x=e,new $Uint64(d.$high^x.$high,(d.$low^x.$low)>>>0));g=(y=c,new $Uint64(g.$high^y.$high,(g.$low^y.$low)>>>0));e=(z=$shiftLeft64(e,32),aa=$shiftRightUint64(e,32),new $Uint64(z.$high|aa.$high,(z.$low|aa.$low)>>>0));c=(ab=d,new $Uint64(c.$high+ab.$high,c.$low+ab.$low));e=(ac=g,new $Uint64(e.$high+ac.$high,e.$low+ac.$low));d=(ad=$shiftLeft64(d,13),ae=$shiftRightUint64(d,51),new $Uint64(ad.$high|ae.$high,(ad.$low|ae.$low)>>>0));g=(af=$shiftLeft64(g,16),ag=$shiftRightUint64(g,48),new $Uint64(af.$high|ag.$high,(af.$low|ag.$low)>>>0));d=(ah=c,new $Uint64(d.$high^ah.$high,(d.$low^ah.$low)>>>0));g=(ai=e,new $Uint64(g.$high^ai.$high,(g.$low^ai.$low)>>>0));c=(aj=$shiftLeft64(c,32),ak=$shiftRightUint64(c,32),new $Uint64(aj.$high|ak.$high,(aj.$low|ak.$low)>>>0));e=(al=d,new $Uint64(e.$high+al.$high,e.$low+al.$low));c=(am=g,new $Uint64(c.$high+am.$high,c.$low+am.$low));d=(an=$shiftLeft64(d,17),ao=$shiftRightUint64(d,47),new $Uint64(an.$high|ao.$high,(an.$low|ao.$low)>>>0));g=(ap=$shiftLeft64(g,21),aq=$shiftRightUint64(g,43),new $Uint64(ap.$high|aq.$high,(ap.$low|aq.$low)>>>0));d=(ar=e,new $Uint64(d.$high^ar.$high,(d.$low^ar.$low)>>>0));g=(as=c,new $Uint64(g.$high^as.$high,(g.$low^as.$low)>>>0));e=(at=$shiftLeft64(e,32),au=$shiftRightUint64(e,32),new $Uint64(at.$high|au.$high,(at.$low|au.$low)>>>0));c=(av=a,new $Uint64(c.$high^av.$high,(c.$low^av.$low)>>>0));e=(aw=new $Uint64(0,255),new $Uint64(e.$high^aw.$high,(e.$low^aw.$low)>>>0));c=(ax=d,new $Uint64(c.$high+ax.$high,c.$low+ax.$low));e=(ay=g,new $Uint64(e.$high+ay.$high,e.$low+ay.$low));d=(az=$shiftLeft64(d,13),ba=$shiftRightUint64(d,51),new $Uint64(az.$high|ba.$high,(az.$low|ba.$low)>>>0));g=(bb=$shiftLeft64(g,16),bc=$shiftRightUint64(g,48),new $Uint64(bb.$high|bc.$high,(bb.$low|bc.$low)>>>0));d=(bd=c,new $Uint64(d.$high^bd.$high,(d.$low^bd.$low)>>>0));g=(be=e,new $Uint64(g.$high^be.$high,(g.$low^be.$low)>>>0));c=(bf=$shiftLeft64(c,32),bg=$shiftRightUint64(c,32),new $Uint64(bf.$high|bg.$high,(bf.$low|bg.$low)>>>0));e=(bh=d,new $Uint64(e.$high+bh.$high,e.$low+bh.$low));c=(bi=g,new $Uint64(c.$high+bi.$high,c.$low+bi.$low));d=(bj=$shiftLeft64(d,17),bk=$shiftRightUint64(d,47),new $Uint64(bj.$high|bk.$high,(bj.$low|bk.$low)>>>0));g=(bl=$shiftLeft64(g,21),bm=$shiftRightUint64(g,43),new $Uint64(bl.$high|bm.$high,(bl.$low|bm.$low)>>>0));d=(bn=e,new $Uint64(d.$high^bn.$high,(d.$low^bn.$low)>>>0));g=(bo=c,new $Uint64(g.$high^bo.$high,(g.$low^bo.$low)>>>0));e=(bp=$shiftLeft64(e,32),bq=$shiftRightUint64(e,32),new $Uint64(bp.$high|bq.$high,(bp.$low|bq.$low)>>>0));c=(br=d,new $Uint64(c.$high+br.$high,c.$low+br.$low));e=(bs=g,new $Uint64(e.$high+bs.$high,e.$low+bs.$low));d=(bt=$shiftLeft64(d,13),bu=$shiftRightUint64(d,51),new $Uint64(bt.$high|bu.$high,(bt.$low|bu.$low)>>>0));g=(bv=$shiftLeft64(g,16),bw=$shiftRightUint64(g,48),new $Uint64(bv.$high|bw.$high,(bv.$low|bw.$low)>>>0));d=(bx=c,new $Uint64(d.$high^bx.$high,(d.$low^bx.$low)>>>0));g=(by=e,new $Uint64(g.$high^by.$high,(g.$low^by.$low)>>>0));c=(bz=$shiftLeft64(c,32),ca=$shiftRightUint64(c,32),new $Uint64(bz.$high|ca.$high,(bz.$low|ca.$low)>>>0));e=(cb=d,new $Uint64(e.$high+cb.$high,e.$low+cb.$low));c=(cc=g,new $Uint64(c.$high+cc.$high,c.$low+cc.$low));d=(cd=$shiftLeft64(d,17),ce=$shiftRightUint64(d,47),new $Uint64(cd.$high|ce.$high,(cd.$low|ce.$low)>>>0));g=(cf=$shiftLeft64(g,21),cg=$shiftRightUint64(g,43),new $Uint64(cf.$high|cg.$high,(cf.$low|cg.$low)>>>0));d=(ch=e,new $Uint64(d.$high^ch.$high,(d.$low^ch.$low)>>>0));g=(ci=c,new $Uint64(g.$high^ci.$high,(g.$low^ci.$low)>>>0));e=(cj=$shiftLeft64(e,32),ck=$shiftRightUint64(e,32),new $Uint64(cj.$high|ck.$high,(cj.$low|ck.$low)>>>0));c=(cl=d,new $Uint64(c.$high+cl.$high,c.$low+cl.$low));e=(cm=g,new $Uint64(e.$high+cm.$high,e.$low+cm.$low));d=(cn=$shiftLeft64(d,13),co=$shiftRightUint64(d,51),new $Uint64(cn.$high|co.$high,(cn.$low|co.$low)>>>0));g=(cp=$shiftLeft64(g,16),cq=$shiftRightUint64(g,48),new $Uint64(cp.$high|cq.$high,(cp.$low|cq.$low)>>>0));d=(cr=c,new $Uint64(d.$high^cr.$high,(d.$low^cr.$low)>>>0));g=(cs=e,new $Uint64(g.$high^cs.$high,(g.$low^cs.$low)>>>0));c=(ct=$shiftLeft64(c,32),cu=$shiftRightUint64(c,32),new $Uint64(ct.$high|cu.$high,(ct.$low|cu.$low)>>>0));e=(cv=d,new $Uint64(e.$high+cv.$high,e.$low+cv.$low));c=(cw=g,new $Uint64(c.$high+cw.$high,c.$low+cw.$low));d=(cx=$shiftLeft64(d,17),cy=$shiftRightUint64(d,47),new $Uint64(cx.$high|cy.$high,(cx.$low|cy.$low)>>>0));g=(cz=$shiftLeft64(g,21),da=$shiftRightUint64(g,43),new $Uint64(cz.$high|da.$high,(cz.$low|da.$low)>>>0));d=(db=e,new $Uint64(d.$high^db.$high,(d.$low^db.$low)>>>0));g=(dc=c,new $Uint64(g.$high^dc.$high,(g.$low^dc.$low)>>>0));e=(dd=$shiftLeft64(e,32),de=$shiftRightUint64(e,32),new $Uint64(dd.$high|de.$high,(dd.$low|de.$low)>>>0));c=(df=d,new $Uint64(c.$high+df.$high,c.$low+df.$low));e=(dg=g,new $Uint64(e.$high+dg.$high,e.$low+dg.$low));d=(dh=$shiftLeft64(d,13),di=$shiftRightUint64(d,51),new $Uint64(dh.$high|di.$high,(dh.$low|di.$low)>>>0));g=(dj=$shiftLeft64(g,16),dk=$shiftRightUint64(g,48),new $Uint64(dj.$high|dk.$high,(dj.$low|dk.$low)>>>0));d=(dl=c,new $Uint64(d.$high^dl.$high,(d.$low^dl.$low)>>>0));g=(dm=e,new $Uint64(g.$high^dm.$high,(g.$low^dm.$low)>>>0));c=(dn=$shiftLeft64(c,32),dp=$shiftRightUint64(c,32),new $Uint64(dn.$high|dp.$high,(dn.$low|dp.$low)>>>0));e=(dq=d,new $Uint64(e.$high+dq.$high,e.$low+dq.$low));c=(dr=g,new $Uint64(c.$high+dr.$high,c.$low+dr.$low));d=(ds=$shiftLeft64(d,17),dt=$shiftRightUint64(d,47),new $Uint64(ds.$high|dt.$high,(ds.$low|dt.$low)>>>0));g=(du=$shiftLeft64(g,21),dv=$shiftRightUint64(g,43),new $Uint64(du.$high|dv.$high,(du.$low|dv.$low)>>>0));d=(dw=e,new $Uint64(d.$high^dw.$high,(d.$low^dw.$low)>>>0));g=(dx=c,new $Uint64(g.$high^dx.$high,(g.$low^dx.$low)>>>0));e=(dy=$shiftLeft64(e,32),dz=$shiftRightUint64(e,32),new $Uint64(dy.$high|dz.$high,(dy.$low|dz.$low)>>>0));return(ea=(eb=new $Uint64(c.$high^d.$high,(c.$low^d.$low)>>>0),new $Uint64(eb.$high^e.$high,(eb.$low^e.$low)>>>0)),new $Uint64(ea.$high^g.$high,(ea.$low^g.$low)>>>0));};C.prototype.siphash24=function(a){return this.$val.siphash24(a);};C.ptr.prototype.Sipnode=function(a,b){var $ptr,a,b,c,d,e,f;c=this;return(d=c.siphash24((e=$mul64(new $Uint64(0,2),a),f=new $Uint64(0,b),new $Uint64(e.$high+f.$high,e.$low+f.$low))),new $Uint64(d.$high&0,(d.$low&524287)>>>0));};C.prototype.Sipnode=function(a,b){return this.$val.Sipnode(a,b);};C.ptr.prototype.Verify=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;c=this;d=$makeSlice(O,42);e=$makeSlice(O,42);f=0;g=new $Uint64(0,0);g=new $Uint64(0,0);while(true){if(!((g.$high<0||(g.$high===0&&g.$low<42)))){break;}if((h=(($flatten64(g)<0||$flatten64(g)>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+$flatten64(g)]),(h.$high>b.$high||(h.$high===b.$high&&h.$low>=b.$low)))||(!((g.$high===0&&g.$low===0))&&(i=(($flatten64(g)<0||$flatten64(g)>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+$flatten64(g)]),j=(k=new $Uint64(g.$high-0,g.$low-1),(($flatten64(k)<0||$flatten64(k)>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+$flatten64(k)])),(i.$high=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+$flatten64(g)]=c.Sipnode((($flatten64(g)<0||$flatten64(g)>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+$flatten64(g)]),0));(($flatten64(g)<0||$flatten64(g)>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+$flatten64(g)]=c.Sipnode((($flatten64(g)<0||$flatten64(g)>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+$flatten64(g)]),1));g=(l=new $Uint64(0,1),new $Uint64(g.$high+l.$high,g.$low+l.$low));}m=true;while(true){if(!(m)){break;}n=f;o=0;while(true){if(!((p=new $Uint64(0,o),(p.$high<0||(p.$high===0&&p.$low<42))))){break;}if(!((o===f))&&(q=((o<0||o>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+o]),r=((f<0||f>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+f]),(q.$high===r.$high&&q.$low===r.$low))){if(!((n===f))){return false;}n=o;}o=o+(1)>>0;}if(n===f){return false;}f=n;s=0;while(true){if(!((t=new $Uint64(0,s),(t.$high<0||(t.$high===0&&t.$low<42))))){break;}if(!((s===n))&&(u=((s<0||s>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+s]),v=((n<0||n>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+n]),(u.$high===v.$high&&u.$low===v.$low))){if(!((f===n))){return false;}f=s;}s=s+(1)>>0;}if(f===n){return false;}g=(w=new $Uint64(0,2),new $Uint64(g.$high-w.$high,g.$low-w.$low));m=!((f===0));}return(g.$high===0&&g.$low===0);};C.prototype.Verify=function(a,b){return this.$val.Verify(a,b);};K=function(a){var $ptr,a,b,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:a=$clone(a,I);b=B.Marshal(new a.constructor.elem(a));$s=1;case 1:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}$s=2;case 2:return b;}return;}if($f===undefined){$f={$blk:K};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.$s=$s;$f.$r=$r;return $f;};$pkg.EncodeCuckooJSON=K;S.methods=[{prop:"Sipedge",name:"Sipedge",pkg:"",typ:$funcType([$Uint64],[R],false)},{prop:"siphash24",name:"siphash24",pkg:"github.com/ZiRo-/cuckgo/cuckoo",typ:$funcType([$Uint64],[$Uint64],false)},{prop:"Sipnode",name:"Sipnode",pkg:"",typ:$funcType([$Uint64,$Uint32],[$Uint64],false)},{prop:"Verify",name:"Verify",pkg:"",typ:$funcType([O,$Uint64],[$Bool],false)}];R.methods=[{prop:"HashCode",name:"HashCode",pkg:"",typ:$funcType([],[$Int],false)}];C.init([{prop:"v",name:"v",pkg:"github.com/ZiRo-/cuckgo/cuckoo",typ:N,tag:""}]);H.init([{prop:"U",name:"U",pkg:"",typ:$Uint64,tag:""},{prop:"V",name:"V",pkg:"",typ:$Uint64,tag:""}]);I.init([{prop:"Parameter",name:"Parameter",pkg:"",typ:T,tag:"json:\"parameters\""},{prop:"InputData",name:"InputData",pkg:"",typ:P,tag:"json:\"header\""},{prop:"Cycle",name:"Cycle",pkg:"",typ:O,tag:"json:\"cycle\""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["github.com/ZiRo-/cuckgo/miner_js"]=(function(){var $pkg={},$init,A,B,C,D,E,F,M,N,O,P,Q,R,S,T,U,V,G,H,I,J,K,L;A=$packages["crypto/rand"];B=$packages["crypto/sha256"];C=$packages["encoding/base64"];D=$packages["github.com/ZiRo-/cuckgo/cuckoo"];E=$packages["github.com/gopherjs/gopherjs/js"];F=$pkg.CuckooSolve=$newType(0,$kindStruct,"main.CuckooSolve","CuckooSolve","github.com/ZiRo-/cuckgo/miner_js",function(graph_,easiness_,cuckoo_,sols_,nsols_,nthreads_){this.$val=this;if(arguments.length===0){this.graph=M.nil;this.easiness=0;this.cuckoo=N.nil;this.sols=O.nil;this.nsols=0;this.nthreads=0;return;}this.graph=graph_;this.easiness=easiness_;this.cuckoo=cuckoo_;this.sols=sols_;this.nsols=nsols_;this.nthreads=nthreads_;});M=$ptrType(D.Cuckoo);N=$sliceType($Int);O=$sliceType(N);P=$ptrType(D.Edge);Q=$sliceType($Uint8);R=$arrayType($Uint8,32);S=$sliceType($Uint64);T=$funcType([$Float64],[$String],false);U=$mapType($String,$emptyInterface);V=$ptrType(F);G=function(a,b,c,d){var $ptr,a,b,c,d,e,f,g,h,i;e=new F.ptr(D.NewCuckoo(a),b,$makeSlice(N,1048577),$makeSlice(O,($imul(2,c))),0,1);f=e.sols;g=0;while(true){if(!(g=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+h]=$makeSlice(N,42)));g++;}return e;};$pkg.NewCuckooSolve=G;F.ptr.prototype.path=function(a,b){var $ptr,a,b,c,d,e,f;c=this;d=0;d=0;while(true){if(!(!((a===0)))){break;}d=d+(1)>>0;if(d>=4096){while(true){if(!(!((d===0))&&!(((e=d-1>>0,((e<0||e>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+e]))===a)))){break;}d=d-(1)>>0;}if(d<0){}else{}return-1;}((d<0||d>=b.$length)?$throwRuntimeError("index out of range"):b.$array[b.$offset+d]=a);a=(f=c.cuckoo,((a<0||a>=f.$length)?$throwRuntimeError("index out of range"):f.$array[f.$offset+a]));}return d;};F.prototype.path=function(a,b){return this.$val.path(a,b);};F.ptr.prototype.solution=function(a,b,c,d){var $ptr,a,aa,ab,ac,ad,ae,af,ag,ah,ai,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=this;f={};g=0;i=new D.Edge.ptr(new $Uint64(0,(0>=a.$length?$throwRuntimeError("index out of range"):a.$array[a.$offset+0])),(h=new $Uint64(0,(0>=c.$length?$throwRuntimeError("index out of range"):c.$array[c.$offset+0])),new $Uint64(h.$high-0,h.$low-524288)));j=i.HashCode();(f||$throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(j)]={k:j,v:i};while(true){if(!(!((b===0)))){break;}b=b-(1)>>0;n=new D.Edge.ptr(new $Uint64(0,(k=(((b+1>>0))&~1)>>0,((k<0||k>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+k]))),(l=new $Uint64(0,(m=b|1,((m<0||m>=a.$length)?$throwRuntimeError("index out of range"):a.$array[a.$offset+m]))),new $Uint64(l.$high-0,l.$low-524288)));o=(p=f[$Int.keyFor(n.HashCode())],p!==undefined?[p.v,true]:[P.nil,false]);q=o[1];if(!q){r=n.HashCode();(f||$throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(r)]={k:r,v:n};}}while(true){if(!(!((d===0)))){break;}d=d-(1)>>0;v=new D.Edge.ptr(new $Uint64(0,(s=d|1,((s<0||s>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+s]))),(t=new $Uint64(0,(u=(((d+1>>0))&~1)>>0,((u<0||u>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+u]))),new $Uint64(t.$high-0,t.$low-524288)));w=(x=f[$Int.keyFor(v.HashCode())],x!==undefined?[x.v,true]:[P.nil,false]);y=w[1];if(!y){z=v.HashCode();(f||$throwRuntimeError("assignment to entry in nil map"))[$Int.keyFor(z)]={k:z,v:v};}}g=0;aa=0;while(true){if(!(aa=ag.$length)?$throwRuntimeError("index out of range"):ag.$array[ag.$offset+ah])),((g<0||g>=af.$length)?$throwRuntimeError("index out of range"):af.$array[af.$offset+g]=aa));g=g+(1)>>0;delete f[$Int.keyFor(ae)];}aa=aa+(1)>>0;}if((ai=new $Uint64(0,g),(ai.$high===0&&ai.$low===42))){e.nsols=e.nsols+(1)>>0;}else{}};F.prototype.solution=function(a,b,c,d){return this.$val.solution(a,b,c,d);};H=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m;c=b.HashCode();d=a;e=0;f=$keys(d);while(true){if(!(e=d.$length?$throwRuntimeError("index out of range"):d.$array[d.$offset+0]=(b.graph.Sipnode(new $Uint64(0,f),0).$low>>0));h=(g=(0>=d.$length?$throwRuntimeError("index out of range"):d.$array[d.$offset+0]),((g<0||g>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+g]));(0>=e.$length?$throwRuntimeError("index out of range"):e.$array[e.$offset+0]=((i=b.graph.Sipnode(new $Uint64(0,f),1),new $Uint64(0+i.$high,524288+i.$low)).$low>>0));k=(j=(0>=e.$length?$throwRuntimeError("index out of range"):e.$array[e.$offset+0]),((j<0||j>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+j]));if((h===(0>=e.$length?$throwRuntimeError("index out of range"):e.$array[e.$offset+0]))||(k===(0>=d.$length?$throwRuntimeError("index out of range"):d.$array[d.$offset+0]))){f=f+(b.nthreads)>>0;continue;}l=b.path(h,d);m=b.path(k,e);if((l===-1)||(m===-1)){return;}if(((l<0||l>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+l])===((m<0||m>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+m])){n=0;if(l>0;m=m-(n)>>0;while(true){if(!(!((((l<0||l>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+l])===((m<0||m>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+m]))))){break;}l=l+(1)>>0;m=m+(1)>>0;}o=(l+m>>0)+1>>0;if((p=new $Uint64(0,o),(p.$high===0&&p.$low===42))&&b.nsols>0;continue;}if(l>0;(q=(r=l+1>>0,((r<0||r>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+r])),((q<0||q>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+q]=((l<0||l>=d.$length)?$throwRuntimeError("index out of range"):d.$array[d.$offset+l])));}(s=(0>=d.$length?$throwRuntimeError("index out of range"):d.$array[d.$offset+0]),((s<0||s>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+s]=(0>=e.$length?$throwRuntimeError("index out of range"):e.$array[e.$offset+0])));}else{while(true){if(!(!((m===0)))){break;}m=m-(1)>>0;(t=(u=m+1>>0,((u<0||u>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+u])),((t<0||t>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+t]=((m<0||m>=e.$length)?$throwRuntimeError("index out of range"):e.$array[e.$offset+m])));}(v=(0>=e.$length?$throwRuntimeError("index out of range"):e.$array[e.$offset+0]),((v<0||v>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+v]=(0>=d.$length?$throwRuntimeError("index out of range"):d.$array[d.$offset+0])));}f=f+(b.nthreads)>>0;}};J=function(a){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,$s,$r;$s=0;var $f,$c=false;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$ptr=$f.$ptr;a=$f.a;b=$f.b;c=$f.c;d=$f.d;e=$f.e;f=$f.f;g=$f.g;h=$f.h;i=$f.i;j=$f.j;k=$f.k;l=$f.l;m=$f.m;n=$f.n;o=$f.o;p=$f.p;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:b=8;c=$makeSlice(Q,64);e=A.Read(c);$s=1;case 1:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}d=e;f=d[1];if(!($interfaceIsEqual(f,$ifaceNil))){$panic(f);}g=(a*1.048576e+06/100>>0);h=G(c,g,b,1);i=0;case 2:if(!(i<960)){$s=3;continue;}c=$append(c,0);j=0;case 4:if(!(j<256)){$s=5;continue;}(k=64+i>>0,((k<0||k>=c.$length)?$throwRuntimeError("index out of range"):c.$array[c.$offset+k]=(j<<24>>>24)));h=G(c,g,b,1);I(j,h);if(h.nsols>0){$s=6;continue;}$s=7;continue;case 6:$s=8;continue;case 7:j=j+(1)>>0;$s=4;continue;case 5:i=i+(1)>>0;$s=2;continue;case 3:case 8:if(h.sols.$length>0){$s=9;continue;}$s=10;continue;case 9:l=$clone(K(h,c),D.CuckooJSON);n=D.EncodeCuckooJSON(l);$s=12;case 12:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}m=n;o=m[0];p=C.StdEncoding.EncodeToString(o);return p;case 10:return"No Solution found.";case 11:$s=-1;case-1:}return;}if($f===undefined){$f={$blk:J};}$f.$ptr=$ptr;$f.a=a;$f.b=b;$f.c=c;$f.d=d;$f.e=e;$f.f=f;$f.g=g;$f.h=h;$f.i=i;$f.j=j;$f.k=k;$f.l=l;$f.m=m;$f.n=n;$f.o=o;$f.p=p;$f.$s=$s;$f.$r=$r;return $f;};K=function(a,b){var $ptr,a,b,c,d,e,f,g,h,i,j,k,l,m;c=$clone(B.Sum256(b),R);d=new $Uint64(0,a.easiness);f=$makeSlice(S,(e=a.sols,(0>=e.$length?$throwRuntimeError("index out of range"):e.$array[e.$offset+0])).$length);g={};h="easiness";(g||$throwRuntimeError("assignment to entry in nil map"))[$String.keyFor(h)]={k:h,v:d};i=(j=a.sols,(0>=j.$length?$throwRuntimeError("index out of range"):j.$array[j.$offset+0]));k=0;while(true){if(!(k=i.$length)?$throwRuntimeError("index out of range"):i.$array[i.$offset+k]);((l<0||l>=f.$length)?$throwRuntimeError("index out of range"):f.$array[f.$offset+l]=new $Uint64(0,m));k++;}return new D.CuckooJSON.ptr(g,new Q(c),f);};L=function(){var $ptr;$global.cuckoo=$externalize($makeMap($String.keyFor,[{k:"mine_cuckoo",v:new T(J)}]),U);};V.methods=[{prop:"path",name:"path",pkg:"github.com/ZiRo-/cuckgo/miner_js",typ:$funcType([$Int,N],[$Int],false)},{prop:"solution",name:"solution",pkg:"github.com/ZiRo-/cuckgo/miner_js",typ:$funcType([N,$Int,N,$Int],[],false)}];F.init([{prop:"graph",name:"graph",pkg:"github.com/ZiRo-/cuckgo/miner_js",typ:M,tag:""},{prop:"easiness",name:"easiness",pkg:"github.com/ZiRo-/cuckgo/miner_js",typ:$Int,tag:""},{prop:"cuckoo",name:"cuckoo",pkg:"github.com/ZiRo-/cuckgo/miner_js",typ:N,tag:""},{prop:"sols",name:"sols",pkg:"github.com/ZiRo-/cuckgo/miner_js",typ:O,tag:""},{prop:"nsols",name:"nsols",pkg:"github.com/ZiRo-/cuckgo/miner_js",typ:$Int,tag:""},{prop:"nthreads",name:"nthreads",pkg:"github.com/ZiRo-/cuckgo/miner_js",typ:$Int,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if($pkg===$mainPkg){L();$mainFinished=true;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $synthesizeMethods(); -var $mainPkg = $packages["main"]; +var $mainPkg = $packages["github.com/ZiRo-/cuckgo/miner_js"]; $packages["runtime"].$init(); $go($mainPkg.$init, [], true); $flushConsole(); }).call(this); -//# sourceMappingURL=miner-js.js.map +//# sourceMappingURL=miner_js.js.map